How much does a RAG implementation cost?
A RAG implementation budget has two parts: the work required to build and accept the system, and the ongoing cost of running and maintaining it. The estimate depends on the data sources, permissions, workflow, evaluation requirements and usage. A token-price calculation alone does not estimate the project.
This article includes an editable calculation with deliberately hypothetical inputs. It produces $7,200 for implementation and $747 per month, each including a 20% planning contingency. These are arithmetic outputs from the assumptions below, not market rates, a client invoice, a vendor quote or an offer for services.
By Rohit Raj. Use the worksheet to make assumptions visible before asking an AI engineer or consultant to scope delivery.
Define the smallest useful workflow
Consider an internal support assistant that retrieves approved policy documents and prepares a cited draft for a human reviewer. In this illustration it has one document connector, an existing login system and no permission to send replies or change customer records.
That boundary matters. Adding a second data source can introduce a new authentication scheme, document format and deletion process. Allowing the assistant to act on records introduces authorization, confirmation, retries and audit requirements beyond drafting an answer.
Write down the source owner, update frequency, access rules, expected output and receiving engineer. Use the AI project delivery roadmap to align these budget categories with implementation and release milestones. If those are unknown, budget a discovery stage whose output is a tested plan and a revised estimate. Do not disguise unresolved integration work as an exact delivery date. The AI project scope guide provides a reusable brief.
Separate implementation effort from recurring costs
Here is one illustrative allocation of 120 hours. It is an example of estimating categories, not a claim that your project will fit that effort.
| Workstream | Hypothetical hours | Acceptance evidence |
|---|---|---|
| Workflow and data discovery | 12 | Agreed questions, source inventory and exclusions |
| Connector and document preparation | 24 | Repeatable import, update and deletion handling |
| Retrieval and application integration | 28 | Working flow through the existing product |
| Identity and access boundaries | 20 | Tenant and revoked-access tests |
| Evaluation and failure handling | 20 | Versioned cases, reports and abstention review |
| Deployment and handover | 16 | Runbook, monitoring and receiving owner |
At an assumed $50 per hour, 120 hours is $6,000. A 20% contingency adds $1,200. Neither input is a recommended rate or a guaranteed buffer. Replace both with the agreed scope and delivery arrangement. A schedule also depends on access lead times and review availability, so hours should not be converted directly into a calendar promise.
If you already operate the connector and identity layer, some work may be reusable. If your source is scanned documents with inconsistent tables, ingestion and review may dominate instead. Record what is included and what remains a dependency.
Recalculate the running cost
Download calculate.py and assumptions.json into the same directory, then run Python 3.10 or later:
The script uses the standard library and makes no network calls. Review the code, edit the inputs and compare your output with the published example result.
| Input | Hypothetical value |
|---|---|
| Queries per month | 10,000 |
| Average generation calls per query, including retries | 1.2 |
| Input tokens per generation call | 4,000 |
| Output tokens per generation call | 500 |
| Input / output price per million tokens | $1 / $4 |
| Embedding tokens per month / price per million | 5 million / $0.10 |
| Fixed infrastructure and tools per month | $150 |
| Maintenance effort per month | 8 hours at $50 |
| Planning contingency | 20% |
The generation calculation is 10,000 × 1.2 × ((4,000 × $1 + 500 × $4) / 1,000,000), which gives $72. Embeddings add $0.50, infrastructure $150 and maintenance $400. The subtotal is $622.50; adding 20% gives $747.
The price inputs are invented planning values and do not describe a named model. Before purchasing, replace them with current official provider prices for the model, region, caching and billing mode you will actually use. The input-token estimate should include instructions, retrieved passages and conversation history, not just the user’s question.
Test the assumptions that change the answer
At 100,000 monthly queries, while artificially holding all other inputs fixed, generation rises to $720. The monthly subtotal becomes $1,270.50 and the same contingency produces $1,524.60. This is a sensitivity calculation, not a capacity forecast: infrastructure, maintenance and embedding traffic may also rise.
Doubling input tokens from 4,000 to 8,000 at the original query volume raises generation from $72 to $120. Cutting context is only a saving if the system still retrieves enough evidence to answer correctly. Measure the effect with an evaluation harness.
For an agent that makes several model calls, measure each call type or use a properly weighted average. The simple worksheet applies one average token profile to every generation call. It has no separate reranking, OCR, tool-call, data-egress, tax, support-contract or cache-price fields. Add those as explicit line items before using it for a purchase decision. Do not silently count the same cost in both infrastructure and maintenance.
Budget for evaluation, refresh and recovery
RAG is a continuing data workflow. A source changes, a user loses access or a document is deleted. The system needs a defined response to each event, including how derived chunks and caches are updated.
Reserve time for reviewing failed questions and rerunning acceptance cases after changes to chunking, prompts, models or permissions. A successful demo says little about the cost of operating a feature when its sources drift. Microsoft’s RAG overview describes the underlying tradeoffs in retrieval, access control, context limits and response time.
Record real token usage, request counts, error rates and review effort during the pilot. Compare those measurements with the worksheet and revise the estimate. Define a spend threshold, a fallback when a dependency fails and an owner who receives the alert. The example’s maintenance allowance is a placeholder until that work is measured.
Compare proposals using the same acceptance boundary
Ask each proposal to state the included sources, supported document types, user roles, refresh behavior, evaluation evidence, deployment ownership and handover. Compare the same scope across offers. A lower total may cover a notebook demonstration while another includes integration and operational ownership.
For an embedded engagement, use the FDE role guide to clarify who works with users and owns delivery. For recurring implementation work, review the fractional AI engineering service.
The useful output of this budget is a set of reviewable assumptions. If a key assumption is untested, choose a bounded experiment that resolves it before committing to the larger build. A working retrieval slice, an access test and a measured usage trace are more useful for that decision than adding precision to an uncertain spreadsheet.
