RAG and AI assistants
Knowledge graph vs RAG: what does an AI agent need?
An agent does not need to know everything. It needs to know where to look, and how to ask.
Short answer
In the knowledge graph vs RAG choice, most AI agents in a live product need tools first: search, filters and actions that call your existing systems and return fresh data. Plain vector RAG suits questions answered by a few similar passages. A knowledge graph earns its cost when answers depend on relationships across many entities, such as companies, events and market factors. Start with a simple tool-using agent, and add a graph only where questions need connected context.
On this page
01Knowledge graph vs RAG vs tools for agent context
When an agent answers a question or takes an action, it needs context it was not trained on. There are three common ways to give it that context, and they solve different problems.

Vector RAG. Documents are split into chunks, embedded and stored in a vector index. At query time, the most similar chunks are retrieved and passed to the model. The original research on retrieval augmented generation showed that pairing a model with a retriever makes generated answers more factual. It works well when the answer sits in one or two passages.
Knowledge graph. Entities such as companies, people, products and events are stored as nodes, and their relationships as edges. The agent can follow those links to gather connected facts. Microsoft Research's work on GraphRAG showed where this helps. Baseline vector retrieval struggles when an answer requires connecting separate pieces of information through shared attributes, or when a question asks about themes across a whole dataset. A graph built from the data handles those cases better.
Tools. The agent calls defined functions: search with filters, look up a record, create a lead, book an appointment. Each tool reads from or writes to your live systems. Tools give the agent fresh, structured data and the ability to act.
| Need | Vector RAG | Knowledge graph | Tools |
|---|---|---|---|
| Answer from a few matching passages | Strong | Overkill | Possible via a search tool |
| Connect facts across many entities | Weak | Strong | Weak unless tools are joined |
| Data that changes hourly | Needs frequent reindexing | Needs frequent updates | Strong, reads live data |
| Exact filters such as price, size, location | Weak | Moderate | Strong |
| Take an action in the product | No | No | Yes |
| Build and maintenance effort | Low | High | Moderate, mostly reuses APIs |
02Why we usually start with tools
In an established product, the most valuable context already lives in your systems, with structure and permissions attached. A product catalog has prices and filters. A CRM has leads and owners. An inventory feed has stock levels that change every hour. Copying all of that into an embedding index loses structure and goes stale. Exposing it as tools keeps it live and keeps your permission checks in place.

