Skip to content
CipherCruCipherCru

Menu

AI Development

LLMOps and Vector Databases

When an AI system gives a bad answer, the model is rarely the reason. It is usually that the right passage was never retrieved, and nobody was measuring for it.

Typical duration
Three to eight months
Team shape
Two to four senior engineers
Starts with
A retrieval evaluation
A retrieval pipeline and its evaluation results under review

Retrieval is the part worth engineering

Teams that are unhappy with an AI system's answers usually reach for a different model first. It is the wrong lever most of the time: if the passage containing the answer was not in what the model was given, no model can produce it, and a better one will simply produce a more fluent wrong answer.

This engagement is about the layer underneath — how documents are chunked, embedded, indexed and ranked, and how you know any of it is working. That last part is the one most often missing. Without an evaluation harness, retrieval quality is a matter of opinion and a change is a gamble, which is why we build the harness before we tune anything.

What usually goes wrong, and what we do instead

Retrieval problems are invisible without measurement, which is why they persist.

Where retrieval quietly fails

  • A fixed chunk size applied to every document type regardless of shape
  • Semantic search alone, so exact identifiers and codes are never matched
  • No evaluation, so a tuning change is judged by trying a few questions
  • Permissions applied after retrieval, so the model saw it anyway
  • An index rebuilt manually, and quietly stale between rebuilds

How we build it instead

  • Chunking chosen per document type, tested against real questions
  • Hybrid search, so identifiers and phrasing are both matched
  • An evaluation harness built before any tuning, and run on every change
  • Permissions carried into the index and applied at retrieval
  • Scheduled incremental indexing, with freshness monitored

What that involves

The layer that decides whether an AI system's answers are good, regardless of which model sits on top.

The evaluation harness first

Before any tuning, something that can tell you it worked.

A scored question set over your own material, run on every change to chunking, embeddings or ranking. Without it, retrieval tuning is guesswork with a confident tone.

Chunking strategy

Chosen per document type and tested, because one size applied to everything is the commonest cause of misses.

Hybrid retrieval

Semantic and keyword search together, so a part number and a paraphrase are both found.

Vector storage

pgvector or a dedicated store, chosen on your scale and on who has to operate it.

Permission-aware retrieval

Access carried into the index, so a model never sees a passage the reader could not.

Indexing pipelines

Incremental and scheduled, with freshness monitored rather than assumed.

Cost and latency budgets

Token spend and response time measured per query type and treated as budgets.

What you end up with

Stated from your side rather than ours.

  • Retrieval changes you can prove

    The harness scores every change, so tuning becomes engineering rather than a sequence of hopeful adjustments.

  • Permissions that hold at the model

    Access is applied at retrieval, so a passage a reader is not entitled to never reaches the prompt in the first place.

  • Freedom to change model

    With retrieval and evaluation as your own infrastructure, swapping provider is a measured decision rather than a rebuild.

  • Costs you can see and control

    Token spend and latency measured per query type, so the expensive path is identifiable rather than an aggregate bill.

How the pieces fit together

Six components, and the model is deliberately the most replaceable of them.

An ingestion and indexing pipeline feeding hybrid retrieval and a reranker, with an evaluation harness scoring the output
Stand-in artwork. The numbered legend describes the system rather than this picture.

What each part does

  1. Ingestion: sources pulled on a schedule, with permissions and provenance captured alongside the text.
  2. Chunking and embedding: split per document type and embedded, with the strategy recorded so a change can be evaluated.
  3. The index: vectors and keywords together, so exact identifiers and paraphrases are both matched.
  4. Retrieval and reranking: candidates fetched broadly then reordered, which is usually the cheapest quality gain available.
  5. The permission filter: applied at retrieval, so the model is never given a passage the reader could not open.
  6. Evaluation harness: a scored question set run on every change and again in production, so regressions surface.

How the work runs

The same five stages as every engagement, applied to the layer underneath a model.

Diagnose

