When a business asks how to make an AI assistant know about its own operations, the usual answer is RAG. Often that is the right answer. When it is not, the system gives confident wrong answers, and it can take weeks to see why.
In short
RAG (retrieval-augmented generation) means the system searches your documents for passages that look relevant and hands them to the AI model along with the question. It works well for questions that are answered by text, such as policies or contracts. It works badly for questions about figures in your systems, live status, or anything that needs several records combined. For those, we connect the AI to the system itself, or give it all the material at once.
What RAG is good at
RAG became the default for good reasons. It is simple to set up, it copes as your documents grow, it needs no extra model training, and every major framework supports it.
It also fails in a particular way that most teams only find in production. RAG only helps when the search finds the right text. When it misses, the model still answers as if it had.
If the assistant makes things up on questions that do have a clear answer in your documents, look at the search step first. The model is usually answering from the wrong passages.
Four cases where RAG struggles
- Small, fixed reference material. If everything the assistant needs is 30 policy documents or one product spec, a search step adds little. The model can read all of it at once.
- Questions about figures in your systems. "How many deals closed last quarter?" is a database question. Searching for similar-looking text in a CRM export does far worse than a simple query.
- Questions that combine several facts. "Which customers bought X and also raised a support ticket about Y last month?" needs three or more records joined together, and a basic search tends to fall apart on that.
- Live status. "Where is order 12345 right now?" needs the live system. A copy of your documents that was indexed last night cannot answer it.
Option 1: give the model everything
If your reference material is small enough for the model to read in one go, send all of it with every question. You avoid the search step and the mistakes that come with it, and nothing can be missed because the model sees everything.
It usually costs less than people assume. Most current models can cache the part that repeats, so sending the same material with each question stays cheap. For many teams that works out cheaper than running and maintaining a search index. It suits material that rarely changes.
Option 2: query the database
If your database can answer the question, let it. The AI reads the question, writes a query against the real system and then words the answer. The data is always current, every answer traces back to a query someone can read, and you can limit what the queries are allowed to touch.
Option 3: let the model look it up
When answering means doing something, such as fetching a record or checking a status, give the AI a small set of clearly defined actions and let it decide when to use them. For status checks and anything about what is happening right now, this works better than searching documents.
How we choose between them
We run the same short check on every project before choosing:
- Does the answer live in a system such as a CRM or database? → query it, or let the model look it up
- Is the material small, and does it rarely change? → give the model all of it
- Is there a large body of text that changes often? → RAG
- Does the question combine facts from several records? → a database query, with AI to word the answer
In practice most systems end up as a mix. A routing step picks a method for each question: RAG for policy questions written in plain text, lookups for live data and the full material for small reference sets.
If you already run a RAG system and its accuracy has stopped improving, tuning the search harder may not help. Some of those questions probably need a different method, and moving them across is often the largest accuracy gain left in the project.
For your IT team
The limits we work to: if the material fits in the model's context window with room to spare (often under about 100k tokens) and rarely changes, we use full context with prompt caching. Above that, or when it changes daily, we use RAG. Questions about structured data go to a text-to-SQL or text-to-API layer with read-only credentials and a list of allowed tables. Multi-hop questions go to SQL plus an LLM to word the answer, not to top-k retrieval.
User: "How many active subscriptions in the UAE?"
↓ LLM writes a structured query
SELECT COUNT(*) FROM subscriptions
WHERE status = 'active' AND country = 'AE';
↓ Run against the live database
Result: 4,218
↓ LLM words the answer
"There are 4,218 active subscriptions in the UAE right now."Have a process like this in your business?
Tell us how it works today and where it slows down. We'll say plainly whether automation is worth it, and what we would build first.
Book a meeting