# Why More Context Makes Your Agent Dumber and What to Do About It — Nupur Sharma, Qodo
<!--
ref: @content/youtube/aie/2026-06-08-why-more-context-makes-your-agent-dumber
version: 3
updated_at: 2026-10-31T20:07:01.398Z
-->

Nupur Sharma (AI Engineer, 2026-06-08): Sharma's argument is that context ceased to be the scarce resource and became the failure mode.

*Synthesized from Nupur Sharma on AI Engineer, 2026-06-08.*

Nupur Sharma works on agentic code review at Qodo, coming from a DevSecOps background — a world where pipelines either run or crash and you fix them — into one where nothing is deterministic.

## Core Thesis

Sharma's argument is that context ceased to be the scarce resource and became the failure mode. Models now accept enormous dumps, but attention within that dump follows a **U curve**: the opening instruction and the most recent input get weight, and everything in the middle is effectively discarded. So the engineering job is no longer collecting context — it is deciding what reaches which agent, and the architecture that follows is many narrow specialist agents fed curated slices, reconciled by a judge.

## Key Insights

- The evolution she traces has three stages, each solving the prior stage's problem and creating a new one. **Static prompts** in a 4K window put the burden on the human to pick the right inputs, so wrong inputs meant wrong results. **Agentic workflows** gave the model search tools, which produced loops where the tool has no stopping condition and keeps deciding it needs more input. **Multi-agent systems** distributed the work, and produced clashes between agents holding incompatible understandings.
- The U curve is Qodo's own benchmarked finding, not a citation. Asked directly how she knows, Sharma says they instrument it: feed known context to the review agents and check whether it shows up in the output. What survives is the initial goal and whatever arrives last; middle-position material — a Jira MCP's contents, for instance — gets purged as the model tries to make sense of the whole on its own.
- **Context engines are bouncers**, not databases — search plus ranking logic that tells a fast-moving request what matters. They are worth building for a large messy codebase, but indexing takes moderate effort and **scaling is the failure point: at 600 or 700 repositories the mapping and indexing slow down and become unpredictable**. Her caveat is that unless building context engines is your actual business, cheaper alternatives usually win.
- Four alternatives, each with an explicit cost profile:
  - **Hierarchical summarization** — a summary per file and per folder that agents read before deciding what to open. Cost: heavy LLM processing up front, re-run on every file creation or change.
  - **Knowledge graph** — a graph DB of dependencies. Complex, and the developer input required to build it is very high, but it works exceptionally well when one file's change propagates through others or when dependencies span multiple repos.
  - **Iterative retrieval** — an index rather than a summary, functioning like a library card: here is the topic, go read deeper if it's relevant. Sharma's default recommendation for teams building agents for their own processes rather than as a product, because developer input is low and results are good; the cost lands in inference.
  - **Self-correction with a critic node** — the critic checks the result against the original goal and triggers a retry when context has been lost. Adds latency from the extra agent runs, but requires almost no up-front developer investment.
