← All articles

What a RAG System Costs: Build Effort, Running Costs and Where the Money Goes

KashEdge AI · Updated · 7 min read

Retrieval-augmented generation (RAG) lets an LLM answer questions from your own documents instead of its training data. Teams asking what it costs usually expect the answer to be about the vector database. In practice infrastructure is the small part: engineering the ingestion, access control and evaluation is where most of the effort goes, and LLM generation is usually the largest running cost.

The parts of a production RAG system

  • Ingestion: connectors to the document sources (SharePoint, Google Drive, S3, databases), parsing PDFs, scans and tables, and keeping the index in sync as documents change.

  • Chunking and embeddings: splitting documents into passages and turning each into a vector.

  • Vector store and search: storing vectors and combining semantic search with keyword search and filters.

  • Reranking and prompting: choosing the best passages and asking the LLM to answer with citations.

  • Access control: making sure users only retrieve documents they are allowed to see.

  • Evaluation and monitoring: test question sets, answer-quality scoring, cost and latency tracking.

Build effort

A proof of concept over one clean document source, with a simple chat interface, is typically a few weeks of work. A production system with several sources, document-level permissions, citations, evaluation and monitoring is typically two to three months for a small senior team.

What pushes effort up: messy or scanned documents, many source systems, per-document permissions, multiple languages, strict accuracy requirements (legal, medical, finance) and integration into existing applications.

A worked example of running costs

Assume 20,000 documents averaging 10 pages, about 600 tokens per page, and 2,000 questions a day. Each question sends about 4,000 tokens of retrieved context to the LLM and gets a 500-token answer.

Cost itemCalculationApprox. cost
Embedding the corpus (one-off)120M tokens × $0.02 per 1M (OpenAI text-embedding-3-small)≈ $2.40
Vector storage~240k chunks × 1,536 dims × 4 bytes ≈ 1.5 GB, fits pgvector on an existing Postgrestens of dollars / month
LLM generation8M input + 1M output tokens/day at an illustrative $3 / $15 per 1M≈ $39 / day ≈ $1,170 / month

What the example tells you

  • Embeddings are nearly free; re-embedding the whole corpus when you change models is a non-issue at this scale.

  • Generation dominates. Halving retrieved context, caching repeated questions or routing simple questions to a smaller model cuts the bill far more than any database choice.

  • A dedicated vector database is rarely needed below tens of millions of chunks. pgvector, OpenSearch or the vector search built into your warehouse is usually enough and avoids another system to run.

Costs teams forget to budget

  • Document clean-up: OCR, table extraction and removing duplicates often take longer than the AI part.

  • Permissions: mirroring source-system access rules into retrieval filters.

  • Evaluation: building a test set of real questions with known answers, and re-running it on every change.

  • Keeping the index fresh: incremental sync, deletes and re-chunking when documents change.

  • Monitoring: tracking cost per question, latency and answer quality in production.

How to keep a RAG project on budget

Start with one high-value document source and a fixed set of real user questions, measure answer quality before adding sources, and choose infrastructure you already run. Most of the cost risk sits in scope, not in the model or the database.

Frequently asked questions

How much does it cost to run a RAG chatbot?

For a mid-size internal assistant (tens of thousands of documents, a few thousand questions a day) running costs are typically hundreds to low thousands of dollars a month, mostly LLM generation. Embeddings and vector storage are usually a small fraction.

Do I need a dedicated vector database for RAG?

Usually not at first. pgvector on PostgreSQL, OpenSearch, or the vector search in Snowflake, BigQuery or Databricks handles millions of chunks. A dedicated vector database makes sense at very large scale or with demanding latency and filtering needs.

How long does it take to build a RAG system?

A proof of concept over a single clean source takes a few weeks. A production system with multiple sources, permissions, citations and evaluation typically takes two to three months.

Related

Planning a data or AI project?

Tell us what you are building and we'll give you a straight answer on approach, effort and cost.

Start a Project