Pre-pgvector migration checkpoint — upsert, allow_replace_deleted, maintenance timer

This commit is contained in:
2026-04-26 20:19:49 +00:00
parent 72c8d1ef2c
commit d2eed98906
5 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ embedder = SentenceTransformer("all-MiniLM-L6-v2")
client = chromadb.PersistentClient(path=db_path)
collection = client.get_or_create_collection(
name="aaronai",
metadata={"hnsw:space": "cosine"}
metadata={"hnsw:space": "cosine", "hnsw:allow_replace_deleted": True}
)
def extract_messages(convo):
@@ -102,7 +102,7 @@ def ingest_conversations(path):
continue
embeddings = embedder.encode([n[1] for n in new]).tolist()
collection.add(
collection.upsert(
ids=[n[0] for n in new],
documents=[n[1] for n in new],
metadatas=[n[2] for n in new],
@@ -138,7 +138,7 @@ def ingest_memories(path):
collection.delete(ids=[chunk_id])
embedding = embedder.encode([chunk_text]).tolist()
collection.add(
collection.upsert(
ids=[chunk_id],
documents=[chunk_text],
metadatas=[{