Using SQLRecordManager
mgarcia
·
2026-04-20
·
via LangChain Forum - Latest posts
Dear all, Does anybody have a good reference on how to use SQLRecordManager ? I trying to avoid duplicated documents on my vector store (Chroma). I have the following code: from langchain_classic.indexes import SQLRecordManager, index (...) # Initialize the record manager. record_manager = SQLRecordManager( namespace="ETD", db_url=f"sqlite:///{record_manager_db}", ) logger.info("Indexing document to vector store") result = index( chunks, record_manager, vector_store, cleanup="incremental", source_id_key="source", key_encoder="blake2b", ) logger.info( "Indexing complete: added=%d, skipped=%d, deleted=%d", result["num_added"], result["num_skipped"], result["num_deleted"], ) (...) when I run my script to ingest documents that are already indexed, I see that some chunks are updated (added and deleted): 2026-03-18 13:50:01,392 - __main__ - INFO - Indexing complete: added=37, skipped=100, deleted=37, So it seems to be OK. But the SQLite file keeps growing even if the net sum of added elements is zero. Is this OK? If yes, then, doesn’t this behavior defeats the purpose of not adding duplicated items? Thank you Marcelo 2 posts - 2 participants Read full topic
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。