Building an Autonomous AI Analytics Agent for Enterprise Data Analysis
meta · Tech · 2026 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.4 (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: Enterprise analytics automation
Meta wanted an autonomous analytics agent that could perform routine data analysis by using analysts' existing query history, team knowledge, and live SQL execution while keeping answers transparent and verifiable.
Constraints:
- Meta's warehouse has millions of tables serving 70,000-plus employees.
- Without narrowing context, an agent can drown in irrelevant tables.
- Trustworthy analytics requires showing the SQL and evidence behind every number.
- Team-specific definitions, filters, and best practices live outside a single repository.
Architecture
Analytics Agent began as a devserver prototype that could execute SQL with colleague query-history context. In production, it seeds each user with personal query-history-derived domain context, indexes broader documentation and metadata, runs iterative SQL/reasoning loops, shows every SQL query behind surfaced data, and adds Cookbooks, Recipes, and Ingredients so teams can encode workflows, tool controls, semantic models, metric definitions, and business rules.
Diagram confidence: reconstructed (reconstructed from prose).
flowchart LR user[User] --> analytics-agent[Analytics Agent] personal-query-context[Personal Query Context] --> analytics-agent[Analytics Agent] knowledge-index[Knowledge Index] --> analytics-agent[Analytics Agent] cookbook-system[Cookbook System] --> analytics-agent[Analytics Agent] analytics-agent --> sql-execution[SQL Execution] sql-execution --> analytics-agent[Analytics Agent] analytics-agent --> thinking-ui[Thinking UI] thinking-ui --> user[User]
Components
| Component | Role | Interacts with |
|---|---|---|
User |
Data scientist, engineer, or non-data user asking analysis questions. | Analytics Agent |
Analytics Agent |
Autonomous agent that writes SQL, executes it, reasons over results, and answers transparently. | Personal Query Context, Knowledge Index, SQL Execution, Cookbook System, Thinking UI |
Personal Query Context |
Offline-derived model of the user's tables, query patterns, and analytical style. | Analytics Agent |
Knowledge Index |
Searchable documentation, warehouse metadata, pipeline source code, and semantic models. | Analytics Agent |
SQL Execution |
Tool loop that runs queries and returns real results. | Analytics Agent |
Cookbook System |
Cookbooks, Recipes, and Ingredients encoding team analytical practices. | Analytics Agent |
Thinking UI |
Shows planning, reasoning steps, and SQL queries for verification. | User, Analytics Agent |
Data flow
Offline pipelines process a user's query history into a bounded domain. At question time, the agent uses that personal context plus indexed documentation, metadata, source code, semantic models, Cookbooks, Recipes, and Ingredients to write SQL, execute it, inspect results, and iterate until it can answer with transparent SQL-backed evidence.
Why this architecture
Meta's key insight was that routine data analysis is repetitive within a person's domain. Personal query history narrows the table universe, while Cookbooks/Recipes/Ingredients let teams encode shared best practices. Transparent SQL output keeps users from blindly trusting nondeterministic answers.
Models used: Meta internal coding agent · LLM pipelines for query-history context
Scale
- Six months after the prototype, 77% of Meta data scientists and data engineers used Analytics Agent weekly.“Within weeks, there were hundreds of weekly active users. As momentum grew, a dedicated engineering team formed around the project. Six months later, 77% of Meta’s Data Scientists and Data Engineers use Analytics Agent on a weekly basis, along with roughly 5x as many users from non-data roles.”article, stated
- Meta's warehouse serves 70,000-plus employees.“Meta’s data warehouse serves 70,000+ employees building everything from VR headsets to Facebook Marketplace. Without narrowing the scope upfront, the agent would waste time sifting through irrelevant context and would be far more likely to land on the wrong tables entirely.”article, stated
- The agent had roughly 5x as many weekly users from non-data roles as data-scientist/data-engineer users.“Within weeks, there were hundreds of weekly active users. As momentum grew, a dedicated engineering team formed around the project. Six months later, 77% of Meta’s Data Scientists and Data Engineers use Analytics Agent on a weekly basis, along with roughly 5x as many users from non-data roles.”article, stated
- The team raised its adoption goal from 20% to 55% and still overshot it.“The team raised its adoption goal from 20% to 55% mid-half when growth exceeded expectations, and still overshot it. Each iteration made the next one faster, and each new user made the product better for everyone.”article, stated
Alternatives considered (roads not taken)
General search over the whole warehouse.
Rejected because: Millions of tables make the context too broad and error-prone.
Surface-level AI for SQL syntax and docs search.
Rejected because: The prototype showed value in closing the loop with SQL execution and iterative investigation.
Ask users to trust final answers.
Rejected because: Analytics requires verification of every number.
Patterns
agent-memory (personalization)
The agent uses personal query history as a shared memory of each analyst's domain.
tool-use-orchestration (analytics)
The agent writes and executes SQL, inspects results, and decides next steps.
structured-output-contract (knowledge)
Cookbooks, Recipes, and Ingredients structure team workflows, instructions, controls, and semantic definitions.
Tradeoffs
Context source
Chose Personal query history over Global schema search alone.
Rationale: History narrows the domain to the tables and patterns a person actually uses.
Trust model
Chose Transparent SQL and Thinking UI over Opaque final answers.
Rationale: Analytics users need to verify every data point.
Gotchas (what bit them)
An enterprise warehouse overwhelms a general agent.
Root cause: Millions of tables create too much irrelevant context.
Resolution: Construct a bounded domain from each analyst's query history.
Numbers without SQL are not trustworthy analytics.
Root cause: LLMs can be nondeterministic and confidently wrong.
Resolution: Show all SQL and reasoning steps so users can verify.
Evaluation
Meta evaluated through adoption, alpha/beta feedback, edge-case surfacing, successful real-world trials, transparent SQL verification, and adoption goals raised during growth.
Metrics: Weekly adoption · Edge cases found · Correct SQL execution · User feedback · Non-data user adoption · Goal attainment
Outcomes
- Analytics Agent moved from a weekend devserver prototype to production.
- Within six months it reached 77% weekly use among Meta data scientists and data engineers.
- Cookbooks, Recipes, and Ingredients turned team-specific analytical practice into reusable agent context.
The source reports 88% query reuse, 70,000-plus employees, 77% weekly DS/DE adoption, roughly 5x non-data users, and a 20% to 55% adoption-goal increase.