All insights

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.

Co-founder and CTO, Datics AI6 min read

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
  1. 01Knowledge graph vs RAG vs tools for agent context
  2. 02Why we usually start with tools
  3. 03What we see in production
  4. 04Signs you need a knowledge graph
  5. 05Signs you need tools first
  6. 06Trade-offs to plan for
  7. Frequently asked questions

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.

Table comparing vector RAG, knowledge graphs and tools across six needs of an AI agent
Tools win on live data, exact filters and actions.

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.

NeedVector RAGKnowledge graphTools
Answer from a few matching passagesStrongOverkillPossible via a search tool
Connect facts across many entitiesWeakStrongWeak unless tools are joined
Data that changes hourlyNeeds frequent reindexingNeeds frequent updatesStrong, reads live data
Exact filters such as price, size, locationWeakModerateStrong
Take an action in the productNoNoYes
Build and maintenance effortLowHighModerate, 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.

Copying context into an embedding index loses structure and goes stale; tools keep data live, structured and permissioned
The most valuable context already lives in your systems, with structure and permissions attached.

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:

  1. 01

    List the questions and actions the agent must handle.

    Use real user prompts, not invented ones.

  2. 02

    Map each one to a source of truth.

    A database, an API, a search index or a set of documents.

  3. 03

    Expose live, structured sources as tools.

    Search with filters, record lookups and actions.

  4. 04

    Add vector search for unstructured content.

    Website pages, help articles and documents, usually as one more tool.

  5. 05

    Add a knowledge graph only for relationship questions.

    When users ask how things connect, and the tools cannot answer without many chained calls.

  6. 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.

›References (3)
  1. Microsoft Research: GraphRAG, unlocking LLM discovery on narrative private data
  2. Anthropic: Building effective agents
  3. Lewis et al.: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (arXiv)

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.

AI-native productDocument intelligenceIntegrations
Read case study

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.

AI-native productAgentic workflowsProduction AI
Read case study

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.

Agentic workflowsAI-native productHuman approval
Read case study

More on RAG and AI assistants

Your customers already expect AI from your product.

Let us make it real inside the product you run today.