- **The orchestration paradox**: smarter models spend their tokens choosing a method instead of executing one. Sharma's example is Opus, which will interrogate its own approach repeatedly, hop between methods, and burn most of the API budget on deciding how to do the task rather than doing it.
- **The 80/20 hybrid** is her most useful fix. Give the frontier reasoning model free rein over the 80% that is genuinely exploratory — discovery, tool selection, planning — and put **hard deterministic gates on the 20%** that is validation, summarization, and final decision-making, where the shape is "if I get X, I want Y." The 20% does not need a high-reasoning model: a critic node isn't researching, it is checking a result against a stated goal.
- Bound the 80% explicitly. Two mechanisms she cites teams using: a **counter that forces acceptance of the last result after four or five iterations**, or a **timeout that takes whatever decision the agent held at five minutes** and revisits only if the result is bad.
- The split by task type is concrete: "what should I look for next, given this result" belongs to the dynamic 80% models; "given everything the 80% found, what is the right answer for this user" belongs to the constrained 20%.
- **One big agent with a big window loses tasks silently.** Give an agent four jobs and it commonly focuses on two — you get excellent results on those, and the other two vanish mid-run with no error.
- **Mixture of agents plus a judge.** Specialist agents each excel narrowly, but their outputs don't automatically cohere. Sharma's illustration: separate agents booking a vacation return a hotel in Greece and a flight from Amsterdam to Portugal — each individually optimal, jointly nonsense. The judge agent's job is reconciling the set into one coherent answer.
- **Qodo's PR review architecture**, as described: a context collector gathers from the PR, the context engine, and connected tools, then *bifurcates* that context and routes only the relevant slice to each specialist — a security agent hunting flaws, a code-diff agent, an agent pulling Jira issues. A judge agent then takes the combined findings, can go back to the context engine and the PR for more, and decides how many of the ten or fifteen raised items are actually relevant to surface. LangChain sits underneath as the inter-agent plumbing — results are collected and composed into the next agent's prompt, with a dedicated agent for composing that refined prompt when there are many inputs.
- **Calibration is what makes review outputs organization-specific.** An LLM seeing the same Java framework from healthcare, retail, and finance has no idea which conventions matter to you. Qodo supplies two channels: **indexed PR history** (was something like this flagged before, and did the developer act on it) and a **web portal where architects and compliance staff upload guidelines** that an agent validates against. PR history feeds the context twice — once to the specialist agents and once to the judge, so the judge can weigh a finding against how your reviewers and developers previously responded to the same thing.
- A questioner pressed the obvious weakness: specialists that each see only their slice have no whole-system view, which is fine for lint and test coverage but poor for architecture decisions that trade off against security. Sharma's answer is that this division already existed among humans — a senior engineer who knows the codebase, a security specialist watching for hardcoded API keys and SQL injection, an auditor asking whether changes are logged for ISO or SOC 2 — and the guidelines portal is how each specialist's standard gets encoded.
- **Feedback weighting**: every time a developer accepts a suggestion it gains weight for next time; rejections lose weight. The severity taxonomy (error vs. recommendation) also adds weight. Critically, **rules and bugs are weighted differently** — something submitted as a rule surfaces regardless of preference, while a bug the reviewer has declined ten times gets down-weighted. This is what stops "we have always hardcoded our API keys" from being learned as a norm.
- The honest limit Sharma states: an organization that declines to supply rules or guidelines gets out-of-the-box behavior and should not expect findings specific to how it works, beyond whatever PR history can infer.

## Actionable Takeaways

1. Stop dumping and start routing. Assume material in the middle of a long context is not read; put the goal at the front, the decisive input last, and drop everything you cannot justify.
2. Benchmark your own U curve — inject known facts at known positions in the context you actually send and check whether they influence the output. Don't take the window size as the working capacity.
3. Pick your retrieval strategy by input cost, not sophistication: iterative retrieval (library-card index) if you're building for your own team; knowledge graph only when cross-file or cross-repo dependency chains are the problem; hierarchical summarization if you can afford re-summarizing on every file change; a context engine only if you have a large messy codebase and are prepared for indexing to degrade past a few hundred repos.
4. Split model spend 80/20: frontier reasoning models for discovery, tool selection, and planning; cheap deterministic models behind hard gates for validation, summarization, and final answer composition.
5. Put a hard stop on the exploratory phase — a 4-5 iteration counter or a 5-minute timeout that forces the last result forward — or the smartest model you own will spend its budget researching how to start.
6. Don't hand one agent four tasks. It will quietly complete two. Split into specialists scoped to one job each.
7. Add a judge agent whenever specialists produce independent outputs that must cohere, and give the judge the ability to go back to source for more context before it decides what to surface.
8. Feed calibration signals into the judge, not just the specialists: indexed PR history plus explicitly uploaded architecture and compliance guidelines, weighted up when developers accept a suggestion and down when they reject it.
9. Separate rules from findings. Rules surface unconditionally; findings are subject to acceptance weighting — otherwise repeated bad practice trains the system to stop objecting to it.

## Notable Quotes

> "Context is not a problem. Day by day the models are coming where you can dump a lot of context." — Nupur Sharma

> "Agents look at the starting point, end point and try to provide you the results." — Nupur Sharma

> "A context engine is like a bouncer." — Nupur Sharma

> "Instead of actually looking to solve the problem, they look for the method to solve the problem." — Nupur Sharma

> "The hotel is in Greece, the flight is from Amsterdam to Portugal, and everything just doesn't make sense." — Nupur Sharma

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*