- AI Knowledge Base
- Artificial Intelligence
How Much Does It Cost to Vectorize a Database for RAG?
Learn what it really costs to vectorize a database for RAG, from embeddings and parsing to vector storage, queries, replicas, and re-indexing.

Vectorizing a database for retrieval-augmented generation (RAG) can cost pennies for a small knowledge base or thousands of dollars for a large, frequently changing corpus. The surprising part is that the embedding API is often one of the smallest expenses. Document parsing, vector database capacity, query traffic, replicas, reranking, evaluation, and re-indexing can cost more than generating the vectors.
The 30-second answer: At public online list prices reviewed on September 2, 2026, embedding 100 million text tokens costs roughly $2 to $20 across the mainstream models compared below. Under our worked example, vectorizing one million 500-word pages costs about $15 with OpenAI text-embedding-3-small, $96 with text-embedding-3-large, or $111 with Gemini Embedding. If every page also needs Cohere Parse at $1.50 per 1,000 pages, parsing adds $1,500. Storage, indexes, queries, writes, replicas, backups, and engineering are separate.
This guide shows the formulas behind those numbers, compares embedding and vector database prices, and explains where Pinecone, Google Agent Retrieval, SingleStore, Supabase, Qdrant, Weaviate, Zilliz, Chroma, Elasticsearch, MongoDB, and pgvector fit. Prices change, so treat every vendor figure as a dated planning input and verify the region and plan you intend to use.
What does “vectorizing a database” actually include?
Vectorization is commonly used as shorthand for calling an embedding model. A working RAG index has more steps. If you are new to the full retrieval pipeline, start with our RAG API and retrieval-augmented generation explainer.
- Extract and parse: read text, tables, images, layouts, and metadata from files or application records.
- Clean and chunk: remove noise, preserve useful structure, split content into retrievable passages, and overlap chunks when context would otherwise break.
- Generate embeddings: send each chunk to an embedding model, or run a model on your own infrastructure.
- Write and index: store vectors, text, source identifiers, timestamps, tenant IDs, and permission metadata; then build or update the search index.
- Serve retrieval: embed queries, run dense or hybrid search, filter results, and optionally rerank candidates.
- Operate the lifecycle: synchronize changes, delete revoked content, back up data, monitor quality, and re-embed when the model or chunking strategy changes.
A quote that covers only embedding tokens answers one narrow question: “What will the first API call cost?” A useful budget must answer “What will it cost to keep relevant, permission-safe context available at the latency and traffic we expect?”
The cost formula for a RAG vector index
You can estimate the initial build with five inputs: source tokens, chunk size, chunk overlap, vector dimensions, and bytes per dimension. Let T be source tokens, C chunk size, and O overlap:
- Embedded tokens ≈ T × C ÷ (C − O)
- Number of chunks ≈ T ÷ (C − O)
- Embedding API cost = embedded tokens ÷ 1,000,000 × model price per million tokens
- Raw vector bytes = chunks × dimensions × bytes per dimension × replicas
- Query-embedding cost = queries × average query tokens ÷ 1,000,000 × model price
Overlap matters because repeated text is embedded repeatedly. A 500-token chunk with 50-token overlap adds about 11.1% to the token bill compared with no overlap. Raw vector bytes are not a database capacity estimate: metadata, stored text, approximate-nearest-neighbor indexes, write-ahead logs, replicas, backups, temporary compaction space, and operational headroom all add to it.
If your source measure is pages rather than tokens, a practical planning conversion is:
Source tokens ≈ pages × average words per page × tokens per word.
English business text is often modeled at about 1.3 tokens per word for rough estimation. PDFs with tables, OCR errors, code, identifiers, or multiple languages can differ substantially. Measure a sample from the actual corpus before approving a large budget.
Embedding cost comparison: what does 100 million tokens cost?
The table uses public online text-input prices available on September 2, 2026. It intentionally excludes free allowances, negotiated contracts, retry traffic, chunk overlap, and future re-embedding. Batch prices can be lower where a provider supports them.
| Embedding model | Online input price | Cost for 100M tokens | Important pricing detail |
|---|---|---|---|
| OpenAI text-embedding-3-small | $0.02 / 1M tokens | $2 | 1,536 dimensions by default; dimensions can be reduced. |
| Voyage 4 Lite | $0.02 / 1M tokens | $2 | Voyage publishes free-token allowances and a Batch API discount; eligibility matters. |
| Voyage 4 | $0.06 / 1M tokens | $6 | Supports flexible output dimensions and quantization. |
| Voyage 4 Large | $0.12 / 1M tokens | $12 | The higher model price may still be minor beside parsing and serving. |
| OpenAI text-embedding-3-large | $0.13 / 1M tokens | $13 | 3,072 dimensions by default; larger vectors can increase database capacity. |
| Gemini Embedding | $0.15 / 1M tokens | $15 | Google lists $0.12 / 1M for batch input. |
| Gemini Embedding 2 Preview, text | $0.20 / 1M tokens | $20 | Google lists $0.10 / 1M for batch text; image, video, and audio use different units and rates. |
For the capabilities and limits behind Google’s multimodal preview price, see our Gemini Embedding 2 guide.
The lowest token price is not necessarily the lowest total cost. A model that needs fewer dimensions can reduce storage and memory. A model that retrieves better can reduce reranking or generation waste. Conversely, an expensive model may produce larger vectors without improving your domain. Compare models on a labeled retrieval set before multiplying a public benchmark by billions of chunks.
Worked examples: from 10,000 to 10 million pages
To make the math reproducible, the following scenarios assume 500 words per page, 1.33 tokens per word, 500-token chunks, 50-token overlap, 1,536-dimensional float32 vectors, and one copy of each vector. They exclude parsing, metadata, indexes, replicas, backups, reads, writes, and labor.
| Corpus | Source tokens | Embedded tokens | Approx. chunks | Raw vectors | OpenAI small | OpenAI large |
|---|---|---|---|---|---|---|
| 10,000 pages | 6.65M | 7.39M | 14,778 | 0.08 GiB | $0.15 | $0.96 |
| 100,000 pages | 66.5M | 73.9M | 147,778 | 0.85 GiB | $1.48 | $9.61 |
| 1 million pages | 665M | 738.9M | 1.48M | 8.46 GiB | $14.78 | $96.06 |
| 10 million pages | 6.65B | 7.39B | 14.78M | 84.56 GiB | $147.78 | $960.56 |
For the one-million-page row, Gemini Embedding at $0.15 per million input tokens would cost about $110.83. Those numbers show why “embeddings are expensive” can be the wrong assumption for text. At the same scale, Cohere Parse lists API pricing of $1.50 per 1,000 pages, or $1,500 if all one million pages are parsed. Better parsing can be worth it—especially for tables, forms, slides, and complex PDFs—but it should be modeled as its own line item. Our Cohere Parse v5 guide explains that trade-off in more detail.
How much vector storage do you need?
For dense float32 vectors, each dimension uses four bytes. A 1,536-dimensional vector therefore needs 6,144 raw bytes—about 6 KB—before any index or metadata. The 1.48 million chunks in our example produce about 8.46 GiB of raw vectors.
Qdrant’s capacity-planning guidance uses the same basic formula and separately estimates HNSW links, payloads, payload indexes, replication, and headroom. Those additions explain why multiplying vectors by dimensions is a floor, not a bill. Approximate-search indexes can occupy substantial memory; stored chunk text and rich metadata can outweigh compressed vectors; replicas multiply data; and a migration may require two full indexes at once.
Precision is one of the biggest levers. Float16 cuts raw vector bytes roughly in half; 8-bit scalar quantization can cut them roughly fourfold; binary and product-quantization techniques can go further. Quantization guidance also makes the essential caveat clear: compression trades precision for resource savings. Measure recall and ranking quality on your own corpus before treating a compression ratio as free money.
Vector database cost comparison for RAG
Vector database prices are harder to compare than embedding prices because vendors meter different things: minimum plan commitments, compute hours, dimensions, read or write units, stored GiB, vCUs, data transferred, or combinations of them. The following table is a planning map—not a normalized benchmark.
| Provider | Public pricing shape | How vectorization works | Best cost fit / caveat |
|---|---|---|---|
| Pinecone | Starter free; Builder $20/month; Standard has a $50/month minimum; Enterprise has a $500/month minimum. Serverless usage adds storage, reads, writes, imports, and other features. A current AWS us-east-1 example lists $0.33/GB-month storage and $16 per million read units, with write rates varying by plan. | Bring vectors or use integrated embedding and reranking workflows; model charges and limits must be included. | Low operations and elastic usage. Read units depend on data targeted by a query, so namespace design affects cost. |
| Google Agent Retrieval | Usage-based storage, reads, writes, data ingestion, and capacity units. Public rates include about $0.000410959/GiB-hour stored, $0.06 per 100,000 reads, and $0.18 per 100,000 writes; performance and storage capacity units are separate. | Supports automatic embeddings, hybrid search, and semantic reranking. Google states the selected Gemini embedding model is billed separately. | Attractive for a Google Cloud-native pipeline, but “automatic” does not mean embedding is free. |
| SingleStore Helios | Free Shared Tier; Standard S-00 starts at $0.99/hour, approximately $723 for a 730-hour month, plus storage. Multi-AZ and Enterprise multipliers raise compute. | Stores vectors alongside relational data and supports vector search. AI functions can invoke models from SQL; verify preview status and separate model or inference charges. | Strong when transactional, analytical, and vector workloads belong together. The always-on compute floor is high for a small vector-only project. |
| Supabase + pgvector | Free includes a 500 MB database. Pro is $25/month and includes $10 in compute credits; database disk includes 8 GB and then lists $0.125/GB. Compute scales from Micro upward. | pgvector stores and searches vectors. Supabase documents Edge Function and automatic-embedding patterns, including local models and external APIs; external embedding usage is separate. | Excellent when the app already uses Postgres, auth, and row-level security. Index memory and database compute—not a special “vector fee”—usually determine scale. |
| Qdrant Cloud | Free cluster with 1 GB RAM and 4 GB disk; paid clusters meter CPU, memory, disk, backups, and optional inference hourly. | Bring vectors or use Qdrant Cloud Inference where available. | Transparent resource sizing and an open-source self-hosted path. A production self-hosted cluster moves cloud fees into infrastructure and operator time. |
| Weaviate Cloud | Free sandbox; Flex starts at $45/month; Premium starts at $400/month. Flex lists vector-dimension, storage, and backup meters. | Bring vectors or use integrated vectorizer modules; hosted model token charges can be separate. | Useful when hybrid search and integrated models reduce application work. Dimension-based pricing makes chunk count and vector size especially visible. |
| Zilliz Cloud / Milvus | Serverless lists $4 per million vCUs plus storage. Vendor examples estimate about $6 to write one million 1,536-dimensional vectors and about $100 for one million searches over a one-million-vector collection, before other services. | Embeddings normally come from an external or application-managed model. | Serverless entry with a Milvus-compatible path. Search cost changes with collection size, vector dimensions, top-k, filters, and workload. |
| Chroma Cloud | Starter is usage-based with credits; public meters list $2.50/GiB written, $0.33/GiB-month stored, $0.0075/TiB queried, and $0.09/GiB returned. Team is $250/month plus usage with credits. | Can work with application-generated vectors and embedding integrations. | Simple metering and fast development. Returned-data and query-volume assumptions matter at scale. |
| Elastic Cloud Serverless | Search, ingest, machine-learning VCUs, storage, and egress are metered separately; vector profiles include an allowance and inference starts at a per-token rate. | Elastic supports dense and sparse vectors plus inference endpoints and hybrid search. | Good when lexical search, filters, and observability justify a broader platform. Count ingest and search capacity, not only stored GB. |
| MongoDB Atlas Vector Search | Atlas cluster cost plus search nodes or shared resources. An S20 search node is publicly listed from $0.12/hour on AWS; dedicated search deployments require at least two nodes, making the search-node floor roughly $175/month before the database cluster. | Store embeddings beside documents; application or model integrations generate them. | Economical architectural fit when Atlas already owns the JSON data. A vector-only project must still pay for the database layer. |
| Self-hosted pgvector | No separate pgvector license fee; pay for Postgres compute, memory, disk, replicas, backups, network, and operations. Managed Postgres providers add their own meters. | Generate embeddings in the application, a database function, or a connected service. | Often the lowest-complexity choice for an existing Postgres team. “Open source” is not the same as zero total cost. |
Pricing snapshot reviewed September 2, 2026. Rates can vary by cloud, region, plan, reservation, support level, and negotiated agreement. Follow each linked pricing page and model your own query pattern before purchasing.
For qualitative retrieval and deployment differences, use this guide alongside our updated comparison of the top vector databases for RAG.
Pinecone, Google, SingleStore, and Supabase: how the cost models differ
Pinecone: usage meters plus a plan minimum
Pinecone Serverless separates storage, writes, and reads. Its cost documentation explains that query read units scale with the namespace size targeted by the search, with a minimum charge per query. That makes multitenant data design a financial decision: one namespace per tenant can keep each search scoped to less data, while a shared namespace can cause a query to touch a larger collection even when metadata filters return a small result set.
For planning, separate the monthly plan minimum from metered data operations. Then test realistic namespace sizes, top-k, reranking, batch upserts, and traffic. A low raw storage bill can coexist with a larger read bill at high query volume.
Google Agent Retrieval: automatic vectorization, separately billed
Google Agent Retrieval—previously introduced as Vector Search 2.0—can create embeddings automatically and adds hybrid search and semantic reranking. The convenience removes pipeline code, not the economics: Google’s overview says automatic embedding uses the Gemini API, and the pricing page says the selected embedding model is billed separately.
A Google estimate should therefore include at least four layers: Gemini embedding tokens, data ingestion or writes, stored GiB and capacity units, and read operations. Compare this newer usage-based service with standard Vertex AI Vector Search carefully; the older product has different index-build, streaming-update, and serving-node meters.
SingleStore: vector search inside an always-on data platform
SingleStore can keep vectors, relational records, full-text fields, and analytics in one distributed SQL system. That consolidation can remove synchronization jobs and separate infrastructure. The trade-off is that the entry paid compute size is an always-on database workspace, not a few dollars of serverless vector storage.
Use SingleStore when the combined workload earns that compute: operational data, analytics, full-text search, and vector retrieval can share one platform. If you need only a small document index, compare its roughly $723 monthly S-00 compute floor with serverless or existing-Postgres options. If AI functions call an embedding model from SQL, confirm which function is generally available and who bills the inference.
Supabase: pgvector is included, embedding generation is a separate choice
Supabase provides Postgres with the pgvector extension, so there is no separate per-vector database product to buy. The bill is shaped by the Supabase plan, database compute, disk, egress, and any embedding service you call. A Pro project’s $25 base includes compute credits, but larger indexes or heavier queries may require more memory and a larger compute size.
Supabase also publishes automatic embedding patterns using triggers, queues, Edge Functions, and an embedding provider. Its Edge Functions can run certain built-in models, while other examples call OpenAI. In both cases, “automatic” describes orchestration. The actual cost lives in Edge Function usage, database resources, and any external model bill.
Managed vs. self-hosted: which is cheaper?
| Approach | Cost advantages | Costs people miss | Usually best when |
|---|---|---|---|
| Managed serverless | Little idle capacity, rapid setup, automated scaling, backups and upgrades included or available. | Plan minimums, read/write units, egress, support tiers, premium regions, and less control over index-level tuning. | Traffic is uncertain or the team has little database-operations capacity. |
| Managed dedicated | Predictable capacity and support; easier private networking and service-level objectives. | Idle nodes, replicas, minimum cluster sizes, overprovisioning, and support commitments. | Traffic is sustained and predictable or compliance needs a dedicated footprint. |
| Existing database with vectors | Reuses data, permissions, backups, skills, and vendor contracts; fewer synchronization paths. | Vector indexes compete with transactional workloads; memory upgrades and read replicas can be expensive. | Postgres, Elasticsearch, MongoDB, or SingleStore already owns the source of truth. |
| Self-hosted specialist engine | No managed-service margin; maximum placement and tuning control; open-source portability. | Engineering, on-call, upgrades, security, monitoring, capacity, backups, restore tests, and downtime risk. | Scale is large and stable, or deployment control is a firm requirement backed by an operations team. |
Self-hosting becomes cheaper only when the infrastructure and labor saved exceed the work you take on. A two- or three-node production cluster, backups, monitoring, private networking, incident response, and an engineer’s time can overwhelm a small managed bill. At very large steady workloads, well-run self-hosting can become economical—but that crossover must be calculated with fully loaded labor and reliability requirements.
How cost changes from prototype to enterprise scale
Prototype: prove retrieval quality before buying capacity
A prototype with tens of thousands of pages can often fit in free tiers or a small existing Postgres instance. Embedding cost may be well under one dollar. Spend the scarce budget on a representative document sample, hard questions, permission tests, and evaluation. Avoid architecture decisions based on a tiny demo’s latency.
Production: traffic and reliability replace embedding as the main variables
At hundreds of thousands to a few million pages, raw vectors may still fit in tens of GiB, but p95 latency, concurrent users, filtering, ingestion freshness, and high availability drive sizing. Model query read units, database memory, two or more replicas, backups, and one full re-index. Instrument cost per successful grounded answer—not merely cost per query.
Enterprise: governance and lifecycle dominate
At tens of millions of pages or strict compliance boundaries, corpus segmentation, tenant isolation, private networking, regional copies, restore objectives, deletion proofs, audit logs, evaluation suites, and migration capacity all matter. A negotiated agreement can make public prices less relevant, but it does not remove the need for workload-based unit economics.
Eight hidden costs in a vectorization budget
- Parsing and OCR: complex PDFs, scans, tables, and image-heavy documents may need a paid parser or vision model.
- Chunk overlap and duplicates: repeated text, boilerplate, versions, and copies inflate tokens and vectors without increasing knowledge.
- Metadata and source text: the payload around a 6 KB vector may be larger than the vector.
- Index memory and build time: HNSW graphs, payload indexes, compaction, and rebuilds require working space and compute.
- Queries, reranking, and generation: embedding a short query is cheap; searching large collections, reranking dozens of candidates, and generating long answers can be the recurring bill.
- Replication and recovery: two replicas approximately double stored vector data, while backups and cross-region copies add more.
- Change data capture and deletion: connectors, queues, retries, tombstones, and permission synchronization require both infrastructure and engineering.
- Re-embedding and migration: a new model or chunker can require a second full index during backfill, temporarily increasing storage and write costs.
Query embeddings are usually trivial in isolation. One million 20-token questions equal 20 million input tokens: about $0.40 with OpenAI text-embedding-3-small, $2.60 with text-embedding-3-large, or $3 with Gemini Embedding at the rates above. Database reads, reranking, and answer generation are likely to be the larger recurring costs.
How to reduce vectorization cost without damaging RAG quality
- Deduplicate before embedding. Hash normalized chunks and avoid indexing identical boilerplate or file versions.
- Choose chunking with evaluation. Larger chunks reduce vector count but may dilute retrieval; excessive overlap repeats tokens. Tune both against real questions.
- Use the smallest effective embedding model. Compare Recall@k, nDCG, downstream answer accuracy, latency, dimensions, and price—not model size alone.
- Reduce dimensions deliberately. OpenAI and Voyage document flexible dimensions. Smaller vectors save storage and memory; validate quality first.
- Quantize after establishing a baseline. Float16 or 8-bit vectors can cut memory, but measure recall before and after.
- Batch offline jobs. Google and Voyage publish discounted batch paths. Use them for initial builds and non-urgent backfills when service limits allow.
- Embed incrementally. Keep stable chunk IDs and content hashes so unchanged content is not reprocessed.
- Scope searches. Partition by tenant or corpus when the provider’s read pricing depends on data scanned, and enforce the same boundary for security.
- Store the source of truth outside the index. Reproducible ingestion makes provider migration and re-indexing safer.
- Track cost per useful answer. A cheaper index that retrieves poorly can increase reranking, generation, support, and user retry costs.
Should you build the vectorization stack or use managed RAG?
Build the stack when retrieval is part of your product advantage and you need direct control over parsing, chunking, embeddings, indexes, fusion, reranking, evaluation, and data placement. The engineering effort can be justified when these controls improve a measurable product outcome.
If the goal is to let employees or customers ask questions over approved company knowledge, managing every layer may be unnecessary. A RAG-as-a-service product packages ingestion, retrieval, permissions, model orchestration, and an assistant experience. For security-sensitive deployments, our guide to RAG in private clouds covers the broader boundary decisions.
The right comparison is not managed-product subscription versus embedding tokens. It is managed subscription versus the full cost of a reliable pipeline: vendor bills, infrastructure, implementation, evaluation, maintenance, and incident response.
A practical vectorization budget checklist
- Count source tokens from a representative sample rather than relying only on pages or files.
- Record chunk size and overlap, and calculate repeated tokens.
- Price at least two embedding models and their output dimensions.
- Estimate chunks, raw vector bytes, metadata, source text, index overhead, headroom, and replicas.
- Include parsing or OCR per page, image, or token where needed.
- Model monthly writes, deletes, reads, reranking, egress, and query embeddings.
- Reserve capacity for one full re-index and a dual-index cutover.
- Include backups, restore testing, monitoring, support, and fully loaded engineering time.
- Run the shortlisted database on your corpus and measure recall, latency, throughput, and cost together.
Frequently asked questions
How much does it cost to vectorize one million pages?
Under the assumptions in this guide—500 words per page, 1.33 tokens per word, 500-token chunks, and 50-token overlap—one million pages produce about 738.9 million embedded tokens. That costs about $14.78 with OpenAI text-embedding-3-small, $96.06 with text-embedding-3-large, or $110.83 with Gemini Embedding at current public online prices. Optional parsing, database storage and indexes, writes, queries, replicas, and labor are additional. Cohere Parse would add $1,500 if every page were processed at its listed API rate.
Does Google offer automatic vectorization?
Yes. Google Agent Retrieval supports automatic embeddings in its ingestion workflow. Google’s documentation says it uses the Gemini API and that the selected embedding model is billed separately. You also pay the relevant Agent Retrieval storage, capacity, read, write, or ingestion meters.
Does Supabase include vectorization?
Supabase includes Postgres and supports pgvector for storage and similarity search. It documents automatic embedding pipelines and Edge Function models, but the database plan is not a blanket embedding-token allowance. Include Edge Function usage, external embedding API charges where applicable, and the database compute and disk needed for the index.
Can SingleStore create embeddings?
SingleStore supports vector data and search, and its AI functions can call embedding models from SQL in supported configurations. Treat database compute and model inference as separate line items, and verify the availability and billing of the exact function and provider you plan to use.
How much does Pinecone cost for RAG?
Pinecone has a free Starter plan, a $20-per-month Builder plan, a $50 monthly minimum for Standard, and a $500 minimum for Enterprise at the time of review. Serverless usage adds storage, writes, reads, imports, reranking, and other selected features. Because read units depend on the data targeted by a query, estimate with your namespace size and traffic instead of using storage alone.
How much storage does one million vectors need?
One million 1,536-dimensional float32 vectors need about 5.72 GiB of raw vector data. That excludes IDs, metadata, source text, the approximate-search index, replicas, backups, and headroom. Float16 or quantization can reduce the vector portion, while larger dimensions and replicas increase it.
Do you only need to vectorize a database once?
No. New and changed content must be embedded, deletions must reach the index, and a new embedding model or chunking strategy can require a full rebuild. Store content hashes, stable chunk IDs, and model and chunker versions so you can update incrementally and audit what changed.
What is the cheapest vector database for RAG?
The cheapest option is often the capable database you already operate: pgvector in an existing Postgres deployment, Vector Search in an existing MongoDB cluster, or Elasticsearch when search is already part of the stack. For a new small workload, free and serverless tiers can be less expensive. For a large steady workload, dedicated or self-hosted capacity may win. Compare total cost at the same recall, latency, availability, and security target.
The bottom line
Text embedding prices have fallen far enough that vectorizing the initial corpus can be surprisingly cheap. The one-million-page example in this guide costs tens to a little over one hundred dollars for embeddings—not thousands. The total RAG system can still become expensive because parsing, database serving, query volume, high availability, reranking, generation, and operations recur long after the first vector is written.
Build your estimate from measured tokens and chunks, keep every assumption visible, and compare providers using one workload. If your goal is a useful company knowledge assistant rather than a custom retrieval platform, build a Cody assistant and test real questions before committing to a large infrastructure design.


