We’ve built an AI agent that acts as a secondary expert for a given domain, making deep specialist knowledge readily available and preserved for anyone in an organization to access, share, and build upon. This is not a typical domain-specific agent. Its novelty comes from integrating two layers: A structured, auditable knowledge architecture separates what [...] Read More... The post An Organizational Second Brain: Building an AI That Learns From Experts appeared first on Engineering at Meta.
Restructuring an AI agent's instructions into modular workflow stages cut its token consumption by 80% while collapsing expert assessment times from days to minutes. 👇
At Meta, domain specialists were spending days manually researching repetitive compliance questions. Standard LLMs lacked internal company context, and standard RAG setups forced the model to re-derive organizational logic from raw documents on every single query. The process was slow, expensive, and prone to inconsistent conclusions.
Meta solved this by building an "organizational second brain" that explicitly separates what the company knows from how it reasons. Instead of fine-tuning model weights or writing massive system prompts, they codified institutional expertise into a structured graph of text files and execution recipes, governed by an automated improvement loop.
The system runs across a four-layer continuous architecture:
* Structured Knowledge Base: Meta pre-distilled implicit company knowledge into over 200 structured files. High-density positions and terminology live in a curated wiki, while sparse reference docs stay in standard RAG search. Every file declares its dependencies in YAML frontmatter, building a machine-readable dependency graph. * Composable Recipes: Facts and procedures are strictly decoupled. Knowledge files state organizational positions, while imperative "recipes" define multi-step analytical workflows. Because recipes load only the specific context required for a single stage, per-turn token usage dropped by ~80%. * Human Checkpoints: The agent surfaces intermediate reasoning at predefined checkpoints and escalates true ambiguities to human specialists, using expert feedback to guide the decision path. * Self-Improvement Flywheel: When an expert corrects an answer, an automated compiler diagnoses the root cause without model retraining. If the context already had the answer, it tags a recipe workflow bug; if not, it tags a knowledge gap. Sub-agents draft minimal file edits, a linter checks syntax, and an independent adversarial agent tests for introduced contradictions before a blind LLM judge validates the fix against a regression suite.
In six weeks of testing, Meta reduced complex assessment times from days to minutes with zero performance regressions. Domain experts now rate the agent's output as useful almost all the time, while every single human correction is automatically converted into a permanent regression test.
NayaRead shows a summary and links to the original article. The full article is hosted on engineering.fb.com.