All work
01Retrieval / LLM Infrastructure

Teaching an LLM to read the right thing, fast.

Year
2025
Role
Architecture, retrieval design, evaluation harness
Timeline
2025 · insightopia.in
Stack
LangChain, Pinecone
0x
response relevance
<0ms
p95 retrieval
Stack
LangChainPineconeOpenAINext.js

Overview

A production-grade retrieval-augmented generation layer that grounds language-model answers in a company's own knowledge — turning a generic model into a domain expert without retraining it.

01

problem

The problem

Out-of-the-box LLM answers were confident and often wrong. The model had no access to internal context, so responses drifted, hallucinated, and couldn't cite a source. We needed grounded, traceable answers at interactive latency.

02

research

Research

Benchmarked chunking strategies, embedding models, and rerankers against a hand-labelled relevance set. Naive top-k similarity left too much noise in the context window.

  • Fixed-size vs. semantic chunking trade-offs
  • Embedding model recall vs. cost curves
  • Reranking lift measured against a gold set
03

strategy

Strategy

Treat retrieval as a pipeline, not a lookup: hybrid search to widen recall, a reranking pass to sharpen precision, then disciplined context assembly so the model reads the smallest sufficient set.

04

development

Development

Built an ingestion path that normalises, chunks, and embeds sources into Pinecone, with an evaluation harness that scores every change against the gold set so quality never regresses silently.

  • Hybrid (dense + keyword) retrieval
  • Cross-encoder reranking stage
  • Context budgeting before generation
  • Regression-tested retrieval quality
05

ai

AI integration

Context injection was tuned per query type, with guardrails that force citations and fall back gracefully when confidence is low — so the system says 'I don't know' instead of inventing an answer.

06

results

Results

Answer relevance improved roughly 3x against the evaluation set while staying under interactive latency, with every answer traceable to its source.

Key takeaways

01

Retrieval quality, not model size, was the lever that moved accuracy.

02

An evaluation harness turns 'feels better' into a number you can defend.

03

Grounded answers with citations beat fluent answers without them.