-
Notifications
You must be signed in to change notification settings - Fork 446
Allow updating existing documents by removing duplicates before upload #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: sinedied <[email protected]>
@Copilot please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Currently, uploading the same document twice creates duplicated chunks in the vector database. This PR implements deduplication functionality that removes all existing chunks with the same filename before adding new ones, allowing for document updates without duplication.
Changes Made
Azure CosmosDB NoSQL Vector Store Path
SELECT * FROM c WHERE c.metadata.source = "{filename}"
to find existing documentsFAISS Vector Store Path (Local Development)
removeDuplicateDocuments()
helper function to find and delete existing documentsmetadata.source
delete()
methodImplementation Details
Before this change:
After this change:
The solution is minimal and preserves all existing functionality while adding the requested deduplication capability.
Fixes #36.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
functionscdn.azureedge.net
node lib/install.js
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.