how to get relevant documents using Chroma while using ParentDocumentRetriever? #17579
Replies: 2 comments
-
🤖 Hey @nithinreddyyyyyy! Great to see you back and diving into more complex features of LangChain. How's everything going on your end? Based on the code you've provided, it seems like you're trying to retrieve relevant documents using the The If you want to retrieve relevant documents, you might want to use a different retriever that implements this method. For example, the # Instantiate the SelfQueryRetriever with enable_limit=True
retriever = SelfQueryRetriever.from_llm(
llm,
vectorstore,
document_content_description,
metadata_field_info,
enable_limit=True,
verbose=True,
)
# Retrieve two relevant documents about dinosaurs
retriever.get_relevant_documents("what are two movies about dinosaurs") In this example, the You can find more information about this in the Chroma Self Query notebook in the LangChain documentation. If you're specifically interested in using the I hope this helps! If you have any other questions, feel free to ask. Sources
|
Beta Was this translation helpful? Give feedback.
-
Would you say the Self-querying strategy which helps for query construction is like Hybrid Search? Also I would look into different more advanced text splitting strategies. The recursive splitting is a great start but depending on the kind of data ou are working with the chunking strategy may break similar sentences into different chunks instead of keeping it together as one. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I've given the code above, i'm unable to find any code like how to retrieve the documents using the above retriever, i tried the below code, but it is not working
parent_document_retriever.get_relevant_documents(query)
and also i need to set the topk limit. Can you help me with the code?
System Info
google colab
Beta Was this translation helpful? Give feedback.
All reactions