Deploying AI agents in production: hands-on lessons on tool design, multi-agent patterns, and open protocols like MCP and AG-UI.

AI Research
Agentic AI is the topic of 2026. But between an impressive demo and an AI agent that runs reliably in production lies a lot of engineering work. The demo takes a week – the reliability afterwards is the real task.
This post summarizes the patterns that have proven themselves in practice when building production agents – and the approaches that turn out to be dead ends. The running example is a conversational agent that creates, revises, and publishes surveys in dialogue.
A chatbot answers questions. An agent acts: it independently selects tools, executes multi-step tasks, and reacts to intermediate results. The formula is simple:
Agent = LLM + harness + tools
The harness is everything that surrounds and steers the language model: the system prompt, the execution loop, state management, and the guardrails. The user says: “Create a customer satisfaction survey with three questions” – and the agent plans, builds, shows a preview, and asks for confirmation on critical steps. The quality of an agent, however, emerges almost entirely outside the model: in the harness and in how the tools are designed. That is where the interesting decisions happen.
The obvious design is one single, powerful tool that accepts the entire object on every change. That scales poorly: for every small edit, the model has to reproduce the whole structure – costing time and tokens, and producing errors in places that were never meant to change.
What works instead is a hierarchy by depth of intervention:
| Intervention | Tool | Effect |
|---|---|---|
| Rephrase one question | targeted edit tool | minimal error surface |
| Change title or welcome text | dedicated meta tool | structure stays untouched |
| Add/remove questions | full update | only when truly structural |
The agent is instructed to always pick the smallest possible tool. The model cannot break anything the tool has no access to.
The second insight: safety rules belong in tool code, not in the prompt. If an agent tries to modify a published survey that already has real responses, the tool itself should refuse to execute and demand explicit confirmation from the user. The prompt can reinforce such rules – but only code makes them deterministic.
Can an agent objectively review its own output? No – its own conversation history acts as bias, and it tends to rubber-stamp its results. This is where a classic multi-agent pattern comes in: the quality check is itself a tool that internally spins up a second, fresh agent – with its own rubric and deliberately no access to the previous conversation:
@tool
def review(document_id):
reviewer = Agent(
system_prompt=REVIEW_RUBRIC, # its own evaluation rubric
# deliberately: no builder conversation history
)
return reviewer.structured_output(Review, load(document_id))
The reviewer sees only the result, not the process that produced it – and returns not a free-text verdict but structured findings with severity levels (critical, warning, suggestion) and a clear publish recommendation. That makes the review programmatically usable, for instance as a publishing gate.
A striking observation from practice: more complex architectures – orchestrators with sub-agents, swarms, routers – do work, but they are often harder to debug than they are useful. A few specialized agents with a clear division of labor regularly beat more complicated topologies on reliability and maintainability. The minimal topology that solves the problem wins.
An agent that lives in only one interface is a dead end. A sustainable architecture therefore strictly separates agent logic and interface – the agent itself knows nothing about the frontend and is connected through open protocols:
| Layer | Protocol / Example | Purpose |
|---|---|---|
| Agent ↔ User Interaction | AG-UI (Agent–User Interaction Protocol) | The open, event-based standard that connects agents to user-facing applications – enabling real-time, multimodal, interactive experiences. |
| Agent ↔ Tools & Data | MCP (Model Context Protocol) | Open standard (originated by Anthropic) that lets agents securely connect to external systems – tools, workflows, and data sources. |
| Agent ↔ Agent | A2A (Agent to Agent) | Open standard (originated by Google) which defines how agents coordinate and share work across distributed agentic systems. |
Source: ag-ui.com
Five lessons that appear in no framework tutorial:
Whoever wants to win with agentic AI in 2026 will not win with the biggest model, but with vertical domain expertise, clean tool design, and open protocols.
At Feedbk.ai, a builder agent following these principles can be tried directly in the browser – an AI-moderated survey takes shape in dialogue, without forms.