Twelve Factor Agents
Learn how to build production-ready AI agents using the twelve-factor methodology. We'll cover the core concepts and build a real agent from scratch.
Project details
Open in GitHubBuilding a 12 Factor Agent
In this episode, we dove deep on the theory behind 12 factor agents, before getting hands on and building one from scratch
For a full deep dive of the concepts and visuals, check out 12-factor-agents
How to use this code
There are a few ways to use the code in this folder, the final result is in final/ and the step by step walkthrough is in step-by-step/.
.
├── README.md
├── final
│  ├── baml_src
│  │  ├── agent.baml
│  │  └── ...
│  ├── src
│  │  ├── agent.ts
│  │  └── ...
│  ├── package-lock.json
│  ├── package.json
│  └── tsconfig.json
└── step-by-step
├── walkthrough
│  ├── 00-index.ts
│  ├── 01-agent.baml
│  ├── 01-agent.ts
│  ├── ...more files...
│  └── 10-server.ts
├── package-lock.json
├── package.json
├── tsconfig.json
└── walkthrough.md
final results
if you just want to run the final result of all our coding, use the code in final/
cd final
npm install
use the cli with
npx tsx src/index.ts 'hello world'
or run the server with
npx tsx src/server.ts
step by step walkthrough
if you want to walk through the code step by step, use the code in step-by-step/
cd step-by-step
npm install
then follow the steps in step-by-step/walkthrough.md one by one













































































