HeadlinesBriefing favicon HeadlinesBriefing.com

Metabase Builds 10 Custom AI Agents to Navigate 500K-Line Clojure Codebase

Hacker News •
×

Metabase tackled a classic scaling problem: managing a sprawling 500K-line Clojure backend with distinct subsystems. Traditional AI coding assistants quickly exhaust context windows exploring unfamiliar domains. The solution involved creating specialized subagents, each pre-loaded with deep knowledge of specific areas like the query processor or permissions system.

Each subagent file contains roughly 2,000-3,000 tokens of dense domain knowledge, organized as markdown documents with YAML frontmatter defining name, description, model selection, and memory persistence. The mbql-expert, for instance, understands the 68-stage middleware pipeline that compiles MBQL to SQL across 18 database dialects. These agents eliminate the 'context tax' when switching between domains.

Using the agents requires no special syntax—just mention the domain or @-mention directly. When debugging a Redshift join issue, the mbql-expert immediately reasons about relevant middleware stages rather than grepping blindly. Multiple agents can investigate in parallel without contaminating each other's context.

The approach demonstrates how AI tools can scale to enterprise codebases through specialization rather than raw power. By front-loading domain expertise into system prompts, teams can maintain velocity even as code complexity grows exponentially.