Categorized Multi-Index RAG System

Typical RAG system often faces many challenges like below:

  1. Data management:

    • Managing this data becomes crucial.

    • As the volume of data goes high the search result time goes high even on indexed vector data.

    • Vector databases are relatively new compared to more mature databases like Postgres or MongoDB. As a result, they may lack robust data management capabilities and transactional support, making it more challenging to ensure data integrity, consistency, and scalability.

  2. Inaccurate vector search:

    • Vector search retrieves relevant information based on semantic similarity. However, it can sometimes yield inaccurate results. For example, in retail sect or dealer, distributor and sales person seems same semantic meaning.




We created the Categorized Multi-Index RAG System with which are able to get much faster and much accurate results.


Now Let’s discuss about how this system works :

When user’s query is modified by LLM-1 then that query is being sent to index for vector search in query vector format in general cases. But In our approach we have introduced another LLM i.e LLM-2 mentioned on above diagram, LLM-2 has been instructed to provide an output as category for eg: category1 , category2, If no category is being identified then LLM-2 will through output as “Other” based on query generated by LLM-1.

Now If LLM-2 has been successful in identifying user’s precise query then Indexer will get the values from the keys that are defined on the basis of predefined categories on which LLM-2 has been instructed to output category response. If no precise category response has been identified then LLM will through an output as “Other”. Now for searching we have made a various indexes according to category that indexer will receive. If no special category is found then we had made a separate index where our master data is being uploaded for searching all the information that we have for whole application.

Categorized Multi-Index RAG System do data management, enhances result accuracy, optimizes vector search, and increases the efficiency of indexes. It's a powerful approach for handling complex data with RAG System