Book a free call

How Much Does Graph RAG Cost to Build?

Graph RAG costs more to build than plain RAG because you pay to extract and store a knowledge graph, then pay again on every query. Here is how the parts add up.

Hertiv engineering teamReviewed by a senior engineer
6 min read
How Much Does Graph RAG Cost to Build?
On this page

Short answer

Graph RAG typically costs more than plain RAG because you pay twice: once to extract entities and relationships from your documents into a knowledge graph, and again on every query, when the system traverses the graph and calls the model. The build cost depends on document volume and extraction quality, while the running cost depends on query volume and how much of the graph each query reads.

What is graph RAG?

Graph RAG is a retrieval method that stores knowledge as a graph of entities and relationships, then uses that graph to answer questions. Instead of searching text chunks for keywords, the system finds the entities in the question, walks the links between them, and feeds the connected facts to the language model.

The graph is the difference from plain RAG. Plain RAG splits documents into chunks, embeds them, and retrieves the chunks closest to the question. Graph RAG adds a layer on top: it extracts people, products, places and events from the same documents, records how they relate, and uses those links to find answers that span several documents.

That extra layer is useful when questions need connections, such as which supplier serves which product line, or what changed between two versions of a policy. It also adds cost at every stage, which is why the price of graph RAG is a separate question from the price of plain RAG. The basic idea is covered in what graph RAG is.

What are the parts that cost money?

The cost of graph RAG breaks into four parts: building the graph, storing it, running queries, and keeping it current. Each part has its own drivers, and the balance between them depends on how much content you have and how often people ask questions.

Cost part What you pay for Main driver
Graph extraction Model calls that pull entities and links from documents Document volume and pages per document
Graph storage Graph database hosting and indexes Number of nodes and edges
Query time Model calls, graph traversal and retrieved context Questions per day and hops per question
Keeping it current Re-extraction when documents change How often source content changes

Extraction is usually the largest one-off cost, because every page must pass through a model to find entities and relationships. Query cost is the largest running cost, because each question triggers a traversal plus a model call. Storage is usually the smallest part. Compare the baseline in RAG development cost to see what graph RAG adds.

How much does building the graph cost?

Building the graph costs more than indexing the same documents for plain RAG. Plain RAG embeds each chunk once, which is cheap. Graph RAG reads each chunk with a model, asks it to list entities and relationships, and then writes those to the graph database, which uses far more model output per page.

Three choices set the extraction bill. First, the model: a larger model extracts more accurately but costs more per page, while a smaller model is cheaper and misses more links. Second, the depth: extracting every entity and every relationship costs more than extracting only the types you need, such as products, people and dates. Third, the review step: checking the extracted graph by hand adds labour cost but catches errors that would otherwise reach answers.

A practical way to control the bill is to extract in stages. Start with the documents that answer the most common questions, measure the quality of the graph, and only then extend to the rest. Teams that extract everything at once usually pay for a large graph before they know whether the answers are any better. For the retrieval side, hybrid search cost shows how a simpler retrieval layer is priced.

What drives the running cost?

Running cost comes from three things on each query: finding the entities in the question, walking the graph to gather related facts, and sending those facts to the model for the answer. The model call is usually the largest share, because the retrieved context can be long when the graph returns many connected facts.

Query volume matters most. A system that answers 100 questions a day costs a fraction of one that answers 10,000, because every question repeats the same three steps. The second driver is hops: a question that needs two or three links in the graph pulls more facts than a question answered by one entity, so it sends more context to the model.

Caching helps. Questions that repeat, such as the same policy question asked each week, can reuse the traversal result instead of walking the graph again. Pruning the graph also helps: removing stale or low-value edges keeps the retrieved context short, which keeps each model call cheaper. The retrieval design is part of RAG development, where the query path is planned before the graph is built.

How do you estimate the cost before you build?

