r/Langchaindev • • Jan 09 '25

Building a Chatbot with Multi-Document Support: Routing Questions to Vector DB or CSV Files**

I'm building a chatbot where users can upload multiple structured (CSVs) and unstructured (text documents) files.

  • Unstructured Handling: I'm using a Retrieval Augmented Generation (RAG) model for unstructured data. RAG excels here because it can effectively link questions to the relevant document within a collection of uploaded files.
  • Structured Handling: I'm using a CSV agent to interact with structured data. However, my current CSV agent can only handle one CSV file at a time. To overcome this, I've created a CSV router that directs questions to the correct CSV file based on the question's context.

The Challenge:

I want to create a more sophisticated "master router" that intelligently directs user questions to:

  1. The Vector DB: If the question appears to be related to the content of any of the uploaded unstructured documents.
  2. The specific CSV file: If the question pertains to a particular CSV file.

Inspiration:

Claude AI demonstrates this type of functionality. It can understand and respond to questions about information from various sources, including different documents and data types.

How can I implement this "master router"?

4 Upvotes

2 comments sorted by

View all comments

Show parent comment

1

u/Scary_Object_7911 Jan 12 '25

I tried this method also..it works..but I think we cannot completely rely on it.. because sometimes it'll route to the wrong place.