# How to Generate Mergeable Code with a Context Engine — Peter Werry, Unblocked
<!--
ref: @content/youtube/aie/how-to-generate-mergeable-code-with-a-context-engine-peter-werry-unblocked
tags: [context engine, AI agents, organizational context, code review, token cost, pull requests, developer tooling]
version: 3
updated_at: 2026-11-24T04:29:55.646Z
-->

**[Watch on YouTube](https://www.youtube.com/watch?v=qdAkxLoYNI8)**

# How to Generate Mergeable Code with a Context Engine — Peter Werry, Unblocked

*Synthesized from Peter Werry's talk on AI Engineer, 2026-08-27.*

Peter Werry of Unblocked presents the talk and runs a live demo of his company's context engine; there is no host.

## Core Thesis
Peter Werry argues that AI agents behave like new hires who lose their working knowledge at the start of every task, so giving them access to code, wikis or MCP tools is not enough. Agents need an organizational context layer that connects code to the intent, conventions and past decisions that live in pull requests and Slack, so that the work they produce is one a human can merge.

## Key Insights
- **Maturity curve.** He places most teams at levels four and five, where agents get MCP servers and skills; he points to level eight, "software factories," as where the field is heading.
- **Search satisfaction.** Agents, like radiologists who stop at the first visible finding, take the first plausible answer and miss the other relevant signals.
- **More context is not better context.** Loading the whole codebase and every architecture document into one window distracts the agent and wastes tokens, because a task needs a focused workflow.
- **The iceberg.** Agents can see the code, but not the real intention, team conventions, past decisions or Slack discussions behind it.
- **Cumulative cost.** In his demo, an optimization plan for the Source Mark calculator took about a minute and under one dollar with the context engine, and about two minutes and more spend without it. He argues the real value is that agents with the wrong early context rework their plans across later steps.
- **Sourced answers.** The engine cites the PRs, Slack threads, Notion pages and architecture documents it used, so a human can check the answer and correct the knowledge base.
- **Review and debugging.** A code-review agent uses best practices derived from PR history. In one case, a senior engineer's debugging session linked a drop in review issues to a model upgrade by correlating Slack and PR history, and the agent then drafted the fix.
- **Open-source pieces.** A document query engine runs against a GitHub repository, ingests historical pull requests and builds a schema from sampled documents for ad hoc questions. An engineering social graph maps review relationships to show expert coverage and gaps. A context engine simulator runs tasks with and without background context.
- **Client result.** He cites one client's figures of 50% fewer tokens, faster triage and better responses.

## Actionable Takeaways
1. Benchmark agent tasks with and without context on cost and time, since the gap compounds across steps.
2. Ingest historical pull requests and Slack decisions into a queryable store, not only the current code.
3. Require agents to list the sources they used, so reviewers can correct what the knowledge base gets wrong.
4. Map who reviews whose code to find expertise gaps before they become review bottlenecks.
5. Try the simulator approach first: run the same task with and without background context and compare outputs.

## Notable Quotes
> "They reset their knowledge every time they start a new task" — Peter Werry

> "Having access to information does not equate to understanding it." — Peter Werry

> "the real value of a context engine is not the initial cost in these short tasks, but the cumulative effect" — Peter Werry

---

*Related: `@knowledge/protocols/agent-to-human-handoff-context-preload` · `@content/youtube/zazencodes/build-your-own-ai-software-factory-with-claude-code` · `@content/youtube/yifan-bth/how-i-use-ai-git-to-code-3x-faster-real-dev-workflow-with-cursor` · `@content/youtube/yifan-bth/openai-codex-revolutionary-workflow-or-200-mistake` · `@content/youtube/yifan-bth/my-day-to-day-ai-dev-workflow-git-cursor-windsurf-cline-playwright-supabase-replit`*

---

*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).*