AI Agents for Documenting Tribal Knowledge in Large-Scale Data Pipelines

meta · Tech · 2026 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.2 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: AI coding assistants for large data pipelines

Meta’s agents lacked undocumented codebase knowledge across four repositories, three languages, and 4,100+ files.

Constraints:

Architecture

Meta built a pre-compute knowledge engine for AI coding assistants on a proprietary config-as-code data pipeline. A swarm of 50+ specialized agents maps repositories, analyzes modules, writes concise 25–35 line context files, runs multiple critic/fixer/upgrader/tester passes, builds routing/dependency lookups, and periodically refreshes/repairs the resulting knowledge layer. The generated context is model-agnostic, so future coding agents can navigate undocumented dependencies without re-discovering tribal knowledge every task.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  codebase-map["codebase-map"]
  explorer-agents["explorer-agents"]
  module-analysts["module-analysts"]
  context-writers["context-writers"]
  critic-agents["critic-agents"]
  fixers["fixers"]
  routing-upgraders["routing-upgraders"]
  prompt-testers["prompt-testers"]
  context-files["context-files"]
  maintenance-jobs["maintenance-jobs"]
  codebase-map --> explorer-agents
  explorer-agents --> module-analysts
  module-analysts --> context-writers
  context-writers --> critic-agents
  critic-agents --> fixers
  fixers --> context-files
  context-files --> routing-upgraders
  routing-upgraders --> prompt-testers
  context-files --> maintenance-jobs
  maintenance-jobs --> critic-agents
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
codebase-map Inventory of repositories, modules, and dependencies to be covered by context generation. explorer-agents, module-analysts
explorer-agents Map the codebase and identify module boundaries for downstream analysis. codebase-map, module-analysts
module-analysts Read files and answer the five module questions about behavior, modification, dependencies, and tribal knowledge. explorer-agents, context-writers
context-writers Generate concise context files from analyst findings. module-analysts, critic-agents
critic-agents Independently score and improve generated context through multiple quality-review rounds. context-writers, fixers, maintenance-jobs
fixers Apply corrections to context files and references found by critics. critic-agents, context-files
routing-upgraders Refine routing/dependency lookup so coding agents can find relevant context efficiently. context-files, prompt-testers
prompt-testers Validate prompts across personas and queries against the generated context layer. routing-upgraders, context-files
context-files The 59 concise, model-agnostic navigation guides encoding tribal knowledge and non-obvious patterns. fixers, routing-upgraders, maintenance-jobs
maintenance-jobs Periodic self-maintenance that validates paths, detects gaps, reruns critics, and repairs stale references. context-files, critic-agents

Data flow

Explorer agents first map the codebase. Module analysts read each file and answer five questions about configuration, modification patterns, failure-causing non-obvious patterns, cross-module dependencies, and buried tribal knowledge. Writers turn those answers into concise context files; critic agents score and improve them; fixers correct issues; routing upgraders build lookup paths; prompt testers validate personas and queries; scheduled maintenance later checks paths, gaps, critics, and stale references.

"Two explorer agents mapped the codebase, 

— article, stated "The five questions each analyst answered per module:

  1. What does this module configure?
  2. What are the common modification patterns?
  3. What are the non-obvious patterns that cause build failures?
  4. What are the cross-module dependencies?"
“Every few weeks, automated jobs periodically validate file paths, detect coverage gaps, re-run quality critics, and auto-fix stale references.”article, stated

Why this architecture

The architecture front-loads context discovery because coding agents were compiling subtly wrong code when they lacked undocumented domain constraints. Meta rejects encyclopedia-sized context in favor of actionable compass files and quality gates: concise context reduces tool calls, while independent critics and freshness checks prevent stale or hallucinated guidance from becoming worse than no context.

3 supporting quotes
“Without this context, agents would guess, explore, guess again and often produce code that compiled but was subtly wrong.”article, stated
“Follow “compass, not encyclopedia**.“ Keep context files to 25–35 lines. Actionable navigation beats exhaustive documentation.”article, stated
“Quality was non-negotiable: three rounds of independent critic agents improved scores from 3.65 to 4.20 out of 5.0, and all referenced file paths were verified with zero hallucinations.”article, stated

Models used: large-context-window model

Scale

Alternatives considered (roads not taken)

Let coding agents explore the proprietary codebase on demand for every task

Rejected because: Agents burned many tool calls, missed naming/dependency patterns, and produced subtly wrong code.

“Without context, agents burn 15–25 tool calls exploring, miss naming patterns, and produce subtly incorrect code. The cost of not providing context is measurably higher.”article, stated

Large exhaustive documentation files

Rejected because: The design principle was concise, actionable navigation rather than encyclopedia-like context.

“Follow “compass, not encyclopedia**.“ Keep context files to 25–35 lines. Actionable navigation beats exhaustive documentation.”article, stated

Patterns

context-compaction (context-engineering)

Agents distilled thousands of files into 59 concise context files that act as navigation guides.

“We fixed this by building a pre-compute engine: a swarm of 50+ specialized AI agents that systematically read every file and produced 59 concise context files encoding tribal knowledge that previously lived only in engineers’ heads.”article, stated

multi-agent-orchestration (documentation)

Specialized explorer, analyst, writer, critic, fixer, and upgrader agents divide the mapping work.

“* Two explorer agents mapped the codebase,”article, implied

Tradeoffs

How much context to precompute.

Chose concise compass files over exhaustive encyclopedia documentation.

Rationale: The approach prioritizes navigation guidance that reduces tool calls without overloading the context window.

“Each context file follows what we call “compass, not encyclopedia” principle – 25–35 lines (~1,000 tokens) with four sections:”article, stated

How much documentation context to generate for coding agents.

Chose Concise 25–35 line compass files with routing and quality gates. over Exhaustive encyclopedia-style context files or no precomputed context..

Rationale: Meta argues actionable navigation beats exhaustive docs and that absent context is measurably more expensive due to exploration and subtle mistakes.

“Follow “compass, not encyclopedia**.“ Keep context files to 25–35 lines. Actionable navigation beats exhaustive documentation.”article, stated
“Without context, agents burn 15–25 tool calls exploring, miss naming patterns, and produce subtly incorrect code. The cost of not providing context is measurably higher.”article, stated

Gotchas (what bit them)

Agents produced plausible but subtly wrong code without undocumented context.

Root cause: The pipeline’s config-as-code design spans registries, routing, DAGs, validation, generation, and automation scripts.

Resolution: Teach agents the codebase before exploration by precomputing a maintained context layer.

“Without this context, agents would guess, explore, guess again and often produce code that compiled but was subtly wrong.”article, stated

Precomputed context can become stale as code reviews and commits create new tribal knowledge.

Root cause: A static context layer decays unless it is refreshed against file paths, coverage gaps, and emerging patterns.

Resolution: Run automated refresh and validation jobs that detect stale references and newly forming patterns.

“We’re also investigating whether the automated refresh mechanism can detect not just stale context but emerging patterns and new tribal knowledge forming in recent code reviews and commits.”article, stated

Evaluation

Meta measured coverage, documented patterns, and tool-call reduction.

Metrics: 100% module coverage · 50+ non-obvious patterns · 40% fewer tool calls

“choices and relationships not immediately apparent from the code_, and preliminary tests show 40% fewer AI agent tool calls per task.”article, stated

Outcomes

Internal Meta pipeline case across 4,100+ files.

“The result: AI agents now have structured navigation guides for 100% of our code modules (up from 5%, covering all 4,100+ files across three repositories).”article, stated