[Question]: How can I improve responses? #8377
Replies: 6 comments
-
I think a custom retriever will work best here. I'm imagining something that can use the metadata or node relationships to pull in the most relevant nodes. There's definitely quite a range of different types of queries here (some may need keywords, some may need to read the entire index, some may work fine with vector search) We actually JUST released a retriever router, maybe you'll find this useful https://github.com/jerryjliu/llama_index/blob/main/docs/examples/retrievers/router_retriever.ipynb https://gpt-index.readthedocs.io/en/stable/core_modules/query_modules/retriever/root.html |
Beta Was this translation helpful? Give feedback.
-
@logan-markewich Thank you. This is great. I watched this https://www.youtube.com/watch?v=njzB6fm0U8g a few days ago and would love to know your thoughts on which approach to pursue first. When I watched this, my initial thought was that using Docugami's knowledge graph structure and attached metadata will probably do it, but creating a custom retriever like this seems to be more applicable for handling queries that require disparate information. If you were me, would you start with creating a retriever and then pairing this with a metadata approach? |
Beta Was this translation helpful? Give feedback.
-
Implemented the router and had to use a prompt to force the selector to use the keyword retriever (aside: PydanticMultiSelector would not choose multiple retrievers, but LLMMultiSelector did). Big improvement but in testing I'm still not fetching very many relevant nodes. I'm testing specifically this question: "What were some high points from the February 2023 Monthly Update?" but only getting 1 node back with the word "February" in it while using LLMRerank. I considered using a KeywordNodePostprocessor, but this doesn't seem flexible if you have to specify words for each unique query. I can see in my logs that are two identical nodes with text that say "In our February update , we reported that..." but these nodes are not being chosen by the LLMRerank.
|
Beta Was this translation helpful? Give feedback.
-
It appears that "February" is not part of my extracted keyword list, which I believe is the problem. I'm attempting to use a prompt template in my keyword_retriever, but I'm having trouble enforcing it's purpose.
I specifically said "extract the word February" and it didn't work. Very strange. |
Beta Was this translation helpful? Give feedback.
-
🤖 Hello, Thank you for reaching out and providing a detailed description of your issue. It seems like you're dealing with a complex problem related to querying across multiple documents and getting accurate responses. I'll try to provide some guidance based on your current plan and the code you've shared. Firstly, your plan to experiment with different settings and models is a good approach. Here are some additional suggestions based on your plan:
In addition to these, you might want to consider the following:
I hope these suggestions help you improve the response quality of your LlamaIndex. Please let me know if you have any other questions or need further clarification. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
🤖 Hello, Thank you for reaching out and providing a detailed description of your issue. I understand that you're experiencing problems with the response quality when querying across documents using LlamaIndex. I'll try to provide some guidance based on your current situation and the code you've shared. Firstly, your plan of action seems to be on the right track. Here are some additional suggestions based on your points:
In addition to these points, based on the solved issues in the LlamaIndex repository, you might want to consider the following:
I hope these suggestions help you improve the performance of your LlamaIndex. Please let me know if you have any further questions or if there's anything else I can assist you with. Best, Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
Question Validation
Question
I'm running into issues with the response quality I'm getting querying across documents. Currently testing out two batches of PDFs, one 11MB in size and the other 72. When I reference specific file names, such as "October 2022 update," I'm getting answers w/ information from the wrong file. I also cannot get correct answers to questions like "when was the last time we said something about x?" or "what date did we send xyz?" They are not all date-related issues, however. Another example: If I say "what have we said about y?" I receive a description of the wrong entity. Just giving examples for color.
Can someone help me understand the forces at play here? I know it's not probably possible to achieve correct answers 100% of the time, but my performance as of now is poor. I believe my index needs to be more robust to handle the complex queries I'm asking across many documents. Here is my current plan of things to try:
An additional idea I had was to use different indices/composability as I scale up knowledge base size, but that doesn't apply directly to the problem at hand since these issues are happening across a relatively small # of files.
Are there other things I should try to test or incorporate? I'm a beginner but eager to learn more. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions