Skip to content
AI Primer
workflow

Developers use linked Markdown wikis to limit agent context

Developers describe wiki workflows that retrieve synthesized Markdown pages through layered indexes. One implementation creates concept pages only after two sources corroborate them and preserves links to raw documents.

4 min read
Developers use linked Markdown wikis to limit agent context
Developers use linked Markdown wikis to limit agent context

TL;DR

  • Concepts and entities need mentions in two distinct sources before earning dedicated pages in one developer's wiki.
  • Agents navigate indexes and read 1–3 synthesized pages before falling back to source material, following the query workflow.
  • Haiku answered within one point of Sonnet at roughly one-fifteenth the per-answer cost in the Anthropic benchmark highlighted by aibuilderclub_.

Decoding AI author Paul Iusztin keeps one wiki per project and deletes it when the project ends. Anthropic's Knowledge Wiki quickstart preserves conflicting claims and superseded figures, with provenance attached to every fact.

Two-source promotion

Iusztin puts a welcome brake on wiki sprawl in his ingestion walkthrough:

  1. Preserve the input. Copy each document into raw/, using its slug as an ID to skip duplicate ingestion.
  2. Extract a source page. An LLM writes a Markdown summary containing insights, entities, and concepts.
  3. Promote recurring topics. Create a dedicated entity or concept page only after two distinct sources mention it, synthesizing their information into one page.
  4. Update affected pages. Recompute the entities and concepts touched by new material without reprocessing the whole corpus.
  5. Generate navigation. Python builds indexes linking sources, concepts, and entities.

His implementation assigns counting to count_mentions.py and index generation to build_index_md.py. Both operate on page frontmatter, leaving extraction and synthesis to the model.

Index-first retrieval

The agent follows three retrieval layers in his querying workflow:

  1. Indexes: Read the root index.md and relevant sub-indexes to locate information.
  2. Synthesized pages: Open 1–3 entity or concept pages that combine material from multiple sources.
  3. Underlying evidence: Follow links to source pages and raw documents when the synthesized pages are insufficient.

The agent stops once it has enough information to answer. Sub-index entries contain titles and descriptions, allowing page selection without opening every candidate.

Managed Agents build workflow

Anthropic builds its wiki in one Managed Agents session using four worker roles:

  • Extractors: Read document batches in parallel and file entities, relationships, metrics, and open questions.
  • Resolver: Investigate the highest-priority gaps, answering with sources or marking them unresolvable.
  • Analyzers: Re-read each batch against the wiki, verify claims, recover omissions, and flag problems.
  • Organizer: Merge duplicates, repair links, complete the index, and rank escalations.

Build and query costs

Iusztin allocates the stronger model to reasoning across the compiled pages:

Anthropic assigns Haiku 5.5 to extraction, consolidation, and answering, while Sonnet 5.5 leads the build workflow. Its benchmark notebook reports 21 questions across 27 runs, graded by two judge models; the answer keys are not included in the repository.

| Answering setup | Score / 100, with 95% interval | Cost per answer |
| --- | --- | --- |
| Haiku 5.5, raw documents | 88.9 ± 0.6 | $0.0066 |
| Haiku 5.5, wiki | 91.9 ± 0.7 | $0.0056 |
| Sonnet 5.5, raw documents | 92.8 ± 0.5 | $0.086 |

The average benchmark build cost about $19. The recorded example, using eight SEC filings plus two marked synthetic documents, cost about $16 and took 23 minutes.

Anthropic estimates a break-even of about 240 questions when comparing Haiku answering from the wiki with Sonnet searching raw documents.

Human corrections

An organization-wide skill could capture nuances discovered during daily work and corrections supplied by humans, according to rishdotblog's proposal:

The author said in a follow-up that asking customers to build ontologies in 2023/24 had been painful, when models could not perform the work autonomously.

File latency and write collisions

Opening files sequentially adds latency, and scaling beyond 1,000 sources can become challenging, Iusztin says in his retrieval post. His tutorial describes spot-checking precision while leaving recall unmeasured.

Anthropic documents two additional implementation limits:

  • File size: Managed Agents memory-store files cap at 100 KB. Large entity pages and escalations.md need splitting into linked files.
  • Concurrent writes: Agents sometimes overwrite one another on shared pages. About 5% of the lines filed to the busiest entity page lose content.

Further reading

Discussion across the web

Where this story is being discussed, in original context.

On X· 7 threads
TL;DR3 posts
Two-source promotion1 post
Index-first retrieval1 post
Managed Agents build workflow1 post
Build and query costs1 post
Human corrections1 post
File latency and write collisions2 posts
Share on X