Building deterministic RAG systems

We build a RAG loop with hybrid search, a semantic cache, and tracing: the model receives only verified fragments, and every answer is traceable to its source.

The model answers from 3–4 verified fragments and cites each source.

Pricing

from ₽1,500,000

per project

This is the lower bound of a project. We scope the exact quote after a brief: it depends on volume and the number of integrations.

What's included

Capabilities

Hybrid search

Meaning and exact identifiers such as part numbers, dates, and names are searched together, not separately.

Verifiable source

Every answer links to a specific fragment; without a source the system marks the answer as coming from memory.

Semantic cache

Repeated questions are answered instantly, and the cache version resets when a document updates.

De-identification on exit

Only fragments without personal data leave the perimeter, and the trace logs show it.

How we work

From request to result

  1. 1

    Knowledge audit

    We review sources, structure, and access rights: what may be given to the model at all.

  2. 2

    Chunk schema

    We split documents by structure and fix metadata: version, source, rights.

  3. 3

    Building the loop

    We bring up hybrid search, cache, and tracing, and close external calls with de-identification.

  4. 4

    Quality benchmarks

    We measure the share of answers with a source link and retrieval accuracy on your question set.

Who it fits

Check if it fits you

Good fit

  • A large document archive

    Policies, contracts, and support history do not fit the context but are needed for answers.

  • Frequent repeated questions

    The same topics come back: the semantic cache takes load off external inference.

Not a fit

  • Documents change daily

    With a daily index rebuild, cache and versions need a separate pipeline, which is another scope.

  • No owner of the knowledge base

    If no one owns the sources, stale documents land in answers alongside fresh ones.

Track record

What you get

70–80%

requests served from the semantic cache

Answers linked to a specific policy section, and repeated questions were closed by the cache.

Scope of work

What the delivery includes

A source audit

A source audit shows which documents exist, who owns them, and how often they change. Base freshness becomes manageable.

A chunk and metadata schema

Each fragment gets a structure, a version, and access rights. A chunk and metadata schema keeps search predictable.

Hybrid search and cache

Vector and full-text search work together, and the cache threshold is set separately. Hybrid search raises the chance of an exact answer.

Tracing and de-identification

The answer path shows in the logs, and personal data is stripped on exit. Tracing and de-identification go with the output filters.

Benchmarks on your questions

We measure the share of answers with a source link and retrieval accuracy on your question set. Benchmarks show real quality before launch.

How it works

How the system is built

  1. Offline indexing

    Documents are indexed offline, so answer quality stays stable under any current traffic. Latency of the external channel affects such an answer only slightly.

  2. Hybrid search

    Hybrid search closes both failures: vector search misses a part number, full-text misses a synonym, and together they catch both.

  3. Answer tracing

    Tracing shows the answer path: which fragment was found, what the request cost, and at which step the source was lost.

  4. Event-based versions

    Index versions switch on an event: a policy update reindexes only the changed part of the archive, while the rest of the array keeps its previous version.

Limitations and cost

Where the solution pushes back

  • 01

    Chunking decides a lot

    Chunking decides a lot: too small a chunk breaks context and too large a one blurs the model's attention, and both give a wrong answer.

  • 02

    The cache returns a close answer

    The semantic cache can return a past answer to a vector-close question: the threshold stays high and hits are logged.

  • 03

    Pattern-based de-identification

    De-identification works on patterns: regexes catch email and phones, while free text needs manual sampling. Full guarantees cover structured fields.

  • 04

    Access rights in the metadata

    Access rights live in the fragment metadata: without them, search returns documents closed to that user as well.

  • 05

    The knowledge base owner

    The knowledge base owner is responsible for source freshness. The owner sets the refill rules, or the base goes stale.

  • 06

    Access rights

    Access rights define who sees which documents. Access rights are set up front, or search returns documents closed to a user.

  • 07

    Source quality

    Scans without a text layer and duplicates lower retrieval accuracy. Source quality sets the accuracy ceiling for the whole system.

  • 08

    The update rule

    The update rule names the event that triggers a rebuild of the index version. The rule keeps the index fresh and assigns an owner.

Stack

Technologies

The technologies we use in our work and their role in a project.

Search and observability

Search runs on Qdrant or pgvector, the step chain is collected by Langfuse, document updates go through Kafka, and index versions are stored in PostgreSQL.

A vector database with metadata filters: search respects both meaning and access rights to a fragment.A PostgreSQL extension for vectors: when the whole stack is on one database, a separate vector store is unnecessary.Chain tracing: it shows which fragment was found, what the request cost, and where the source was lost.The event bus: a new document revision triggers a version rebuild, not a full reindex.Stores index versions and metadata: they switch the cache and check rights on a fragment.
Budget estimate

Cost calculator

This is an indicative range, not a quote. We scope the exact estimate after a brief: it depends on volume and the number of integrations.

Data sources

5

Retrieval

Evaluation

Add-ons

Support

Year one: updates and monitoring, a reply within 2 business days.

Service

Building deterministic RAG systems

The estimate covers our team's work. Hardware, third-party service licences and travel are added on request.

Estimated cost

₽2.1M

Timeline

6 wk

Questions

Frequently asked questions

How is this different from plain RAG?

We do not send the whole archive into context: the model gets 3–4 verified fragments and a source link.

What if the needed fragment is missing?

The system marks the answer as coming from memory instead of presenting it as retrieved from documents.

How often should the index be rebuilt?

On an event: a new document revision triggers a version rebuild, not a full reindex.

Does data leave the perimeter?

Only de-identified fragments; parsing, indexing, and search stay inside the loop.

Can several sources be connected?

Yes, connectors collect documents from several systems, and rights are checked at the fragment metadata level.

What about running costs?

The main cost is external inference on answers the cache does not hold. Rebuilds run on an event, not a schedule, so you pay for real changes.

Ready to discuss your task?

Leave a request – we'll get back with a proposal and a preliminary estimate.

Contact us