Skip to content
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

community: Get Document object by Document ID from Chroma DB #16671

Closed

Conversation

raunakshrivastava7
Copy link
Contributor

  • Description:
    Added get_document_by_id() function in langchain_community/vectorstores/chroma.py to get Document object from
    Document ID.
    Document object is required for updating any document. get_document_by_id() function will help users to get the
    Document object from Document ID. Then the metadata or page_content of the Document object can be modified by the
    user and passed to update_document() function.

  • Issue: Fixed Get Chroma vectorstore Document by doc_id for document / metadata updates. #15261

Copy link

vercel bot commented Jan 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2024 4:23pm

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Ɑ: vector store Related to vector store module 🤖:improvement Medium size change to existing code to handle new use-cases 🔌: chroma Primarily related to ChromaDB integrations labels Jan 27, 2024
Copy link
Collaborator

@baskaryan baskaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeffchuber
Copy link
Contributor

@raunakshrivastava7 another way to do this is to by creating a chroma client and passing it to langchain.

https://python.langchain.com/docs/integrations/vectorstores/chroma#passing-a-chroma-client-into-langchain

My personal feeling is the glue between Chroma-Langchain should focus on the the tools that Langchain as a framework needs (maybe that is the case here?) - otherwise the glue will have to expand to be the full set of Chroma's API and then is more apt to break. From a user education perspective, I think it's also generally more clear "which API you are learning" if they are separate.

However... I don't feel strongly! Maybe it's just this morning cup of coffee talking.

@baskaryan thoughts?

@hwchase17 hwchase17 closed this Jan 30, 2024
@baskaryan baskaryan reopened this Jan 30, 2024
@baskaryan baskaryan closed this Jan 30, 2024
@baskaryan baskaryan reopened this Jan 30, 2024
@raunakshrivastava7
Copy link
Contributor Author

As per my understanding, currently the Document object can be fetched using similarity_search functions in langchain. There is no direct method or API to get the Document object from Document ID. The PR solves this problem.

@raunakshrivastava7
Copy link
Contributor Author

As per my understanding, currently the Document object can be fetched using similarity_search functions in langchain. There is no direct method or API to get the Document object from Document ID. The PR solves this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌: chroma Primarily related to ChromaDB integrations 🤖:improvement Medium size change to existing code to handle new use-cases size:M This PR changes 30-99 lines, ignoring generated files. Ɑ: vector store Related to vector store module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get Chroma vectorstore Document by doc_id for document / metadata updates.
4 participants