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 AI7 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 a white-label AI sales assistant for dealership websites serving RV, marine and vehicle dealers. The agent has to talk like a salesperson, recommend real units from a live inventory feed, explain why, qualify the buyer and hand a complete lead to the dealer's CRM. Inventory changes hourly, and answers must never invent stock or prices. Buyers ask in natural language, with follow-ups, towing questions, payment budgets and location limits.

The architecture changed as we learned from real dealer tests. Early on, inventory was handled by an agent reading a CSV file. We replaced it with inventory search backed by Elasticsearch, with an hourly sync from each dealer's feed.

The first conversation flow was a multi-node LangGraph graph. Early dealer tests showed context loss and wrong vehicle classes. In the second sprint we simplified the flow by removing nodes and adding a search tool call. Later we rebuilt it around a tool-using agent with three kinds of tools: a lead capture tool, vector similarity search, and Elasticsearch filter tools for exact constraints such as price, class and location. Conversation state is kept in a PostgreSQL checkpointer, and every answer is grounded in the dealer's own feed and website. The assistant has been live for client dealerships in the U.S. and Canada since about January 2026, with leads and appointments flowing into the client's CRM.

No knowledge graph was needed there. The questions were about matching a buyer to units under exact constraints, which is a filter and search 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 existing SaaS without rebuilding 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: bringing production AI into the product you already operate, without forcing a rebuild.

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

Coast Technology

Automotive & Dealerships · 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

Financial Services · 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

FLZR

Retail & E-commerce · 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

Your customers already expect AI from your product.

Let us make it real without rebuilding what already works.