12-factor-agents

humanlayer/12-factor-agents

Principles for building reliable LLM applications

24k
Stars
1.8k
Forks
26
Open issues
204
Watchers
TypeScript OtherLast pushed Sep 21, 2025

Overview

Repository containing guidelines and principles to develop robust software applications powered by Large Language Models (LLMs) suitable for production use.

Categories

Tags

Similar tools

Install

npm install 12-factor-agents

README

12-Factor Agents - Principles for building reliable LLM applications

In the spirit of 12 Factor Apps. The source for this project is public at https://github.com/humanlayer/12-factor-agents, and I welcome your feedback and contributions. Let's figure this out together!

[!TIP] Missed the AI Engineer World's Fair? Catch the talk here

Looking for Context Engineering? Jump straight to factor 3

Want to contribute to npx/uvx create-12-factor-agent - check out the discussion thread

Screenshot 2025-04-03 at 2 49 07 PM

Hi, I'm Dex. I've been hacking on AI agents for a while.

I've tried every agent framework out there, from the plug-and-play crew/langchains to the "minimalist" smolagents of the world to the "production grade" langraph, griptape, etc.

I've talked to a lot of really strong founders, in and out of YC, who are all building really impressive things with AI. Most of them are rolling the stack themselves. I don't see a lot of frameworks in production customer-facing agents.

I've been surprised to find that most of the products out there billing themselves as "AI Agents" are not all that agentic. A lot of them are mostly deterministic code, with LLM steps sprinkled in at just the right points to make the experience truly magical.

Agents, at least the good ones, don't follow the "here's your prompt, here's a bag of tools, loop until you hit the goal" pattern. Rather, they are comprised of mostly just software.

So, I set out to answer:

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. As every Chicago mayor since Daley has consistently plastered all over the city's major airports, we're glad you're here.

Special thanks to @iantbutler01, @tnm, @hellovai, @stantonk, @balanceiskey, @AdjectiveAllison, @pfbyjy, @a-churchill, and the SF MLOps community for early feedback on this guide.

The Short Version: The 12 Factors

Even if LLMs [continue to get exponentially more powerful](https://github.com/humanlayer/12-factor-agents/blob/main/content/factor-10-small-focused-agents.md#w