Chapter 6: Agent Architecture -- Resources¶
Curated resources for deeper exploration of topics covered in this chapter.
Frameworks from This Chapter¶
- 7 Failure Modes of Agents -- Hallucinated actions, scope creep, context loss, infinite loops, cascading failures, resource exhaustion, and stale data -- with mitigations for each.
Tools & Platforms¶
Agent Frameworks & Orchestration¶
- Temporal -- Workflow orchestration engine; used by Replit for agent task management serving 30M users.
- Claude Code -- Agentic coding tool with plan mode, subagents, and hooks for automated review checkpoints.
- Anthropic Agent SDK -- SDK for building production AI agents with structured tool calling.
- AutoMCP -- Automated MCP tool generation; 19 lines of fixes took success rate from 76.5% to 99.9%.
- Model Context Protocol (MCP) -- 1,000+ connectors for agent-tool integration; standard for chat and background agents.
Chat Agent Platforms¶
- Intercom Fin -- AI customer support agent; improved from 25% to 66% resolution rate through iterative design.
- Klarna AI Assistant -- Handled 2.3M conversations in first month; 700 FTE equivalent; $40M projected annual savings.
Background Agent Infrastructure¶
- Kafka -- Event streaming platform; Netflix processes billions of daily events for inter-service communication.
- RabbitMQ -- Message broker for async agent communication patterns.
Agent Monitoring & Safety¶
- Helicone -- LLM observability for tracking agent costs and performance.
- LangSmith -- Agent tracing and evaluation from LangChain.
Further Reading¶
- Klarna AI Assistant Press Release -- 2.3 million conversations in first month; response time from 11 minutes to under 2 minutes.
- Klarna CEO: "Gone Too Far with AI" -- Why Klarna reversed course and started hiring humans again after over-automating.
- Microsoft AI Red Team Taxonomy (April 2025) -- Formalized failure categories for AI agent systems.
- Air Canada Chatbot Ruling -- Court ruled Air Canada liable for chatbot's hallucinated bereavement fare policy; $812.02 total tribunal order.
- Chevrolet $1 Tahoe Incident -- Chatbot agreed to sell a Chevrolet Tahoe for $1 after prompt manipulation.
- Expanding Harvey's Model Offerings -- Harvey's multi-model routing for different legal subtasks.
Research & Data¶
- BoldDesk: Agent Market Analysis 2025 -- Conversational AI growing at 23% CAGR; autonomous AI agent market at 45% CAGR.
- Deloitte: State of Agentic AI 2025 -- 42% of companies abandoned AI initiatives; 46% scrapped proof-of-concepts.
- S&P Global: AI Adoption Mixed Outcomes -- 42% of companies abandoned most AI initiatives in 2025.
- Adversa AI Security Report -- 73% of enterprises experienced AI-related security breaches; 35% from prompt injection.
- Agent cost data: 73% of teams lack cost tracking; averaging 340% cost overruns on agent projects.
- Agent performance benchmarks: Chat agent p50 latency 1,850ms; p95 latency 4,200ms in production.
Community & Learning¶
- Replit Agent Documentation -- Temporal-based orchestration patterns serving 30M users; autonomy modes.
- Cursor AI Documentation -- Multi-model agent with PermissionOptions for access control.
The 2 Agent Types¶
| Characteristic | Chat Agents | Background Agents |
|---|---|---|
| Who waits | Human is waiting | No one is watching |
| Speed priority | Response in seconds | Throughput over latency |
| Error handling | Clarify and retry | Log, retry, alert |
| Autonomy | Human-in-the-loop | Autonomous with guardrails |
| Success metric | Satisfaction, resolution rate | Processing volume, accuracy |
| Example | Klarna support, Intercom Fin | Overnight data processing, report generation |
The 5-Question Agent Decision Framework¶
Before building an agent, ask: 1. Does the task require reasoning (not just rules)? 2. Does it vary significantly across instances? 3. Does it scale to justify the overhead? 4. Can it tolerate occasional errors? 5. Does it follow a stable process?
If you answer "no" to any of these, consider alternatives to agents.
Key Incidents Referenced¶
| Incident | Company | Failure Mode | Lesson |
|---|---|---|---|
| Hallucinated bereavement policy | Air Canada | Hallucinated Actions | Companies liable for AI agent statements |
| $1 Tahoe sale | Chevrolet | Scope Creep | Agents need bounded authority |
| 4,000 fake records + deleted DB | Replit | Cascading Failures | Background agents need dead man's switches |
| Over-automation reversal | Klarna | Wrong agent type | Chat tasks need human nuance; one agent doesn't fit all |