maarkn.dev
Back to all posts
·5 min read·
  • AI
  • RAG

From FAQ trees to RAG: what changed in my chatbots

I used to build chatbots as decision trees. Then a vector store and a few well-named files made everything I'd written feel like 1998. A field note on what works.

from-faq-trees-to-rag

For a long time, every chatbot I built was a decision tree wearing different costumes. The user typed something, a router matched a regex, a function fired. It worked — and it broke at every edge case the customer hadn't predicted in our weekly meeting.

Then I rebuilt one of those bots around a vector store. The customer's content went in as embeddings. The bot answered from retrieval, not from a tree. Suddenly, "what time does the cultural museum open on Sundays" worked. So did "minha conta foi bloqueada, e agora?". And so did the question I never thought to anticipate.

The pattern that worked for me

Three pieces, all boring on purpose:

  1. Crawl or import the customer's content into a structured store.
  2. Embed it. Keep the chunks small but the metadata rich.
  3. Retrieve top-K, prompt with strict instructions about not inventing.

What unlocked quality wasn't a fancy model. It was content. The richer the source, the more the bot felt like a junior employee who actually read the manual.

Where I'd still use a tree

Anywhere money or identity is on the line. RAG is great for explaining; it's bad for transferring funds. The boring router still has its place — it just doesn't have to be the whole product anymore.