Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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