What is being retrieved today, what is being missed, and whether the complaints are retrieval or model problems.

Decide

The evaluation set, the chunking strategy and the storage choice, written down with what each one costs to operate.

Prove

The harness built and a baseline scored, so every change afterwards has something to be measured against.

Deliver

Pipeline and retrieval improved in slices, each scored against the baseline before the next is scoped.

Hand over

Your team runs the harness and tunes retrieval with us watching, then without us.

What we build it with

Chosen for what has to be operated afterwards, and by whom.

Vector and search

  • pgvector
  • PostgreSQL
  • Elasticsearch
  • MongoDB

Pipelines

  • Python
  • LangChain
  • Temporal
  • dbt

Models

  • Anthropic
  • OpenAI
  • Gemini
  • PyTorch

Platform

  • AWS
  • Azure
  • Docker
  • Datadog

What you get, and when

Handed over as it is produced, not assembled at the end.

  • A scored question set over your own material, which you keep
  • A baseline score for the retrieval you have today
  • Which complaints are retrieval problems and which are not
  • Source in repositories you own
  • Incremental indexing you can re-run over a full corpus
  • Permission-aware retrieval, tested against a denied case
  • The harness wired into CI, so a change is scored automatically
  • Freshness, latency and token-spend dashboards
  • The chunking and ranking decisions recorded with their scores

Questions about retrieval and LLMOps

The ones we are asked most often before a first conversation.

Which vector database should we use?
For most organisations, pgvector in a PostgreSQL you already run — because it removes an entire system from the estate and your team already knows how to back it up, monitor it and restore it. A dedicated store earns its place at large scale or with demanding filtering requirements. The deciding question is usually who operates it at three in the morning rather than a benchmark.
Our AI system gives bad answers. Is this the fix?
Often, and the diagnostic tells you rather than assuming. The way to find out is to check whether the passage containing the correct answer was retrieved at all: if it was not, no model change will help; if it was and the answer was still wrong, the problem is prompting or the model. That distinction takes days to establish and saves people from replacing a model that was never the issue.
What chunk size should we use?
There is no universal answer, and treating one as universal is the most common source of retrieval misses. A contract, a chat transcript and a product specification all want different strategies, and the right one is found by measuring against real questions rather than by picking a number. Which is the argument for building the evaluation harness before doing any of the tuning.
How do you build the evaluation set?
From real questions people ask, paired with the passages that should answer them, assembled with your subject-matter experts. It takes effort — usually a few sessions — and it is the most valuable artefact of the engagement, because it turns every future change from a gamble into a measurement. You keep it, and it stays useful long after we have gone.
How do we stop it returning things people should not see?
By carrying permissions into the index and applying them at retrieval rather than filtering afterwards. If access is checked after the model has already been given the passage, the passage has effectively leaked — it can be reflected in an answer even when the citation is stripped. We test this explicitly with a denied case as part of the acceptance criteria.
Does this tie us to one model provider?
The opposite, and that is much of the point. When retrieval and evaluation are your own infrastructure, changing provider is a scored experiment rather than a rebuild — you run the harness against the alternative and compare. Embeddings do tie you to the model that produced them, so a change there means re-indexing, which is why we make re-indexing a routine pipeline run rather than a project.

AI system giving answers you cannot trust?

Tell us what it is getting wrong. We will find out whether the problem is the model or what it was given.

Strictly necessaryEssential for the site to function: page navigation, security, session management, and remembering the cookie choices you make here.
Always on
FunctionalRemembers choices you make, such as language, region or display preferences, so the site opens the way you left it.
Performance and analyticsPerformance and analytics cookies show us how the Website is used: which pages are visited, how long is spent on them, where visitors came from, and what errors occur. They are set by Google Analytics and by HubSpot, whose cookies also link the pages you viewed to any enquiry you later send us.
Marketing and targetingTracks browsing activity to measure advertising and show relevant ads. We set none of these today, and will not without your opt-in.