DO YOU NEED AN AGENT FRAMEWORK AT ALL?

Often, no. A while loop, a switch statement and a well-typed tool schema will take you further than the discourse suggests — and leave you with code you can debug.

2 MIN READ
By Alpaca Mango
Alpaca Mango technical archive cover art.
Alpaca Mango technical archive cover art.

Frequently, no. As we set out in What Is an AI Agent?, the core loop is four steps: read state, pick a tool, run it, append the result. That is a while loop and a switch statement. Everything a framework adds is scaffolding around it, and scaffolding you did not need is just indirection between you and the bug.

Write it yourself first#

Not permanently — as a way of finding out what you actually need. A hand- rolled loop takes an afternoon and teaches you exactly where the difficulty in your problem is. Then you can choose a framework because it solves that difficulty, rather than because it was the one with the best README.

The failure mode of choosing first is specific and common: you adopt the abstractions before you understand the problem, and spend the following month discovering which of them do not fit. By then the abstractions are load-bearing and removing them is a rewrite.

When a framework genuinely earns its place#

  • Durability. Checkpointing and resuming a long run is real engineering that you should not write twice. This is LangGraph's strongest single argument.
  • Observability. Tracing every step and replaying it is more valuable than any feature, and building it yourself is a project. See Genkit.
  • Structured output under pressure. Schema generation, validation and retry, done properly — Pydantic AI.
  • Genuine multi-agent coordination. Once you truly need isolated contexts and delegation, hand-rolling it stops being cheap.

Notice what is not on that list: tool calling, prompt templating, provider switching and conversation history. Those are a few dozen lines each, and writing them keeps them in your codebase where you can see them.

The middle path#

Adopt a framework for the one thing it is best at and keep the rest yours. Use MCP for integrations so no framework owns your connectors. Keep your prompts in your own files. Keep the tool implementations plain functions. The framework should be the part that is easiest to remove.

The honest summary#

Frameworks are worth it for durability, observability, validation and real multi-agent coordination. They are not worth it to avoid writing a loop. If you cannot name which of those four you are buying, you are probably buying indirection — start with the map in AI Agent Frameworks Compared and work backwards from the problem.