AI agents pose familiar system design challenges
A lot of AI agent tutorials focus on getting the model to respond or call a tool.
That's an interesting starting point. But what about the rest of the application?
When building our own AI agent, we want it to work through different interfaces: a CLI, chatbot, web app, and potentially MCP later.
We don't want to implement the classification logic three times, so we use a service layer.
We want to swap LLM providers (OpenAI, Anthropic, Grok) without changing business logic, so we use Python's Protocol.
We use Pydantic to validate the structure of model responses. It doesn't guarantee correctness, but it's an important guardrail when dealing with probabilistic LLMs.
And we develop in small increments, using pytest, ty, and ruff along the way. Tests verify behavior without calling a real model.
These patterns are like LEGO blocks. Individually simple, but together they make a system easier to extend, test, and maintain.
This is system design, and I think it's becoming an increasingly valuable skill in the AI era.
If you're building an agent, could you replace its interface, LLM provider, or storage backend without rewriting the business logic?
Where do you see the biggest challenges in designing your agents?
Bob
P.S. Want to learn this in a structured way? Juanjo Expósito and I just launched our self-paced Python Agentic AI course, where you build an expense agent using these patterns.
Special offer for newsletter readers: Use code AGENT25 for 25% off until Sunday, November 22.