By Sagar Shankaran, Founder of CallSphere
An end-to-end walkthrough of shipping contextual retrieval RAG on Claude — eval set, contextual chunks, hybrid search, and a confidence-gated launch.
Key takeaways
Abstract advice about contextual retrieval is easy to nod at and hard to apply. So this post follows one realistic build from start to finish: a mid-sized SaaS support team whose plain-RAG help bot kept answering with the wrong plan's billing rules, and how they rebuilt it on contextual retrieval with Claude into something they actually trusted to face customers. The shape of the problem is common; the specific decisions are where the lessons live. Every choice below is one a real team has to make, with the tradeoffs called out.
The team's existing help bot chunked every doc into 500-token slices and embedded them directly. A customer on the Growth plan would ask about overage charges and get the Enterprise plan's rules, because the chunk that said "overage is billed at the standard rate after 10,000 units" never mentioned which plan it belonged to. The embedding had no way to know. Worse, the bot gave no citation, so support agents could not tell when it was wrong until a customer complained. Trust collapsed, and agents started telling customers to ignore it.
The root cause was textbook context loss: chunks that are meaningful inside a document become ambiguous once isolated. That is exactly the failure contextual retrieval addresses. But the team resisted the urge to start coding. The first decision — and the right one — was to build a way to measure the problem before touching the pipeline.
It is worth pausing on why this failure was so corrosive. A bot that is obviously broken gets ignored and replaced. A bot that is right most of the time but wrong about billing — the one topic where a wrong answer costs the company money and trust — is worse, because people half-rely on it. The team's real goal was not a higher accuracy number in the abstract; it was to earn back enough trust that support agents would stop overriding the bot by reflex. That framing shaped every later decision toward traceability over cleverness.
Before any reindexing, an engineer pulled 180 real tickets where the old bot had answered wrong, plus 120 it had gotten right, and for each wrote the question and the IDs of the chunks that should have been retrieved. This became the evaluation set. It is unglamorous work, and it is the highest-leverage thing the team did, because every later change could now be judged: did retrieval recall on these 300 cases go up or down? The flow they built around this set looked like this.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
flowchart TD
A["Real failed tickets"] --> B["Build eval set: query + gold chunks"]
B --> C["Re-chunk & contextualize docs"]
C --> D["Hybrid index: dense + BM25"]
D --> E["Rerank top results"]
E --> F{"Recall up on eval set?"}
F -->|No| C
F -->|Yes| G["Ship behind confidence gate"]
The loop on the left is the whole method: change the pipeline, measure against the gold set, and only ship when the number moves the right way. Without box B, every later step would have been guesswork dressed up as progress.
Next they reindexed. For each chunk, a Claude Haiku call generated a one-sentence situating context using the full document as a cached prefix, so the document was paid for once across all its chunks. The contextualized chunk that used to read "overage is billed at the standard rate after 10,000 units" now read, prefixed: "In the Growth plan billing section, overage on the Growth plan is billed at the standard rate after 10,000 API units." That single sentence is what made the chunk retrievable for a Growth-plan question.
The retrieval call itself became a tool the Claude agent invokes, so it could reformulate and retry. The tool definition looked like this:
{
"name": "search_docs",
"description": "Search support docs. Returns chunks with situating context, source doc, plan, and a relevance score. Re-query with a refined phrase if results are weak.",
"input_schema": {
"type": "object",
"properties": {
"query": {"type": "string"},
"plan": {"type": "string", "description": "customer plan to filter by"}
},
"required": ["query"]
}
}
Because the tool exposed a plan filter and returned the relevance score, the agent could narrow to the customer's plan and decide whether the results were strong enough to answer on. That is the difference between single-shot RAG and agentic retrieval: the agent participates in getting good context, rather than accepting whatever the first lookup returns.
Embeddings alone still missed exact identifiers — error codes, plan SKUs, API limit numbers — because semantic similarity blurs precise tokens. Adding a BM25 keyword index in parallel caught those, and a reranking pass over the combined candidates ordered them by true relevance. The before-and-after on the eval set is what convinced leadership.
| Configuration | Top-5 retrieval recall | Wrong-plan answers |
|---|---|---|
| Plain RAG (baseline) | Low | Frequent |
| + Contextual chunks | Much higher | Rare |
| + Hybrid + rerank | Highest | Near zero on eval set |
The numbers are kept qualitative here because every corpus differs, but the ordering is robust and repeatable: contextual chunks give the biggest single jump, and hybrid plus rerank closes the gap on exact-match queries that embeddings fumble. The team did not need a different vector database or a larger model — they needed better context and a second retrieval path.
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
Rather than flipping the bot to fully autonomous, they shipped it with three outcomes: if retrieval confidence was high, the agent answered with a citation to the source doc and plan; if medium, it answered but flagged for a human agent to confirm; if low, it asked a clarifying question or handed off. This made the launch safe. Support agents saw citations, could verify in one click, and trust returned. Over the following weeks the high-confidence path widened as the eval set grew and the index improved.
For a single corpus, a small team can reach a measurable improvement in two to four weeks. The eval set takes a few days, contextual reindexing and hybrid retrieval take about a week, and the rest is the confidence gate and rollout. The slow part is discipline, not difficulty.
No. The wins came from contextual chunks, a parallel keyword index, and reranking — all of which most existing stacks support. Swapping databases is rarely the lever; better context and a second retrieval path almost always are.
Because real questions are messy. As a tool, the agent can filter by plan, judge whether results are strong, and re-query with a better phrase when they are weak. A fixed single lookup accepts whatever it gets, which is exactly how the original bot failed.
The before-and-after recall on the eval set, plus citations that let support agents verify answers in one click. Concrete, traceable improvement on real failed tickets is far more persuasive than a demo, and it is what rebuilt trust internally.
CallSphere takes this same build pattern to voice and chat — agents that retrieve the right plan, account, or policy mid-conversation and cite it back. See a working version at callsphere.ai.
Source & attribution: This is an independent, original explainer inspired by Anthropic's coverage on the Claude blog. Claude, Claude Code, Claude Cowork, Claude Opus, and the Model Context Protocol are products and trademarks of Anthropic. CallSphere is not affiliated with or endorsed by Anthropic.

Written by
Sagar Shankaran· Founder, CallSphere
LinkedInSagar Shankaran is the founder of CallSphere, where he builds production AI voice and chat agents deployed across healthcare, hospitality, real estate, and home services. He writes about agentic AI, LLM engineering, and shipping voice agents that handle real calls in production.
See how AI voice agents work for your industry. Live demo available -- no signup required.
Anthropic's Claude Fable 5 and Mythos 5 explained: pricing, availability, frontier benchmarks, the dual-model safeguard architecture, and what they mean for AI agents.
Where Claude Code, MCP, and multi-agent systems are taking GTM engineering next, and how to prepare your team now for standing and multi-agent workflows.
Where Claude Cowork and the Claude agent ecosystem are heading next — standing agents, MCP, skills as a moat — and the concrete moves to prepare your team now.
The metrics, leading signals, and anti-metrics that prove Claude Cowork is working — acceptance rate, time-to-outcome, and why usage counts mislead.
Shipping an agentic GTM workflow is easy; proving it works is hard. The metrics, signals, and eval loops that show a Claude Code rebuild is paying off.
A realistic end-to-end Claude Cowork use case: a quarterly vendor-spend review from vague ask to shipped deliverable, with every agentic step shown.
© 2026 CallSphere Inc. All rights reserved.
Made within San Francisco
Watch how CallSphere handles real customer calls, schedules appointments, and processes payments — live.
Try Live DemoBook a DemoCalculate Your ROI