π€πβ¬οΈβ 12-Factor Agents: Patterns of reliable LLM applicationsΒ βΒ Dex Horthy, HumanLayer
ππ Human Notes
- π€ Focused prompt β β quality response
- π€ Strength: π£οΈ natural language β βοΈ JSON
- π Context Engineering is everything
- βοΈ Prompt
- π§ Memory
- π RAG
- β³ History
- π§± Structured Output
- π― Prefer small, focused agents
- β‘οΈ Agents should be stateless
π€ AI Summary
The video discusses several challenges and issues related to building reliable AI agents π€ and LLM applications, drawing parallels to traditional software engineering principles.
- β οΈ Difficulty in achieving high quality with agents [00:45]: Itβs challenging to get agents beyond 70-80% functionality π, often requiring deep dives π€Ώ into call stacks and prompt engineering.
- βοΈ Over-engineering with agents [01:00]: Not every problem requires an agent π€; some can be solved with simpler scripts π.
- π Lack of βagenticβ behavior in production agents [01:54]: Many production agents function more like traditional software π» than truly βagenticβ systems.
- β³ Challenges with long context windows [02:27]: The reliability and quality of results π decrease significantly with longer LLM context windows.
- β οΈ Tool use being βharmfulβ (in a specific context) [04:26]: The abstraction of βtool useβ as a magical interaction β¨ makes it harder; it should be viewed as an LLM outputting JSON π» processed by deterministic code.
- π Naive agent loop limitations [06:21]: Simple agent loops donβt work well for longer workflows π due to context window issues.
- π Blindly adding errors to context [10:54]: Adding full error messages β οΈ or stack traces to the context can cause the agent to spin out or get stuck.
- π€ Avoiding the choice between tool call and human message [12:25]: Builders often avoid deciding whether an agentβs output should be a tool call or a message π¬ to a human, leading to less effective interactions.
- π±οΈ Users needing to open multiple tabs for agents [12:13]: The current user experience often requires interacting with different agents across various tabs π, highlighting a need for agents to be accessible through common communication channels π¬.
- ποΈ Frameworks abstracting away hard AI parts [15:48]: Current frameworks often hide complex AI aspects of agent building π§±, when they should instead handle other hard parts, allowing developers to focus on critical AI elements.
π Book Recommendations
- π€βοΈπ Designing Machine Learning Systems: An Iterative Process for Production-Ready Applications by Chip Huyen: This book covers the entire lifecycle π of machine learning systems, including deployment, monitoring, and maintenance, which is relevant to the challenges of building reliable AI agents.
- π π»βοΈ Software Engineering at Google: Lessons Learned from Programming Over Time by Titus Winters, Tom Manshreck, and Hyrum Wright: Given the videoβs parallels to traditional software engineering principles π», this book offers insights into building robust πͺ and scalable software, which can be applied to AI development.
- π βBuilding Intelligent Agents: A Tutorialβ by Michael Wooldridge: For a more theoretical understanding of intelligent agents π€, this book provides a good foundation ποΈ.
- π£οΈπ» Natural Language Processing with Transformers by Lewis Tunstall, Leandro von Werra, and Thomas Wolf: To delve deeper into LLMs and their applications π€, this book provides practical guidance π§ on working with transformer models.
π¦ Tweet
π€πβ¬οΈβ 12-Factor Agents: Patterns of reliable LLM applications - @dexhorthy, @humanlayer_dev
β Bryan Grounds (@bagrounds) July 12, 2025
π€ AI Agents | π οΈ Tool Use | βοΈ Software Engineering | π¬ Human Interaction | π Error Handling | β±οΈ Context Window | π Prompt Engineering@aiDotEngineerhttps://t.co/SFlvXWdD4Y