How nthangarajan/12-factor-agents works
This repository is a practical guide to building reliable LLM applications, with workshop code that evolves a calculator agent into a threaded service with human interaction. The runtime example accepts a message, runs an agent loop, stores thread state, and exposes status and response endpoints; the later example adds HumanLayer contact and webhook handling. The graph emphasizes those demonstrated stages and the documented agent-design capabilities. Evidence is limited to the README and sampled files; unsampled workshop implementations are not assumed to have identical wiring.
Main entry points: server.ts Thread API · src/agent.ts Tool-loop agent · src/agent.ts Approval agent · src/agent.ts Agent loop
Components 10
Agent progression
- Tool-loop agent
workshops/2025-05-17/sections/03-tool-loop/src/agent.ts - Approval agent
workshops/2025-05/sections/11-humanlayer-approval/src/agent.ts
Thread runtime
- Thread API
workshops/2025-05/final/src/server.ts - Agent loop
workshops/2025-05/final/src/agent.ts - Thread store
workshops/2025-05/final/src/state.ts
Human interaction
- HumanLayer
- Webhook example
workshops/2025-05/sections/final/src/server.ts
Other components
- User
- HTTP client
- Human reviewer
Connections 8
- HTTP client → Thread API: sends requests
workshops/2025-05/final/src/server.ts - Thread API → Agent loop: runs loop
workshops/2025-05/final/src/server.ts - Thread API → Thread store: reads and writes
workshops/2025-05/final/src/server.ts - User → Tool-loop agent: tries examples
README.md - User → Approval agent: tries approval flow
README.md - Thread API → HumanLayer: creates contact
- HumanLayer → Human reviewer: requests input
- HumanLayer → Webhook example: posts completion