JioHotstar recently ran a benchmark that compared six different code‑retrieval techniques for AI coding agents, leveraging the SWE suite, CodeScale Bench, and a proprietary question‑answering harness. The study surfaces clear performance differences that matter to anyone building or operating AI‑driven development tools.
Evaluation Overview
The benchmark exercised each approach against a mix of concrete and ambiguous coding tasks. By using both public (SWE, CodeScale) and internal workloads, the evaluation captures a realistic spread of query types that production agents encounter.
Structural Search vs Semantic Retrieval
Two patterns emerged:
- Structural search delivered higher accuracy on tasks with well‑defined code signatures or exact pattern matches.
- Semantic retrieval provided better coverage for vague or loosely specified requirements, where keyword matching alone fell short.
Both methods exhibited trade‑offs in token usage: structural queries tended to be shorter, while semantic queries often required larger prompt contexts to convey intent.
Architectural and Operational Implications
Choosing a retrieval strategy influences several engineering dimensions:
- Tool design: Agents may need to expose a switch or hybrid pipeline that selects the appropriate backend based on query confidence.
- Token budgeting: Semantic retrieval can increase token consumption, impacting cost and latency in LLM‑backed services.
- Integration complexity: Structural search often relies on indexed code patterns, whereas semantic retrieval may depend on embedding stores or vector databases.
Related CloudNinjas coverage: AI engineering.
What This Means For Practitioners
When integrating code retrieval into AI coding agents, consider the following actions:
- Classify incoming requests as concrete or ambiguous and route them to the matching retrieval engine.
- Monitor token usage per request to avoid unexpected cost spikes, especially for semantic paths.
- Validate that the chosen retrieval component aligns with your deployment model—indexed search for on‑premise builds, vector stores for cloud‑native stacks.
- Plan periodic re‑evaluation as codebases evolve, since the balance between structural and semantic effectiveness can shift over time.

