All posts
AI EngineeringLLMs

RAG is not a product: retrieval patterns that hold up

Chunk, embed, search, stuff into a prompt. That pipeline gets you a convincing prototype and a support queue full of confidently wrong answers. Here is what we build instead.

Ishtiyaq KhanJul 14, 20261 min read

Retrieval-augmented generation is a technique, not an architecture. The default recipe — split documents into 500-token chunks, embed them, take the top five by cosine similarity — is the weakest version of it, and it is what most teams ship.

Chunking is a modelling decision

Fixed-size chunks cut tables in half and separate headings from the text they govern. Chunk along the document's own structure instead: sections, clauses, list items. Keep the heading trail in the chunk so a retrieved fragment still says what it belongs to.

Hybrid search beats embeddings alone

Vector search is bad at exact identifiers — part numbers, error codes, policy names — precisely the terms users type. Run keyword search alongside it and fuse the rankings. The extra query costs a few milliseconds and removes a whole category of misses.

Rerank before you generate

Retrieve twenty candidates, rerank them with a cross-encoder, pass the best four to the model. Retrieval recall and prompt precision are different problems and deserve different stages.

Answer with citations or refuse

Require the model to ground every claim in a retrieved passage, and to say plainly when the corpus does not cover the question. A system that says "I don't have that" is worth far more than one that improvises.

  • Structure-aware chunking with heading context
  • Hybrid keyword + vector retrieval, fused
  • Cross-encoder reranking before generation
  • Mandatory citations and an explicit refusal path
  • A golden question set you re-run on every corpus change

The last one matters most. Corpora drift, documents get replaced, and yesterday's good answer quietly becomes today's wrong one.

Ishtiyaq Khan

Founder & AI Engineer

Builds production AI systems at Deep Tensors — retrieval pipelines, agent infrastructure, and the unglamorous evaluation work that keeps them honest.

Building something like this?

We help teams take AI systems from prototype to production — evaluation, infrastructure, and the interface around it.

Talk to us

Keep reading

AI EngineeringLLMs2 min

Why most AI agents fail in production

The demo works, the pilot stalls, the rollout quietly dies. Four failure modes we see in almost every agent project — and what a system that survives contact with real users looks like.

Ishtiyaq KhanJul 28, 2026
AI EngineeringComputer Vision1 min

Computer vision on the factory floor: six lessons

Lighting changes, cameras drift, and the operators will move the mount. What we learned deploying defect detection into a plant that runs three shifts a day.

Deep Tensors TeamJun 30, 2026