- Issue created by @robertoperuzzo
- Merge request !58[#3543841] feat: Implement Typesense support for RAG in the AI module → (Open) created by robertoperuzzo
- 🇮🇹Italy robertoperuzzo 🇮🇹 Tezze sul Brenta, VI
I implemented an AI Agent that performs
RAG (Retrieval-Augmented Generation) on top of
Typesense’s semantic search.When a user enters a query (as a prompt), the main agent doesn’t just run it directly.
Instead, it first calls a sub-agent whose job is to determine
which Typesense collection is most relevant to the query.Once the sub-agent identifies the best collection, the main agent uses that collection to perform a
semantic search in Typesense (following
Typesense’s semantic search workflow).
The retrieved context is then fed back into the AI to generate an enriched, context-aware answer—completing the RAG cycle.- Dynamic routing: It automatically selects the right collection based on intent.
- Scalability: No hardcoded mapping; adding new collections doesn’t require code changes.
- Accuracy: Queries hit the most relevant data, improving retrieval quality and answers.
- User enters a prompt.
- Main agent calls the sub-agent to pick the most relevant Typesense collection.
- Main agent runs Typesense
semantic_search
against that collection. - Retrieved passages are injected into the LLM as context (RAG) to produce the final answer.