Skip to content

Commit ad6d1ef

Browse files
authored
fix: Don't delete Chroma collection; delete constituent documents (#114)
1 parent c6623cb commit ad6d1ef

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

app/src/ingestion/rag_utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ def populate_vector_db() -> None:
2626

2727
# Clear existing collection if any
2828
if doc_store.count_documents() > 0:
29-
logger.info("Deleting existing vector DB collection=%r", collection_name)
30-
chroma_client.delete_collection(collection_name)
31-
# Re-create the document store after deletion
32-
doc_store = config.chroma_document_store()
29+
# Don't delete collection since it's referenced by existing pipelines upon their startup
30+
logger.info("Clearing out existing vector DB collection=%r", collection_name)
31+
doc_store.delete_all_documents()
3332

3433
# Download files from S3
3534
local_folder = download_s3_folder_to_local()

0 commit comments

Comments
 (0)