Skip to content

Conversation

Kunal-code-max
Copy link

12-Factor Agents - Principles for building reliable LLM applications
In the spirit of 12 Factor Apps

What are the principles we can use to build LLM-powered software that is actually good enough to put in the hands of production customers?
Welcome to 12-factor agents.

The Short Version: The 12 Factors
Even if LLMs continue to get exponentially more powerful, there will be core engineering techniques that make LLM-powered software more reliable, more scalable, and easier to maintain.

How We Got Here: A Brief History of Software

Factor 1: Natural Language to Tool Calls

Factor 2: Own your prompts

Factor 3: Own your context window

Factor 4: Tools are just structured outputs

Factor 5: Unify execution state and business state

Factor 6: Launch/Pause/Resume with simple APIs

Factor 7: Contact humans with tool calls

Factor 8: Own your control flow

Factor 9: Compact Errors into Context Window

Factor 10: Small, Focused Agents

Factor 11: Trigger from anywhere, meet users where they are

Factor 12: Make your agent a stateless reducer

Why 12-Factor Agents?
After working with many AI builders and founders, one pattern stood out:

The fastest way to get high-quality LLM-powered software in production is not through full agent frameworks, but by modularly integrating agentic principles into existing systems.

Design Patterns for Great LLM Applications
The key insight: modular patterns from agent architectures can massively improve quality and maintainability without requiring wholesale rewrites.

Honorable Mentions
Factor 13: Pre-fetch all the context you might need

Related Concepts and Resources
12 Factor Apps

Building Effective Agents (Anthropic)

Schema Aligned Parsing

Function Calling vs Structured Outputs vs JSON Mode

Ownership
Institution: KIET College
Owner: Kunal Prajapati

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Atharva-Kanherkar
Copy link

came from @dexhorthy's twitter post, this is completely hilarious

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants