You Probably Don’t Need an Agent Framework
Summary
Many LLM applications can be more reliably built using structured workflows rather than complex agent frameworks, according to a recent analysis. The article demonstrates prototyping an LLM workflow with plain Python, local functions, structured outputs, and the OpenAI Responses API, specifically using GPT-5.4-mini. This approach is exemplified by an "anomaly explanation" problem on the Iris dataset, where a perturbed sample is diagnosed by an LLM investigator gathering evidence via tools and an LLM explainer providing a final assessment. Key workflow ingredients include explicit control flow, role instructions (system prompts), prompt builders, and structured output schemas (e.g., Pydantic models). This method offers transparency, modularity, and deterministic control, contrasting with agents that suit highly open-ended problems, and frameworks that address production-level concerns like failure handling.
Key takeaway
For AI Engineers building LLM applications, prioritize designing explicit workflows over immediately adopting complex agent frameworks. This approach offers greater transparency and deterministic control, making your applications more reliable and easier to debug. You should define clear control flow, role instructions, prompt builders, and structured outputs using plain Python. Only consider agent frameworks when tackling truly open-ended problems or when production-level features like advanced failure handling become critical.
Key insights
Explicit LLM workflows offer more reliability and control than autonomous agents for many applications.
Principles
- Workflows provide transparency, modularity, and deterministic control flow.
- LLMs function best as reasoning engines within defined workflow steps.
- Structured outputs are crucial for robust inter-step communication.
Method
Design workflows with explicit control flow, role instructions, prompt builders, and structured outputs (e.g., Pydantic models) using plain Python and local functions.
In practice
- Prototype LLM applications with plain Python first.
- Define LLM output schemas using Pydantic models.
- Use local functions as tools for LLM-driven evidence gathering.
Topics
- LLM Workflows
- Agent Frameworks
- Structured Output
- Prompt Engineering
- OpenAI Responses API
- Pydantic
- Data Quality
Best for: AI Engineer, Machine Learning Engineer, Software Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Towards Data Science.