Control the cost of document retrieval and RAG

Control RAG costs through document change tracking, incremental indexing, vector sizing, retention and deletion checks that preserve useful retrieval.

Last updated

In short

  • Indexing changed documents can be cheaper than rebuilding an entire corpus, but freshness must be verified.
  • Vector bytes are only one part of retrieval storage and operating cost.
  • A deletion must reach source copies, extracted text, vectors and retained recovery data under the agreed policy.
On this page (6)

Costs and savings · Part of Qdrant

Editable CSV with a worked example and fields for your own assessment. Example rows are illustrative, not measured results.

Download the RAG ingestion and retention worksheet

Document retrieval costs include extracting text, creating embeddings, storing indexes and keeping the result current. Reprocessing everything may be simple but wasteful; skipping changes may be inexpensive but wrong. A useful cost reduction preserves the answers and access rules the system is supposed to provide.

This is a planning and verification procedure. The examples below are arithmetic illustrations, not measured Pilae benchmark results. Use the accompanying worksheet to record your own corpus and processing evidence.

Track the document lifecycle

Stage Cost driver Evidence to record
Source discovery Number of systems and change checks Documents added, changed and deleted
Extraction File type, length, OCR and failures Pages/tokens processed and retries
Chunking Chunk size and overlap Chunks per document and duplicate text
Embedding Tokens and model execution Model/version and billed or local compute
Indexing Vector dimensions, payloads and indexes Storage, update time and memory
Retrieval Query volume, filters and reranking Latency, answer usefulness and cost
Retention Old versions, copies and backups Deletion and recovery policy

The Open WebUI retrieval documentation describes document retrieval options. Where extraction, embeddings and generation are processed depends on configuration and providers. A locally hosted interface does not by itself keep every stage local.

Avoid rebuilding unchanged content

Give each source document a stable identifier and record a content version or checksum. Track extraction and embedding versions separately. A text change should invalidate the affected representation; a changed embedding model can require rebuilding a much wider set.

For illustration, a corpus of 100,000 documents with 2,000 changed in a month has a 2% changed-document share. Processing only those documents could reduce document-processing work compared with a full rebuild, but it does not establish a 98% reduction in total cost. Discovery, persistent storage, queries, failures and any model-change rebuild remain.

Qdrant’s point documentation explains identifiers and update operations. Build idempotent ingestion around stable IDs and a manifest, so retries do not quietly multiply documents. Preserve enough state to reconcile a source inventory with what the retrieval layer contains.

Make chunking a quality decision

Smaller chunks may reduce irrelevant context but increase vector count. Overlap can preserve meaning across boundaries while duplicating text and embedding work. Long scanned documents can have extraction errors that no vector configuration fixes.

Start with a representative sample: short policies, long reports, tables and scanned files. Ask questions whose supporting passage is known. Measure whether the correct passage is retrieved and whether the answer cites it. Record failures before optimizing cost. Do not choose chunk settings solely from the smallest invoice.

Estimate storage without confusing payload and footprint

A vector with 1,536 dimensions stored as four-byte values contains 6,144 bytes of raw vector values. One million such vectors imply roughly 6.1 GB in decimal units for those values alone. Payload text, metadata, indexes, replication, WAL and recovery copies add to it; a different vector representation changes the estimate.

Qdrant capacity guidance should be read for the selected configuration. Measure the actual footprint on a representative corpus rather than applying raw-vector arithmetic to the whole server. Indexes for access or filtering may be necessary even when they cost memory.

Define retention and deletion together

Keep source versions only for a stated purpose. A deleted document should not remain answerable through old chunks or extracted-text caches. At the same time, deletion policy for backups may differ from deletion in the active index. Document both rather than claiming instant erasure from every retained copy.

Test a source update, permission revocation and deletion. Query using the old wording, a distinctive phrase and an account that should no longer have access. Check the manifest and index counts as well as the visible answer. Access filtering is a security requirement, not an optional cost optimization.

A controlled reduction experiment

  1. Freeze the corpus sample, model, extraction settings and evaluation questions.
  2. Record processing work and storage before changing the pipeline.
  3. Enable one change, such as stable-ID incremental ingestion or less redundant overlap.
  4. Re-run update, retry and deletion scenarios.
  5. Compare retrieval quality, freshness, latency and total cost.
  6. Retain the old index until the new one passes and rollback is defined.

Budget a temporary second index when changing embedding models or structure. A cheaper new representation is not ready if it silently drops relevant documents. Use the private AI cost calculator for the wider service and the permission-aware architecture guide for access design. The best optimization removes unnecessary processing while keeping the evidence users need.

Sources and further reading

Use the linked documentation to confirm the version, edition and contract that apply to your project.

Review our retrieval workload

Bring your current bill, required capabilities and workload assumptions. We will separate recurring operation from migration and retained services.