Loading...
12-Factor Agent Methodology(12FA)
Production-ready methodology adapting 12-factor app principles for scalable, maintainable agent systems with comprehensive monitoring and evaluation.
๐ฏ 30-Second Overview
Pattern: Production-ready methodology adapting 12-factor app principles for scalable, maintainable agent systems
Why: Moves agents beyond 70-80% prototype reliability to production-grade systems with human-in-the-loop workflows
Key Insight: Most successful agents aren't the most 'agentic' โ they're well-engineered software systems leveraging LLMs for controlled transformations
โก Quick Implementation
The 12 Factors in Detail
JSON Extraction as Foundation
Core LLM superpower: converting natural language to structured data. The ability to take a string and turn it into JSON.
Own Your Prompts
Production quality requires hand-crafted prompts, not abstractions. Own your prompts to tweak token order and system/user roles as models change.
Manage Context Windows Explicitly
Don't blindly append; actively manage what the LLM sees. Own the context window, squeezing traces and error summaries for self-healing.
Tools Are Just JSON and Code
Demystify "tool use" as simple routing. Treat tools as structured JSON outputs validated through switch statements.
Own Your Control Flow
Agents = prompt + switch + context + loop. Keep control-flow in code with explicit OODA loops and convergence heuristics.
Stateless Agent Design
Enable pause/resume and horizontal scaling. Persist execution state for idempotent restarts.
Separate Business from Execution State
Different lifecycles, different needs. Expose launch/pause/resume endpoints for safe replay runs.
Contact Humans as First-Class Operations
Not an edge case, but core functionality. Route high-stakes steps to humans as first-class tool calls.
Meet Users Where They Are
Email, Slack, Discord โ multi-channel by design. Trigger agents from wherever users already work.
Small, Focused Agents Beat Monoliths
3-10 steps max for reliability. Build small, single-purpose agents instead of chatty monoliths.
Explicit Error Handling
Process errors intelligently, not blindly. Compact errors into the next prompt to close the feedback loop.
Find the Bleeding Edge
Engineer reliability where models almost succeed. Find what's at the boundary of model capability and make it reliable.
๐ Do's & Don'ts
๐ฆ When to Use
Use When
- โข Building production-ready AI agents for enterprise
- โข Scaling beyond 70-80% prototype functionality
- โข Need reliable, maintainable agent systems
- โข Require human-in-the-loop workflows
- โข Building multi-channel agent experiences
Avoid When
- โข Simple demos or proof-of-concept projects
- โข Single-use or throwaway agent tasks
- โข Research experiments without production requirements
- โข Cases where 70-80% reliability is sufficient
- โข Purely automated workflows without human oversight needs
๐ Key Metrics
๐ก Top Use Cases
References & Further Reading
Deepen your understanding with these curated resources
Contribute to this collection
Know a great resource? Submit a pull request to add it.
12-Factor Agent Methodology(12FA)
Production-ready methodology adapting 12-factor app principles for scalable, maintainable agent systems with comprehensive monitoring and evaluation.
๐ฏ 30-Second Overview
Pattern: Production-ready methodology adapting 12-factor app principles for scalable, maintainable agent systems
Why: Moves agents beyond 70-80% prototype reliability to production-grade systems with human-in-the-loop workflows
Key Insight: Most successful agents aren't the most 'agentic' โ they're well-engineered software systems leveraging LLMs for controlled transformations
โก Quick Implementation
The 12 Factors in Detail
JSON Extraction as Foundation
Core LLM superpower: converting natural language to structured data. The ability to take a string and turn it into JSON.
Own Your Prompts
Production quality requires hand-crafted prompts, not abstractions. Own your prompts to tweak token order and system/user roles as models change.
Manage Context Windows Explicitly
Don't blindly append; actively manage what the LLM sees. Own the context window, squeezing traces and error summaries for self-healing.
Tools Are Just JSON and Code
Demystify "tool use" as simple routing. Treat tools as structured JSON outputs validated through switch statements.
Own Your Control Flow
Agents = prompt + switch + context + loop. Keep control-flow in code with explicit OODA loops and convergence heuristics.
Stateless Agent Design
Enable pause/resume and horizontal scaling. Persist execution state for idempotent restarts.
Separate Business from Execution State
Different lifecycles, different needs. Expose launch/pause/resume endpoints for safe replay runs.
Contact Humans as First-Class Operations
Not an edge case, but core functionality. Route high-stakes steps to humans as first-class tool calls.
Meet Users Where They Are
Email, Slack, Discord โ multi-channel by design. Trigger agents from wherever users already work.
Small, Focused Agents Beat Monoliths
3-10 steps max for reliability. Build small, single-purpose agents instead of chatty monoliths.
Explicit Error Handling
Process errors intelligently, not blindly. Compact errors into the next prompt to close the feedback loop.
Find the Bleeding Edge
Engineer reliability where models almost succeed. Find what's at the boundary of model capability and make it reliable.
๐ Do's & Don'ts
๐ฆ When to Use
Use When
- โข Building production-ready AI agents for enterprise
- โข Scaling beyond 70-80% prototype functionality
- โข Need reliable, maintainable agent systems
- โข Require human-in-the-loop workflows
- โข Building multi-channel agent experiences
Avoid When
- โข Simple demos or proof-of-concept projects
- โข Single-use or throwaway agent tasks
- โข Research experiments without production requirements
- โข Cases where 70-80% reliability is sufficient
- โข Purely automated workflows without human oversight needs
๐ Key Metrics
๐ก Top Use Cases
References & Further Reading
Deepen your understanding with these curated resources
Contribute to this collection
Know a great resource? Submit a pull request to add it.