# Inside DeepWiki: How Cognition Builds Wikis for Devin at Scale
<!--
ref: @content/youtube/langchain/2026-08-21-inside-deepwiki-how-cognition-builds-wikis-for-devin-at-scale
tags: [codebase-documentation, context-engineering, agentic-search, repository-indexing, wiki-generation, coding-agents, evaluation]
version: 2
updated_at: 2026-11-21T20:19:47.703Z
-->

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


*Synthesized from Jacob, a Cognition engineer working on DeepWiki, in the talk on LangChain, 2026-08-21.*

Jacob introduces himself as working at Cognition on DeepWiki and other projects; the talk was given to a LangChain audience, and no host is named.

## Core Thesis
Jacob argues that generating a codebase wiki at enterprise scale is mainly a problem of structure rather than prose. The hardest step is the table of contents, because it decides what gets covered and how pages connect, so Cognition scores and clusters the codebase first and then lets an agent write the pages. He also argues that pre-computed context and live agentic search complement each other, and that context given to an agent must stay close to primary sources.

## Key Insights
- **Scale of the product:** DeepWiki began as an internal aid for Devin's main agent to understand the codebase, then shipped as a human-facing product. It later indexed the top 100k GitHub repos. Jacob cites about 1.4 million repositories indexed and over 20 million queries served, and says the wiki is now part of the context layer behind Devin.
- **Enterprise constraints:** some customers have a single repo of about 20 GB with tens of millions of lines, and some organizations have around 100k repos, with projects that touch about a thousand repos at once. Running a full agent swarm over that is impractical on cost and latency.
- **Pipeline:** heuristics score files and file connections using directory structure, a symbol graph, git history and runtime data where available. The scores feed codebase graphs and clustering to pick the systems a wiki should track. The team then writes the table of contents, and fans out individual pages that carry cross-page links, citations and a glossary.
- **Wiki v1 to v2:** v1 was built about a year before the talk and was tightly orchestrated around weaker models. v2 makes an agent the core. It starts from the same scored and clustered graph, and extra scaffolding (pulling more clusters or scoring more files) becomes a tool the agent calls. Using the same model family in the agentic design also produced cost savings, via better cache performance.
- **Quality measures:** wiki health is checked by coverage of the most active files, the depth and quality of citations, and how wiki size tracks repo size. Early versions capped wiki size on very large repos. The main signal, though, is whether the wiki is valuable to the end user, tested with large customers and senior engineers.
- **RAG versus agentic search:** Jacob calls the debate a false dichotomy. Indexing and pre-computation remain useful, and live sources such as MCP servers are added alongside them, all framed as augmenting the agent rather than replacing it.
- **Four context principles:** (1) primary sources, meaning code files and commits, which are ground truth; a wiki is derived, and each extra summarization layer loses meaning; (2) context poisoning, where a wrong pointer can actively hurt the agent, so omitting uncertain content is better; (3) path compression, where pre-supplied context saves the agent steps it could have taken itself; and (4) unknown unknowns, which he calls the biggest unsolved problem in context engineering.
- **Evaluation gap:** a recent eval, transcribed as "Frontier code," asks whether code would be accepted by an open-source maintainer in a PR, not just whether it is functionally correct. Jacob says Fable (as transcribed) gets around 50% on it, and he believes the information is present but agents are not yet using it.

## Actionable Takeaways
1. When building a wiki for a large codebase, score files and file connections first (directory structure, symbol graph, git history, runtime data), cluster them, and write the table of contents before generating any page.
2. Keep the table of contents fixed and build each page with that context, so pages can carry cross-page links and citations.
3. Give the agent a tool to pull extra clusters or score extra files on demand, instead of orchestrating every model call yourself.
4. Measure wiki quality with coverage of the most active files, citation depth and quality, and wiki-size-versus-repo-size correlation.
5. Treat code and commits as primary sources, and avoid stacking summaries on top of them, because each layer loses meaning.
6. Supply pre-computed context only where the agent would not find it cheaply, and drop it when it might point the agent the wrong way.

## Notable Quotes
> "the hardest part of creating a wiki is actually the table of contents" — Jacob
> "I think this is like by far like the biggest like unsolved like problem in terms of context engineering." — Jacob, on unknown unknowns

Transcript notes (names as transcribed, not corrected): the product is spelled "Deepuki," "dbuki," "Deepookie" and "deep.com" in the transcript, and the title gives "DeepWiki." The coding agent is spelled "Devon" in the transcript and "Devin" in the title. Other names heard in the talk ("Brace," "Karati," "Bruce," "Fable") are transcribed as spoken and not confirmed as spelled.

---

*Related: `@protocol/eval` · `@content/web/huggingface/2026-11-26-real2simlab-unified-platform` · `@content/youtube/sequoia/how-companies-are-building-their-own-intelligence-sonya-huang-sequoia-capital` · `@content/youtube/langchain/managed-deep-agents-conceptual-video` · `@content/youtube/cole-medin/google-s-agents-cli-the-cli-skills-combination-to-ship-ai-agents-easily`*

---

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