How the knowledge base works
Discover how Retrieval-Augmented Generation (RAG) works: how your bot finds and uses information from your knowledge base.
THE PRINCIPLE OF RAG (RETRIEVAL-AUGMENTED GENERATION)
RAG is the technology at the heart of your knowledge base. Rather than relying solely on the language model's general knowledge, your bot actively searches your documents for relevant information for each question posed by a client.
This mechanism ensures that your bot's responses are specific to your institution, up to date, and accurate.
SEMANTIC SEARCH
When a client asks a question, the system performs a semantic search in your knowledge base based on the flow of conversation: it compares the meaning of the request to the meaning of your documents, without depending on the exact words used.
For example, if a client asks 'How much is the margherita?', the search finds the relevant passage from your menu even if it is worded differently ('pizza pricing').
SELECTING RELEVANT PASSAGES
The system compares your question to all indexed passages and retains the most relevant ones based on semantic proximity. The automatic search performed at each turn retains the 3 most relevant passages; when the bot triggers a targeted search during the conversation, it can retain up to 5.
These excerpts are then provided to the language model, which uses them to formulate a precise response. The bot relies on your information without inventing answers.
COMPLETE SEARCH FLOW
Here is the complete journey of a client's question, from start to answer:
- The client asks their question by phone
- The voice is transcribed to text by our speech recognition engine
- The client's most recent exchanges are combined into a single semantic search query
- A vector search is performed in your venue's knowledge base
- The most relevant passages are extracted (3 by default)
- The language model receives the question along with the 3 excerpts as context
- The language model generates an informed and precise response
- The response is converted to natural speech and delivered to the client
Frequently asked questions
WHAT HAPPENS IF THE ANSWER IS NOT IN THE KNOWLEDGE BASE?
If no relevant information is found in your knowledge base, the bot will honestly tell the client and offer to transfer them to a human agent or to note their request for a callback.
WHY 3 RESULTS BY DEFAULT?
By default, the automatic search retains 3 passages: this is a good balance between relevance and speed. Beyond that, response time increases without significantly improving quality. During a targeted search triggered by the bot during the conversation, this number can rise to 5.
Tip: For best RAG performance, write your documents clearly and in a structured way, using the vocabulary your clients naturally use.