How much does it cost to build a RAG system in 2026?
What a retrieval-augmented generation system costs to build and run, from a studio that ships them. Price tiers, monthly infrastructure, build vs buy and two real examples.
Short answer
Most RAG systems we build cost $8,000 to $20,000 and take 4 to 8 weeks. That covers one data source with citations and an evaluation set. Enterprise RAG with several sources, permissions and monitoring costs $20,000 to $45,000 over 8 to 14 weeks. The main cost drivers are messy documents, the accuracy you need, permissions and whether it must run on your own servers. Monthly infrastructure usually runs from about $100 to $2,000.
- Production RAG
- $8k–$20k
- Enterprise RAG
- $20k–$45k
- Timeline
- 4–14 weeks
- Running costs
- $100–$2,000/mo
- Discovery sprint
- $1.5k–$3k
On this page
RAG development cost by tier
RAG (retrieval-augmented generation) lets a language model answer from your documents and cite them. What you pay depends mostly on how many sources you connect and how far the answers must be trusted.
| Tier | What it includes | Typical cost | Timeline |
|---|---|---|---|
| Basic: document Q&A in an existing app | A small set of clean documents, one model, a simple chat or search box | $3,000–$10,000 (our AI integration range) | 2–4 weeks |
| Production RAG | One data source, parsing, hybrid search, citations, an evaluation set | $8,000–$20,000 | 4–8 weeks |
| Enterprise RAG | Several sources, per-user permissions, sync jobs, monitoring | $20,000–$45,000 | 8–14 weeks |
US agencies commonly publish $12,000 to $30,000 for a basic RAG build and $70,000 to $120,000 or more for enterprise RAG. Our ranges are lower mainly because our team works from Lahore, Pakistan, where costs are lower.
The scope behind our numbers is the same: ingestion, retrieval, evaluation, deployment and handover. If the system also needs to take actions, such as updating records or filing tickets, it becomes an agent. See our AI agent development cost guide.
What makes up the cost of a RAG system
The model call at the end is the easy part. Most of the budget goes into putting the right passage in front of the model and proving that it works.
Ingestion and parsing
PDFs with tables, scanned pages, slide decks and spreadsheets each need different handling. Clean HTML or Markdown is cheap to ingest. Scanned contracts with footnotes are not. Your document mix is the first thing we check in discovery.
Chunking
Documents are split into passages before they are embedded. Split too small and answers lose context. Split too large and search gets vague while token costs rise. Good chunking follows the document's own structure: sections, clauses, headings.
Hybrid search and re-ranking
Vector search finds passages with similar meaning. Keyword search finds exact terms such as part numbers, case names and clause references. Production systems usually run both, then re-rank the results before the model sees them.
Evaluation
We build a set of real questions with known answers and the passages that support them. Every change to chunking, search or prompts is scored against it. Without it, you can't tell whether a change helped or broke something.
Permissions
If different users may see different documents, retrieval must filter by access rights before anything reaches the model. Syncing those rights from the source systems is a large part of the gap between the production and enterprise tiers.
Interface and citations
Users trust answers they can check. Linking each answer to the exact passage takes work in both the retrieval layer and the UI. We include it in every production build.
Monthly RAG infrastructure costs
Running a RAG system has four main lines: the language model, embeddings, the vector database and hosting. For typical workloads the total lands between roughly $100 and $2,000 a month, paid to the providers at cost.
| Item | Typical cost | What drives it |
|---|---|---|
| LLM calls for answers | $25–$1,000+ a month | Questions per day, context sent per question, model tier |
| Embeddings | A few dollars per full indexing run | Corpus size and how often documents change. OpenAI lists $0.02 per million tokens for its small embedding model and $0.13 for the large one |
| Vector database | $0–$50 minimum on hosted plans | pgvector in your Postgres adds no license fee. Pinecone Builder is $20 flat; Standard has a $50 minimum plus usage. Qdrant Cloud has a free tier for testing and usage-based paid plans |
| Managed Postgres (Supabase Pro as an example) | $25 base plus $10–$210 compute | Index size and traffic |
| Self-hosted models (optional) | About $430–$2,900 per always-on GPU | Card type. On Runpod an L4 lists at $0.59/hr and an H100 at $2.89–$3.99/hr on-demand |
A worked example
Take 50,000 pages at about 500 tokens a page, or 25 million tokens. Embedding them once costs about $0.50 with OpenAI's small embedding model, or about $3.25 with the large one. Embeddings are rarely the problem.
Answering is where the money goes. Say staff ask 1,000 questions a day, about 30,000 a month. Each question sends around 6,000 tokens of retrieved context and gets a 500-token answer.
| Model choice (input / output per million) | Input cost | Output cost | Monthly total |
|---|---|---|---|
| Small model ($0.10 / $0.50) | $18 | $7.50 | $25.50 |
| Mid-tier model ($2 / $10) | $360 | $150 | $510 |
| Frontier model ($4 / $20) | $720 | $300 | $1,020 |
Better retrieval lowers this bill. Sending 3 sharp passages instead of 15 loose ones cuts input tokens and tends to improve answers. Prompt caching and batch processing lower it further for repeated or offline work.
Costs buyers often miss
- Re-indexing. Switching embedding models means embedding the whole corpus again and re-running your evaluation set. The tokens are cheap; the testing time is not.
- Document sync. Sources change every day. Jobs that pick up edits and remove deleted files need hosting and monitoring of their own.
- Model changes. Providers retire models and change prices. Each switch needs a test run before it goes live.
- Re-ranking and parsing services. Paid re-rankers and document parsing APIs add per-call fees. Open-source options trade those fees for hosting.
Basic vs production RAG
A basic RAG demo can be built in days from a tutorial. It works on the ten documents you tried it on. Production RAG has to work on the ten thousand you didn't.
| Item | Basic demo | Production RAG |
|---|---|---|
| Documents | A few clean files | Your real mix: scans, tables, old versions |
| Search | Vector search only | Hybrid search plus re-ranking |
| Answers | Plausible text | Answers tied to cited passages |
| Testing | Spot checks | An evaluation set run on every change |
| Updates | Re-run a script | Scheduled sync, with deletions handled |
| Access | Everyone sees everything | Per-user or per-team permissions |
| Monitoring | None | Logs, user feedback, failure review |
The gap is mostly testing and data handling, not the model. That is why a demo can look almost done and still need weeks of work.
Build vs buy: when custom RAG is worth it
Off-the-shelf tools are often enough. Buy when:
- Your documents already live in a tool with built-in AI search, and its answers are good enough.
- A small team needs it for internal reference, and a wrong answer costs little.
- Your documents are clean, mostly text, and don't need per-user permissions.
Build custom when:
- Answers must cite the exact passage, as in legal, compliance or technical support work.
- Data spans several systems or must respect per-user permissions.
- Data can't go to a third-party SaaS tool, or must stay on your own servers.
- Search needs domain logic, such as part numbers, case citations or product filters.
- The feature is part of a product you sell, so you need to own its quality and cost.
A sensible path is to try an off-the-shelf tool on your real documents for a few weeks. If it fails on accuracy, permissions or privacy, you now have a clear spec for what to build.
RAG vs fine-tuning cost
Fine-tuning changes how a model writes. RAG changes what it knows at answer time. Most teams asking about fine-tuning for company knowledge need RAG.
| Item | RAG | Fine-tuning |
|---|---|---|
| Best for | Answering from documents that change | A fixed style, format or narrow classification task |
| Upfront work | Ingestion, search, evaluation set | Collecting and cleaning hundreds to thousands of training examples |
| When data changes | Re-index the changed documents | Retrain and re-test the model |
| Citations | Each answer points to its source | Not available: the model can't show where a fact came from |
| Model choice | Any model, hosted or self-hosted, and easy to switch | Tied to the base model you tuned |
For company knowledge, RAG is usually cheaper to build and much cheaper to keep current. Fine-tuning can make sense later, on top of RAG. One example is teaching a small model your output format so you can move to a cheaper tier.
Self-hosted RAG for sensitive data
Legal, health, finance and security teams often can't send documents to a third-party API. RAG can run fully inside your environment: open-weight models, a self-hosted vector database and your own servers.
This changes the cost in three ways.
- Build cost rises. Model serving, GPU setup and monitoring add work. It often pushes a project toward the enterprise tier.
- Token fees go away, GPU bills arrive. You pay for GPUs whether they are busy or idle. One always-on GPU costs roughly $430 to $2,900 a month on a GPU cloud at on-demand rates, depending on the card.
- Quality needs checking. Test open-weight models on your own evaluation set before you commit to them.
A middle path is a private deployment of a hosted model inside your own cloud account. Data stays under your contracts, and you don't run GPUs yourself. We cover the security side on our AI security page.
Real examples from our work
midpage.ai: legal research with exact citations
We built midpage.ai, an AI legal research product, end to end. It gives retrieval-augmented answers, and every answer links to the exact passage in the source document.
In legal work, an answer without a source can't be used. Passage-level citations depend on careful parsing and retrieval, which is where this kind of build spends its effort. See the project.
A self-hosted assistant for a US distributor
For a US B2B distributor of low-voltage and security products, we built a self-hosted AI shopping assistant. Open-weight models run on the client's own servers with Ollama and vLLM, so customer data never leaves their environment. Typesense powers hybrid product search.
One lesson applies to any RAG budget: keep product search and RAG document chunks in separate search collections. Merging them inflated facets, caused redundant embedding calls and created pagination loops. See the project.
How we price RAG projects
We start with a 1–2 week discovery sprint at $1,500–$3,000. We take a sample of your documents, test parsing and retrieval on them and write the evaluation questions with you. It ends with a fixed quote.
The build is paid in milestones. Infrastructure is billed to you by the providers or passed through at cost. If you need help after launch, a dedicated engineer costs $35–$45 an hour.
Tell us what documents you have and who needs answers from them, then book a call. More on our LLM and RAG development service.
Want a fixed quote for your project?
Tell us what you are building. We reply within one working day, and a discovery sprint turns your idea into a firm price and plan.
Common questions
How much does it cost to build a RAG system?
Most RAG systems we build cost $8,000 to $20,000 for one data source with citations and an evaluation set. Enterprise RAG with several sources, permissions and monitoring costs $20,000 to $45,000. We give a fixed quote after a 1–2 week discovery sprint.
How long does it take to build a RAG system?
A production RAG system with one data source takes 4 to 8 weeks after discovery. Enterprise RAG with several sources and permissions takes 8 to 14 weeks. Messy documents and slow access to source systems push projects toward the longer end.
What are the monthly costs of running a RAG system?
For typical workloads, roughly $100 to $2,000 a month. Most of it is LLM calls, which depend on question volume, context size and model tier. Embeddings usually cost a few dollars per indexing run, and a vector database can cost nothing if you use pgvector in your existing Postgres.
Is it cheaper to fine-tune or use RAG?
For answering from company documents, RAG is usually cheaper to build and much cheaper to keep current. Fine-tuning needs curated training data and a retrain each time the knowledge changes, and it can't cite sources. Fine-tuning is better suited to teaching a fixed style or format.
Should I build a custom RAG system or buy an off-the-shelf tool?
Buy when your documents are clean, permissions are simple and an occasional wrong answer is acceptable. Build when you need exact citations, per-user permissions, data kept on your own servers or search that understands your domain. Trying a tool on your real documents first is a cheap way to decide.
What is the difference between basic and production RAG?
A basic demo uses vector search over a few clean files and is checked by hand. Production RAG handles your real document mix, uses hybrid search and re-ranking, cites passages and is tested against an evaluation set on every change. That testing and data work is most of the cost difference.
Can a RAG system run on our own servers?
Yes. Open-weight models, a self-hosted vector database and your own servers keep every document in your environment. It raises build cost and replaces token fees with GPU costs, roughly $430 to $2,900 a month per always-on GPU at on-demand cloud rates.
Which vector database should I use?
For many projects, pgvector inside a Postgres database you already run is the cheapest choice, with no extra license fee. Managed services such as Pinecone or Qdrant Cloud make sense when you want less to operate or need to scale further. We pick one per project during discovery.
Sources
Have something to build?
Tell us where things stand and what you need. A short message is enough to start.