← All writing
Article — Generative AI · 4 min read

RAG in Practice: Grounding LLMs in Your Own Data

A language model knows a lot about the world and nothing about your business. Retrieval-augmented generation closes that gap. Here is how it works in the chatbots I have built, including the ones that talk.

RAGLLMsEmbeddingspgvectorVoice AI

01Why generic answers are not enough

Client brands needed chatbots that answer from their own content, not generic LLM guesses. A model on its own will happily produce a fluent answer that does not match a brand's real facts, and a customer cannot tell the difference.

Retrieval-augmented generation, or RAG, fixes this by changing where the answer comes from. Instead of asking the model what it knows, you hand it the relevant passages and ask it to answer from those.

02The three steps

01

Prepare the knowledge

Each brand's own content becomes the chatbot's knowledge source. This is the part that decides answer quality: the model can only be as accurate as what it is given.

02

Retrieve

For every question, the most relevant passages are retrieved from that brand's content.

03

Generate a grounded answer

The LLM answers using only the retrieved passages, so replies come from the brand's content rather than general model knowledge.

03What a knowledge base looks like

FloatChat, a self-hosted support platform, shows the preparation step in detail. Crawled websites and uploaded PDFs are turned into question-and-answer pairs. Each pair is embedded with text-embedding-3-small and stored in PostgreSQL with pgvector, as 1536-dimension vectors searched by cosine similarity.

When a customer asks something, an FAQ lookup tool runs a semantic search over those vectors and the agent answers from what it finds. When the AI cannot answer from the knowledge base, the conversation is handed to a human.

04Adding a voice

In the RAG Voice Chat System, people can talk instead of type. Real-time transcription turns speech into text, and ElevenLabs turns the answer into natural voice.

Voice makes grounding more important, not less. A spoken answer sounds confident whatever it says, so it has to be right.

05One stack, many brands

The second problem was scale: serving many brands without rebuilding a bot each time. The answer was one reusable stack, configured and deployed per brand. Only the knowledge changes.

That stack is now behind 10+ chatbots for 8+ client brands. Alongside it, Vapi.ai is configured for outbound voice outreach across 4 countries.

06Takeaways

  • Treat the knowledge source as the product. Retrieval cannot fix content that is missing or wrong.
  • Tell the model to answer only from what was retrieved.
  • Decide what happens when retrieval finds nothing, and prefer a human handoff to a guess.
  • Build the pipeline once and make the brand a configuration, not a fork.