Beyond basic RAG: knowledge graphs, hybrid search and agent memory
Chunk, embed, retrieve, answer was a great first step. Real company knowledge needs more structure than a pile of paragraphs.

Retrieval-augmented generation, or RAG, became the default way to ground AI answers in company data: split documents into chunks, turn them into vectors, find the most similar chunks to a question, and pass them to the model.
It works well for "what does our leave policy say about carry-over?". It works badly for "which customers in Kochi have overdue invoices and also ordered the new product last month?".
Where basic RAG breaks
- Multi-hop questions that need facts from several documents linked together.
- Exact values such as prices, quantities and dates, where "similar" text is not good enough.
- Aggregates like totals, counts and trends, which are not written down in any single chunk.
- Relationships between people, products, places and documents.
- Freshness, when the source changes daily and the index lags behind.
Fix one: hybrid search and re-ranking
The cheapest big win is combining keyword search, which is good at exact terms, product codes and names, with vector search, which is good at meaning. Then a re-ranking model reorders the combined results by relevance. Most RAG systems we review improve noticeably from this alone.
Fix two: let the model query structured data
Numbers and lists usually live in a database already. Instead of embedding them, give the model a safe, read-only query tool, or a set of predefined queries, and let it ask the database directly. "Total sales for this customer last quarter" should be SQL, not similarity search.
Fix three: knowledge graphs
A knowledge graph stores entities, such as customers, products, suppliers and locations, and the relationships between them. Some approaches use a language model to extract a graph from documents, then answer questions by walking the graph and summarising communities of related entities.
Graphs shine when questions are about connections: who supplies what to whom, which contract covers which site, which product shares components with another.
Fix four: memory for agents
Agents that work with a user over days or weeks benefit from memory: preferences, decisions made and facts learned. Good memory systems separate short-term working context from long-term facts, store memories with their source and date, and have rules for updating and forgetting. Without that, memory fills with stale or wrong facts that quietly degrade answers.
Choosing an approach
Start with the questions your users actually ask. Sort them into document lookups, exact data questions and relationship questions. Use hybrid RAG for the first, database tools for the second, and consider a graph only if the third is a large share. Build an evaluation set from real questions and measure every change against it.
Frequently asked questions
What is RAG?
Retrieval-augmented generation: retrieving relevant information from your own documents or data and giving it to a language model so its answer is grounded in that information.
What is hybrid search?
Combining keyword search and vector (semantic) search, then re-ranking the results, so you get both exact matches on names and codes and matches on meaning.
When should I use a knowledge graph?
When many of your questions are about relationships between entities, such as which suppliers serve which sites, rather than about the content of individual documents.
Keep exploring
Enjoyed this? Get the next one first.
One email a month with our newest articles on AI, engineering, mobile, ERP and the products we ship. No spam, unsubscribe any time.
- Monthly, never more
- New case studies first
- Practical, no hype