Anthropic's guide to building effective agents makes the same point from a different angle: start with the simplest solution that works, add complexity only when it clearly improves results. It also advises putting as much care into tool design as into prompt design. Clear tool names, well documented parameters and tools that are hard to misuse matter more than an elaborate orchestration graph.
That leads to our usual order of decisions:
- 01
List the questions and actions the agent must handle.
Use real user prompts, not invented ones.
- 02
Map each one to a source of truth.
A database, an API, a search index or a set of documents.
- 03
Expose live, structured sources as tools.
Search with filters, record lookups and actions.
- 04
Add vector search for unstructured content.
Website pages, help articles and documents, usually as one more tool.
- 05
Add a knowledge graph only for relationship questions.
When users ask how things connect, and the tools cannot answer without many chained calls.
- 06
Keep the orchestration as simple as the tasks allow.
Every extra node in an agent graph is one more place for context to be lost.
03What we see in production
Take OCCI, an industrial contractor whose executives and department heads wanted answers on live job cost data: contracts, profit on bid cost, labor overruns, receivables and equipment use. The company had already built a Copilot agent over its reporting database, every figure had to match the existing reports exactly, and no data could leave its network. Leaders asked in natural language instead of scanning static reports.
We kept the agent the client had already secured. It reaches the database only through a small deterministic tool that validates and runs approved read only queries against an agreed set of views, under a least privilege login.
We tested it inside the client's own Microsoft tenant and checked each answer against our own SQL query. The agent held up on direct questions over its views. Where it fell short, the fix belonged in the database, not the model, so our plan puts the math in the database. The company chose to stay on Copilot and pilot its weekly labor report first, reproduced from its existing stored procedure and validated against the current report.
No knowledge graph was needed there. The questions were about exact figures from known tables, which is a query problem, not a relationship problem.
A retail sales assistant we built needed no graph either. Its flow searches document embeddings, runs CSV agents and queries the client's database at the same time. An aggregator node merges the results into one answer, because shoppers asked for product facts and side by side comparisons.
On an AI market intelligence app for retail investors, which we built for a fintech venture, the questions were different. Users wanted to know how news, filings, macro indicators and companies relate to each other and to their portfolio. There, a knowledge graph links companies, news and market factors so answers carry context, specialist agents for research, signals, trading and portfolios sit behind one conversational agent, and chat answers cite their sources. The graph was worth its cost because relationships were the product.
The contrast is the useful lesson. Same team, same agent framework, two different answers, chosen by the shape of the questions.
04Signs you need a knowledge graph
- Users ask how things are connected, not just what something is.
- Good answers require combining facts from many documents or records that share an entity.
- Users ask for themes or patterns across a whole dataset.
- You can name the entities and relationships clearly, and they are stable enough to maintain.
05Signs you need tools first
- The data is already structured in your product's database or APIs.
- The data changes often.
- Users need exact filters, such as price, date, size or location.
- The agent must take actions, such as creating a lead or booking a meeting.
- Answers must respect each user's permissions.
For most SaaS products adding their first agent, the second list is longer. Our article on how to add AI agents to an existing SaaS product explains how we turn existing APIs into safe agent tools. Our article on why AI agents fail in production covers what happens when the orchestration gets ahead of the data.
06Trade-offs to plan for
- Graphs need upkeep. Entity extraction, deduplication and relationship updates are ongoing work. Budget for it before you build one.
- Vector search misses exact constraints. A buyer who wants a unit under a set budget needs a filter, not a similarity score.
- Tools depend on API quality. Undocumented or inconsistent APIs make poor tools. Sometimes the first job is cleaning up the API.
- More nodes means more failure points. Simplifying an agent graph often improves accuracy, because there are fewer handoffs where context can be dropped.
Frequently asked questions
When does a knowledge graph beat vector RAG?
When answers depend on relationships across many entities. Microsoft Research's GraphRAG work showed that baseline vector retrieval struggles when an answer requires connecting separate pieces of information through shared attributes, or when a question asks about themes across a whole dataset. If users ask how things connect, and you can name stable entities and relationships, a graph can earn its cost.
Why start an AI agent with tools instead of RAG?
In an established product, the most valuable context already lives in your systems, with structure and permissions attached. Copying it into an embedding index loses structure and goes stale. Exposing it as tools, such as search with filters, record lookups and actions, keeps the data live, keeps your permission checks in place and lets the agent act.
Can an agent use tools, vector search and a knowledge graph together?
Yes. Our usual order is to expose live, structured sources as tools first, then add vector search for unstructured content such as website pages, help articles and documents as one more tool. A knowledge graph comes last, only for relationship questions. Keep the orchestration as simple as the tasks allow, because every extra node is one more place for context to be lost.
What does a knowledge graph cost to maintain?
Graphs need upkeep. Entity extraction, deduplication and relationship updates are ongoing work, so budget for it before you build one. The graph is worth that cost when relationships are the product, as in a market intelligence app that links companies, news and market factors. When questions are about exact constraints, filters and search do the job.
How Datics helps
Datics specializes in Brownfield AI: production AI inside software people already rely on. A Build Sprint puts one outcome working in your product's staging in three weeks, for $10,000, and the fee counts toward production. Not sure what to build first? The Planning Sprint ranks it in two weeks, for $5,000.
Related work
Case studies from our projects on the same subject.
FLZR
Other software · AI sales assistant
Shoppers compare products side by side, answered from the seller's live database
Shoppers needed product answers at any hour; now an AI assistant answers from the seller's documents, files and live database, with comparison cards.
Coast Technology
Automotive · AI sales assistant for dealers
RV shoppers get units from live stock, with towing fit computed, not guessed
Dealer sites offered static forms and filters. Now shoppers ask in plain words and get real units from the hourly feed, with the reason each one fits.
Cosmic AI
Fintech · Multi-agent investing assistant
Retail investors go from research to a confirmed order in one conversation
Investors juggled data, news and a separate broker. Now agents research and prepare each trade in chat, and nothing is placed until they confirm.
More on RAG and AI assistants
RAG and AI assistants
How do you build a RAG chatbot on your knowledge base?
How to build a RAG chatbot on your knowledge base: a retrieval path per source, one merge step, and strict limits on what each assistant may read.
RAG and AI assistants
Fine tuning vs RAG: when should you train on your own data?
Fine tuning vs RAG: use retrieval when the model lacks facts, fine tune when it does a narrow task badly, and collect user corrections first.
RAG and AI assistants
How do you make AI product search match how buyers shop?
AI product search works when it learns how buyers decide, such as a monthly payment budget, and turns that into precise filters over live inventory.
RAG and AI assistants
How does natural language search map to product data?
Natural language search over a product catalog works when the agent maps buyer words to attributes your feed actually holds, then filters on them, not guesses.
RAG and AI assistants
RAG evaluation: how do you test that citations hold up?
RAG evaluation must check more than whether citations exist. Test that each cited passage supports its claim and that answers decline when sources are silent.
RAG and AI assistants
How do you stop hallucination in AI document extraction?
AI document extraction from long documents gets reliable with type detection, retrieval per field, clear field definitions and empty values, not guesses.
Your customers already expect AI from your product.
Let us make it real inside the product you run today.
