AI Engineer World's Fair 2026
How to Generate Mergeable Code with a Context Engine — Peter Werry, Unblocked
Loading slides…
Read the talk
How to Generate Mergeable Code with a Context Engine
Peter Werry explains why coding agents need selected organizational knowledge—not merely repository access—and demonstrates how Unblocked connects code, decisions, review history, and expertise to improve planning and debugging.
From a talk by Peter Werry
At a glance
Ideas worth remembering
Coding agents repeatedly rediscover repository structure, testing practices, deployment conventions, and organizational history because each task begins without the accumulated knowledge of an experienced teammate.
Search access alone can produce “satisfaction of search”: the agent finds one plausible result and stops before discovering evidence that would change its plan.
Useful context is selected for the task and connects code with intent, conventions, past decisions, discussions, and architecture rationale. Dumping everything into a large context window can exceed capacity and distract the agent.
Sources make synthesized answers inspectable by humans and give coding agents direct references for deeper investigation.
The planning demo reports about one minute and a sub-dollar cost with Unblocked, versus about two minutes and higher cost without it. The more consequential proposed benefit is avoiding downstream loops caused by incomplete discovery and wrong assumptions.
Pull-request history can encode team-specific review practices, while expertise and review relationships can prioritize guidance and expose parts of the codebase with thin expert coverage.
The context layer agents keep losing
A context engine delivers organizational knowledge to both people and agents. Before coding agents, engineers assembled that knowledge themselves: they searched discussions and documents, read the codebase, documented architecture, and learned from incidents and outages. Those experiences produced the “battle scars” that explain why a system works as it does—not just what the current code says.
An agent starts from a harder position. Werry compares it to an expert software engineer joining the company for the first time on every task. General programming ability does not supply knowledge of this repository, its testing conventions, or its deployment process. Once the task ends, the newly discovered context effectively disappears, so the next task begins with another onboarding exercise.
He places this problem on an AI maturity curve that moves from autocomplete and editor assistance through organizational wikis, MCP-connected tools, skills, and eventually software factories. He puts many teams around stages four to five, where they recognize context as a bottleneck and are trying to make internal knowledge available to agents. More autonomous systems raise the stakes: an agent working without close supervision must find relevant facts that it does not already know to request.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Why search access and a huge prompt are insufficient
Attaching a wiki gives an agent somewhere to search, but it does not tell the agent what matters or when the search is complete. Werry borrows “satisfaction of search” from radiology: after finding one plausible indicator, a reader may stop and miss another finding that would change the diagnosis. A coding agent can make the same mistake by finding one apparently relevant page or code path and proceeding before it discovers a conflicting decision elsewhere.
Retrieving individual facts also leaves a synthesis problem. The agent must connect dependencies, architecture, and future plans to determine the scope of a change. A plausible document is not enough if it does not explain how those pieces constrain one another.
Putting everything into the context window fails differently. Werry argues that an organization can hold more relevant material than even a million-token window can contain, while irrelevant material distracts the agent and consumes time and tokens. The target is task-specific context: enough evidence to direct the work without filling the prompt with unrelated code and documents.
His iceberg model separates visible code from the knowledge underneath it. Agents can inspect and edit the code, but intent, team conventions, past decisions, Slack discussions, and architecture rationale may live elsewhere. Those submerged constraints are often the difference between code that merely compiles and a change that fits the organization.
The organizational-context iceberg
Read the diagram as text
- Visible code. visible — The implementation the agent can inspect and modify directly.
- Intent and conventions. organizational-context — The desired outcome and the team's established way of working.
- Past decisions and discussions. organizational-context — Earlier choices and Slack conversations that explain constraints.
- Architecture rationale and plans. organizational-context — Why dependencies fit together and how future direction scopes the work.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A generated architecture explanation that shows its work
The first live demonstration returns to the human reader. People remain accountable for what they merge, so they still need to understand a pull request and the architecture it changes. The demo asks Unblocked about an internal component called the Source Mark Engine.
The answer includes an architecture diagram synthesized from the current code and proposals for future architecture. It was not retrieving a diagram that already existed. It inferred a representation for this question, which makes provenance especially important: a generated explanation can be useful and still be partly wrong.
The attached sources let a person inspect the knowledge behind the answer and correct it. They also give an agent concrete places to continue investigating. “Show your work” is therefore more than a trust gesture; it creates a path from synthesis back to the underlying evidence.
Werry then moves the same question-answering behavior into Slack, where many engineering decisions happen. Unblocked can respond when it judges that it has a sufficiently useful answer, or a user can address it directly. The demonstration does not explain how that confidence decision is calculated, so selective participation remains a stated behavior rather than a fully specified mechanism.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The same optimization plan, with and without organizational context
The Source Mark Engine answer identifies optimization opportunities, which become the next experiment. Werry asks Claude Code to plan an optimization of the Source Mark calculator without Unblocked. The agent searches the repository, studies the algorithm, and produces a plan that he describes as reasonably good.
The second run adds Unblocked. This time, the plan incorporates pull requests discussing future improvements, Slack conversations, Notion material, and architecture documents. The response carries its sources into Claude Code, giving the coding agent specific references to inspect if it needs more detail rather than forcing it to rediscover the relevant trail.
For this planning demonstration, Werry reports a cost below one dollar and a task time of about one minute with Unblocked. Without it, the run took about two minutes and cost more. He explicitly says to ignore the displayed wall-clock duration for the run with Unblocked because its session had remained open for about an hour. These figures describe one planning demo; they do not establish a general benchmark or show that either plan was implemented and merged.
The larger claim is about downstream rework. Baseline discovery costs time, but incomplete discovery can also put the agent on the wrong plan or wrong assumptions. Each later step then inherits the mistake, eventually forcing the agent to revisit earlier work. The initial minute saved is small compared with avoiding repeated loops across a longer task.
Why missing context compounds
Read the diagram as text
- Optimization task. Plan an optimization for the Source Mark calculator.
- Repository discovery. without-context-engine — The baseline agent searches code and reconstructs how the algorithm works.
- Cross-source context. with-context-engine — Relevant PRs, Slack discussions, Notion material, and architecture documents are assembled with sources.
- Plan and assumptions. The agent chooses what should change and why.
- Later execution. Subsequent work proceeds using the selected plan.
- Corrective loop. without-context-engine — Wrong assumptions force the agent to return and repeat discovery or planning.
- Optimization task → Repository discovery: baseline path.
- Optimization task → Cross-source context: context-engine path.
- Repository discovery → Plan and assumptions: infers from discovered code.
- Cross-source context → Plan and assumptions: adds decisions and future intent.
- Plan and assumptions → Later execution: guides later work.
- Later execution → Corrective loop: wrong assumptions emerge.
- Corrective loop → Repository discovery: repeat discovery.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Turning review history and expertise into guidance
The code-review example treats organizational context as more than a collection of documents. Unblocked examines pull-request data and other sources, derives best practices associated with the codebase, and makes them available to a review agent. The intended result is guidance shaped by how this team has reviewed real changes.
In the demo, a senior engineer named Richie recognizes an automated comment as something he would say. Werry explains that the system had surfaced a comment Richie previously made. Seniority or expertise acts as a boosting signal, giving some historical guidance more prominence. The talk does not specify the scoring formula or explain how the system handles conflicting expert opinions.
A second example begins when Richie notices a sharp drop in the number of issues surfaced by the review agent. He investigates with Unblocked, reaches an approximate diagnosis, and asks it to fix the problem. Werry describes this cloud-agent behavior as an internal experiment rather than a generally established workflow.
The generated pull request ties its fix to earlier conversations. A change in model behavior had been associated with the drop, and Unblocked found the Slack thread where Richie had made that connection. The example demonstrates traceability from an observed regression through organizational history to a proposed fix. It does not establish the exact patch mechanics or provide a measured post-fix recovery.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Query history, map expertise, and compare task outcomes
Werry closes with two open-source components. The document query engine runs over a GitHub repository, ingests historical pull requests, samples those documents, and synthesizes a schema. Users can then issue questions through an agent chat. The talk does not detail the generated schema or the query-validation process, but the project turns repository history into structured, queryable material rather than relying only on similarity search.
The engineering social graph extracts a different kind of context: relationships among people. Connections indicate who reviews whose code, and clusters can produce team labels or show coverage across a codebase. Thin areas reveal where expert review may be missing. Werry says the context engine uses this graph itself, making review relationships both a map of organizational expertise and a retrieval signal.
Finally, the context engine simulator builds context for one task and runs that task with and without it. The design makes the comparison visible rather than asking users to accept a general claim about context quality. No direct URL is supplied in the recording; attendees receive it through a QR code.
Werry ends with a customer report of “50% fewer tokens, faster triage, better answers.” The recording does not provide the workload, sample size, or evaluation method behind that percentage, so it should be read as a customer-specific result rather than a general guarantee. The durable lesson is narrower: context engines are most valuable when organizational knowledge changes the plan, prevents a bad assumption, or points the agent toward evidence it would not have known to seek.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
From the talk
The product demonstrated in the talk for connecting code, conversations, issues, documentation, and organizational knowledge.
An open-source workshop project that turns natural-language questions into validated MongoDB aggregation pipelines over GitHub pull-request and issue data.
Further reading
The official AI Engineer read-along page with the recording, timestamped transcript, chapters, and summary.
- Peter WerryReference
AI Engineer’s speaker page for Werry, including this talk and related work on context engines.
Related talks
- Mergeable by default: Building the context engine to save time and tokens
A longer Unblocked session expands this talk’s ideas into conflict resolution, permission-aware synthesis, expert graphs, task memory, evaluation, and implementation details.
- Building agents is trivial now, context is the next frontier
Jeff Ng develops a closely related Unblocked example in which an agent proposes a change without knowing that the same setting previously caused an outage.
- No Vibes Allowed: Solving Hard Problems in Complex Codebases
Dex Horthy presents a complementary workflow for assembling compact research and planning artifacts before agents modify established codebases.
Full transcript
Loading transcript…