-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from Madhuvod/rag-doc-router
Added new demo
- Loading branch information
Showing
5 changed files
with
458 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ai_agent_tutorials/multimodal_design_agent_team/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# RAG Agent with Database Routing | ||
|
||
This project showcases the RAG with database routing capabilities - which is a very efficient way to retrieve information from a large set of documents. The application allows users to: | ||
|
||
1. Upload documents to three different databases: | ||
- Product Information | ||
- Customer Support & FAQ | ||
- Financial Information | ||
|
||
2. Query information using natural language, with automatic routing to the most relevant database. | ||
|
||
## Features | ||
|
||
- **Document Upload**: Users can upload multiple PDF documents related to a particular company. These documents are processed and stored in one of the three databases: Product Information, Customer Support & FAQ, or Financial Information. | ||
|
||
- **Natural Language Querying**: Users can ask questions in natural language. The system automatically routes the query to the most relevant database using a phidata agent as the router. | ||
|
||
- **RAG Orchestration**: Utilizes Langchain for orchestrating the retrieval augmented generation process, ensuring that the most relevant information is retrieved and presented to the user. | ||
|
||
- **Fallback Mechanism**: If no relevant documents are found in the databases, a LangGraph agent with a DuckDuckGo search tool is used to perform web research and provide an answer. | ||
|
||
- **User Interface**: Built with Streamlit, providing an intuitive and interactive user experience. | ||
|
||
## How to Run? | ||
|
||
1. **Clone the Repository**: | ||
```bash | ||
git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git | ||
cd rag_tutorials/rag_database_routing | ||
``` | ||
|
||
2. **Install Dependencies**: | ||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
3. **Run the Application**: | ||
```bash | ||
streamlit run rag_database_routing.py | ||
``` | ||
|
||
4. **Configure API Key**: Obtain an OpenAI API key and set it in the application. This is required for initializing the language models used in the application. | ||
|
||
5. **Upload Documents**: Use the document upload section to add PDF documents to the desired database. | ||
|
||
6. **Ask Questions**: Enter your questions in the query section. The application will route your question to the appropriate database and provide an answer. | ||
|
||
## Technologies Used | ||
|
||
- **Langchain**: For RAG orchestration, ensuring efficient retrieval and generation of information. | ||
- **Phidata Agent**: Used as the router agent to determine the most relevant database for a given query. | ||
- **LangGraph Agent**: Acts as a fallback mechanism, utilizing DuckDuckGo for web research when necessary. | ||
- **Streamlit**: Provides a user-friendly interface for document upload and querying. | ||
- **ChromaDB**: Used for managing the databases, storing and retrieving document embeddings efficiently. | ||
|
||
This application is designed to streamline the process of retrieving information from large sets of documents, making it easier for users to find the answers they need quickly and efficiently. |
Oops, something went wrong.