run-llama / llama_index

LlamaIndex is a data framework for your LLM applications
https://docs.llamaindex.ai
MIT License
35.87k stars 5.09k forks source link

Multi-documnet RAG #8613

Closed snassimr closed 11 months ago

snassimr commented 11 months ago

Question Validation

Question

Hi ,

I want to try and build multi-document RAG to support questions across several relevant docs.

I see some good example here link

I wonder if there is some another technique for multi-document case .

Now I am using ReactAgent with several tools.

dosubot[bot] commented 11 months ago

🤖

Hello @snassimr,

It's great to see you again and I'm glad to see you're exploring multi-document Retrieval-Augmented Generation (RAG) with LlamaIndex.

There are indeed several techniques you can use to build a multi-document RAG, and I'm glad you found the example in the tutorial helpful. Here are some additional techniques you might find useful:

  1. Decoupling Chunks Used for Retrieval vs. Chunks Used for Synthesis: This technique involves separating the chunks used for retrieval from those used for synthesis. You can find more details in our production RAG guide.

  2. Structured Retrieval for Larger Document Sets: This technique is useful when dealing with a large number of documents. It involves using structured information to help with more precise retrieval.

  3. Dynamically Retrieve Chunks Depending on your Task: This technique involves using different retrieval techniques depending on the type of query. LlamaIndex provides some core abstractions to help you do task-specific retrieval.

  4. Optimize Context Embeddings: This technique involves optimizing the embeddings for better retrieval over your specific data corpus.

  5. Knowledge Graph RAG Query Engine: This technique involves using a Knowledge Graph RAG approach to retrieve information from a Knowledge Graph based on a given task. You can find an example in our Knowledge Graph RAG Query Engine notebook.

  6. Recursive Retrieval and Document Agents: This technique involves combining recursive retrieval and "document agents" for advanced decision making over heterogeneous documents. You can find an example in our Recursive Retriever Agents notebook.

  7. Multi-Document Agents: This technique involves setting up an agent that can effectively answer different types of questions over a larger set of documents. You can find an example in our Multi Document Agents notebook.

Regarding your use of ReactAgent, it's a class that uses a ReAct prompt for both chat and text completion endpoints. It can take in a set of tools that require structured inputs. You can find more details in our ReactAgent documentation and use cases.

I hope this helps! If you have any more questions or need further clarification, feel free to ask.

Best, Dosu

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.