· Retrieval · Graphs
GraphRAG
How a knowledge graph lets AI answer questions that span many documents.
Research · Retrieval
Updated
Retrieval-augmented generation (RAG) gives an AI model your documents to read before it answers. Colidal's RAG engine splits documents into passages, finds the ones that match a question by meaning and by exact words, puts the best ones first, and has the model answer from those passages only, with the source shown.
search = meaning + exact words · rerank = on · sources = shown
Retrieval-augmented generation (RAG) is a method where an AI model first looks up relevant passages in a set of documents and then answers using only what it found. How it works The slow work happens once, before anyone asks anything. When a question arrives, the system only has to search, sort, and answer. Preprocessing Split the documents into chunks. A chunk is a passage of a few hundred tokens: short enough to search precisely, long enough to mean something. Add context to every chunk. An LLM reads the whole document and writes a line or two that says where the chunk sits in it. This is contextual retrieval. Encode each chunk twice. An embedding model turns it into a vector that captures meaning. TF-IDF records the exact words in it. Store both. Vectors go into a vector database. Keyword encodings go into a TF-IDF index, searched with BM25. Runtime Search both indexes. The vector database finds chunks that mean the same thing. The keyword index finds chunks with the exact terms, such as an error code. Merge the results. Rank fusion combines the two lists and removes duplicates, leaving the top N chunks. Rerank. A reranker scores each chunk against the question and keeps the top K. Answer. The generative model reads the top K chunks and writes the response from them, with the sources. What makes retrieval good A model can only answer from what it is handed. Most wrong answers from a RAG system are retrieval failures, not model failures. chunking Cut a document in the wrong place and a passage loses its meaning. Chunk size, boundaries, and overlap all change what can be found. hybrid search Meaning search finds a passage that says the same thing in other words. Keyword search finds the exact part number. Good systems run both. contextual retrieval "Revenue grew by 3%" is useless alone. With a line saying which company and which quarter, the same chunk can be found and trusted. reranking Search casts a wide net. A reranker reads each candidate against the question and keeps only the strongest few. Published results In published tests, each addition cut the share of relevant passages the search failed to find. Lower is better. Source: Anthropic, "Introducing Contextual Retrieval" (2024). Measure: share of relevant chunks missing from the top 20 retrieved, averaged across codebases, fiction, and research papers. Published figures, not Colidal measurements. Fit Compare They are not rivals. Most systems start with RAG, and add a graph or an agent only where the questions need one. How Colidal builds it Colidal's custom RAG engine does more than wait for a question. It is embedded in the work, so the relevant policy or past case appears beside a request when it arrives. Used in: Your documents · Repeat questions · colidal/ragTwo parts: prepare the documents, then answer the question.
Before any question
When a question arrives
Four decisions that decide the answer.
Where to cut
Meaning and exact words
Context for every chunk
Best passages first
Four ways to chunk a document
Method How it cuts Trade-off Fixed-size Equal blocks by character or token count, with some overlap Simple and cheap. Cuts through sentences and ideas. Recursive By paragraph, then sentence, then word, until each piece fits More coherent. Struggles when a document has no clear structure. Semantic Starts a new chunk where the meaning shifts Follows the topic. Needs more computing and a well-set threshold. Agentic An LLM groups small pieces into coherent chunks and gives each a title and summary Best chunks for mixed documents. Costs a model call per chunk, and is still a young method. How much each step helps.
Settings behind those results
Setting Value in the tests Why it matters Chunk size A few hundred tokens Size, boundaries, and overlap all change what is found. Test them on your own documents. Context per chunk 50 to 100 tokens, written by an LLM that sees the whole document It must be specific to the chunk. A generic summary of the document on every chunk gave very little gain. Keyword search BM25, which builds on TF-IDF It adjusts for document length and for a word repeated many times, and it finds exact strings such as "error code TS-999" that meaning search can miss. Candidates retrieved The top 150 chunks A wide first pass, so the right passage is somewhere in the pile. Chunks given to the model The top 20 after reranking Passing 20 chunks gave better answers than passing 10 or 5. Reranking cost A small delay on every question Reranking more candidates is more accurate and slower. The right number is a measured trade-off. Cost of adding context The document is cached once, then reused for each of its chunks Without caching, the whole document is paid for again with every chunk. When RAG fits, and when it doesn't.
Use it when
Skip it when
RAG, GraphRAG, or agentic RAG?
RAG GraphRAG Agentic RAG What it retrieves Passages that match the question Connected facts, and summaries of whole topics Whatever the agent decides the task needs A question it suits What does the returns policy say about opened items? Which suppliers are linked to the late orders this year? Compare this month's returns with the policy and draft a reply. Built before any question Chunks, embeddings, a keyword index All of that, plus a knowledge graph and community summaries Nothing new: it uses the other indexes as tools Cost to set up Lowest Highest: an LLM reads every chunk Medium: tools, checks, and tests Cost per answer Lowest: one search, one model call Low for specific questions, higher for broad ones Highest: several model calls per task How it shows its work The passage and page it used The path it followed through the graph Every step, tool call, and source Start here when The answer is written down in one place The answer is spread across many connected documents The answer takes several steps or several systems A RAG engine built into your workflows.
FAQ
Retrieval-augmented generation is a method where an AI model looks up relevant passages in your documents and answers from those passages, instead of from memory.
For a small set, do exactly that. Once the documents outgrow what a model can read at once, about 500 pages, retrieval picks the few passages that matter.
It reduces it, because the model answers from text it was handed. It works best with two more rules: show the source, and decline when the documents are silent.
Meaning search matches ideas, so "refund" finds "money back". Keyword search matches exact terms, so an order number finds that order. RAG needs both.
Keep reading
· Retrieval · Graphs
How a knowledge graph lets AI answer questions that span many documents.
· Retrieval · Agents
How an AI agent plans, picks its tools, checks its results, and retries.
· Retrieval · Chunking
How an AI model decides where to cut a document so each passage keeps its meaning.
Next step
Tell us what you need. We reply within one business day with times for a call, and you'll get a short agenda before we talk.
Request a call
Thirty minutes, by video. No preparation needed.
Get times and a short agenda
Within one business day, so the call is spent on your problem.
Leave with a next step
Usually Colidal AI Assessment, or an honest "AI isn't the answer here".