Retrieving Correct Code for Agentic SDLCs Presents Three Major Problems

Arpit Bhayani

Arpit Bhayani

Aug 30, 2026 • 2 min read


Every org is building an agentic SDLC in some capacity, but retrieving the right code is super tricky. Here are three big issues you will run into.

The first issue is that similarity is not relevance.

Ask an agent to fix a login bug, and retrieval (grep or indexed) will surface every file that mentions login: auth routes, session handling, middleware, and even a DB migration. All related, but none of these explain the actual failure.

The file that matters is usually reached in subsequent steps and by following the evidence, and not by retrieval ranking against the first sentence of the request.

The second issue is that capacity is not attention.

A bigger context window does not mean better understanding. There is the classic ‘Lost in the Middle’ problem with large contexts.

Codebases are full of “convincing distractions” - dead implementations, generated files, test doubles, parallel code paths. Every extra file that gets retrieved, especially if it is dead, can negatively impact inference.

The third issue is gullibility.

If we give our agent several plausible files upfront, it can build a confident theory around them, make changes in the wrong files, and form an incorrect understanding of the codebase.

By the way, these issues will always be there. You will have to navigate around them and build your agentic SDLC. Most of the solutions will be specific to how your org codes.

Hope this helps.

Arpit Bhayani

Principal Engineer II at Razorpay - building Agent Studio, Ex-staff engg at GCP Memorystore & Dataproc, Creator of DiceDB, ex-Amazon Fast Data, ex-Director of Engg. SRE and Data Engineering at Unacademy. I spark engineering curiosity through my no-fluff engineering videos on YouTube and my courses