You estimate graph RAG cost by working from your own numbers, not from a vendor's headline figure. The estimate has five steps, and each one uses counts you can measure from your documents and your support logs.

  1. Count the documents and pages. Total pages set the extraction bill. Group them by type, because dense manuals extract differently from short notes.
  2. Decide what to extract. List the entity and relationship types that answer real questions. Fewer types mean fewer model calls per page.
  3. Price one page. Run extraction on a sample of 20 pages and record the model tokens used. Multiply by your total pages for the build cost.
  4. Count the questions. Use support tickets or search logs to estimate questions per day, then price one query the same way: traversal plus model call.
  5. Add the update cost. Estimate how many pages change each month and price re-extraction for those pages only, not the whole set.

Run the sample before committing to the full build. A 20-page test shows the real token use per page and the quality of the extracted graph, which are the two numbers every later estimate depends on.

Example (hypothetical): a support knowledge base

Example (hypothetical): a software company has 2,000 support articles, about 4 pages each, so 8,000 pages in total. Extraction on a 20-page sample uses 1,500 tokens per page at a planning rate of $4 per million tokens, which is $0.006 per page.

The build cost is then 8,000 x $0.006 = $48 for extraction, plus graph database hosting at a planning range of $100 to $200 a month. The one-off build is small because the rate is low, but the real cost is the review: checking 5% of the extracted entities by hand at 10 minutes per 100 entities adds several days of work.

For running cost, the team expects 500 questions a day. Each query uses about 3,000 tokens of context and answer at the same planning rate, which is $0.012 per question, so 500 x $0.012 = $6 a day, or about $180 a month. The total running cost is therefore about $280 to $380 a month, and the build cost is a one-off of under $50 plus the review time.

What are the common mistakes?

The most common mistakes are extracting everything, skipping the sample, and letting the graph go stale.

  • Extracting every entity type. Pulling every person, place and date from every page inflates the build cost and fills the graph with facts nobody asks about.
  • Skipping the sample run. Building the full graph before measuring tokens per page means the first real bill is a surprise.
  • No update plan. A graph built from last year's documents gives last year's answers. Changed pages need re-extraction, or the answers drift.
  • Too many hops per query. Letting every question walk three or four links pulls in long context and raises the cost of each model call.
  • No quality check. Bad extractions reach answers silently, so a review step on a sample of the graph is needed before launch.

If you are planning a retrieval system and want the estimate done against your own documents, LLM development is the place to start.

Key takeaways

  • Graph RAG adds a knowledge graph on top of plain RAG, and that layer costs extra
  • Extraction is the largest one-off cost; query volume is the largest running cost
  • Model choice, extraction depth and review effort set the build bill
  • Hops per query and context length drive what each question costs
  • A 20-page and 20-question sample gives a reliable estimate before the full build
  • Changed documents need re-extraction or the graph goes stale

Frequently asked questions

Is graph RAG always more expensive than plain RAG?

Yes, in practice. Graph RAG adds extraction and graph storage on top of the chunking and embedding that plain RAG already does, and each query also walks the graph. The extra cost is worth it only when questions need connections across documents.

What is the largest cost in a graph RAG project?

Extraction is usually the largest one-off cost, because every page passes through a model. Running cost is led by query volume, since each question triggers a traversal and a model call. Storage is usually the smallest part.

Can I reduce graph RAG cost by extracting fewer entity types?

Yes. Extracting only the entity and relationship types that answer real questions cuts model calls per page and keeps the graph smaller. Start with the types behind your most common questions and add more only when a question needs them.

How often does a knowledge graph need updating?

Whenever the source documents change. New or edited pages should be re-extracted so the graph matches the current content. Teams usually update on a schedule, such as weekly, and re-extract only the changed pages.

Does caching help with graph RAG running cost?

Yes, for repeated questions. If the same question is asked often, the traversal result can be reused instead of walking the graph again. Caching helps less for new or unusual questions, which still need a fresh traversal.

Should I build graph RAG or plain RAG first?

Plain RAG first, in most cases. It is cheaper, faster to build and good enough for questions answered by one document. Add a graph when your questions need links between documents, such as supplier, product and policy connections.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning a RAG system and want the cost estimated against your own documents?

A senior engineer replies within one business day. Or see our LLM Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call