11factor.ts
1// 11factor.ai
2// A framework for production-grade AI agents
3
4export const framework = {
5 name: "The 11 Factors of Production-Grade AI Agents",
6 author: "Sandeep Mehta",
7 factors: 11,
8 status: "production-ready"
9}

Most AI agents work in demos and die in production. This framework is about the engineering that closes the gap.

# The 11 Factors

Everything you need to take AI systems from demo to production.

🔨BuildDesign & Development
01build

Model Serving Layer

Abstract model providers behind a unified serving layer for portability, failover, and cost optimization.

02build

Context Management

Design and manage the full context pipeline — system prompts, RAG, grounding, and context window strategy.

03build

Memory Management

Give AI systems structured short-term and long-term memory for context-aware interactions.

04build

Integrations (MCP)

Standardise how AI systems connect to external tools, APIs, and data sources.

RunProduction Operations
05run

Orchestration

Coordinate multiple AI components, agents, and workflows for complex task execution.

06run

Human in the Loop

Design clear escalation paths and approval workflows for high-stakes decisions.

07run

Rate Limits & Latency

Handle provider rate limits gracefully and optimise for acceptable response times.

08run

Cost Control

Monitor, budget, and optimise LLM spend with token tracking and model routing.

🛡️GovernRisk & Quality
09govern

Evaluation & Observability

Continuously measure, trace, and monitor AI system performance and behaviour.

10govern

Safety & Guardrails

Implement input/output filtering, content policies, and behavioural boundaries.

11govern

Reproducibility & Audit

Ensure AI behaviour can be replayed, audited, and explained for compliance.

stats.sh
$ echo $AI_PRODUCTION_RATE
5%
of AI use cases reach production — the rest die in pilot stage (MIT)

Most AI agents work in demos but fail in production. They hallucinate, they're expensive, they're impossible to debug, and they break in ways nobody predicted. The 11-Factor framework gives you the engineering discipline to build agents that actually ship.

SM

Sandeep Mehta

Founder of OyakoAI. Building multi-agent systems in production — 18 agents on a Mac mini. Previously in healthcare tech. Speaker on AI agents and the gap between demos and real-world deployment.