TL;DR
  • Most AI “agents” in production are fancy chatbots — they converse but do not complete end-to-end tasks. Real agents need tool access, state management, and error recovery.
  • The critical design choice is the agent’s action boundary: what it can do autonomously vs. what requires human approval. Get this wrong and you get either an unsafe system or a useless one.
  • We ship agents in PMS, Dynabric, and WyseAgent that complete real tasks — booking contractors, filing compliance documents, drafting lease amendments — using a five-layer architecture.

Context

The gap between AI agent demos and AI agent reality is enormous. In demos, the agent understands your request, formulates a plan, executes a sequence of actions, and delivers a perfect result. In reality, the agent misinterprets your intent, calls the wrong API, gets a 422 error, retries with the same bad payload, and eventually returns a vague apology.

We have shipped production agents across multiple domains at Logicbric and have learned that the difference between agents that work and agents that do not comes down to five engineering decisions, not model capability. This playbook covers each one.

Phase 01

Define the task boundary, not the conversation boundary

Most teams start by defining what the agent can talk about. This is backwards. Start by defining what the agent can do — the specific tasks it can complete end-to-end. In PMS, our property management agent can: create maintenance tickets, schedule viewings, generate rent statements, draft tenant communications, and escalate issues to human managers. That is the boundary. Everything outside it gets a clear, honest handoff.

  • List every task your users currently complete manually in your product
  • Score each task on complexity (number of steps), risk (consequence of errors), and frequency
  • Start with high-frequency, low-risk tasks — these build user trust
  • For each task, define the complete action sequence from start to finish
  • Define explicit handoff points where the agent transfers to a human
Phase 02

Build a robust tool layer

An agent without tools is a chatbot. The tool layer is the set of APIs, functions, and integrations that the agent can call to take action in the real world. Each tool should be atomic (does one thing), idempotent (safe to retry), and well-documented (the agent needs to understand what each tool does and what parameters it requires). We describe tools using structured schemas that include not just parameter types but semantic descriptions, valid value ranges, and common error scenarios.

  • Wrap every external API in a tool abstraction with consistent error handling
  • Write tool descriptions as if explaining to a new team member, not a machine
  • Include parameter validation in the tool itself — do not rely on the model to send valid inputs
  • Make every tool idempotent — the agent will sometimes call tools multiple times
  • Log every tool invocation with full inputs and outputs for debugging
Phase 03

Implement state management and memory

Real tasks span multiple turns and sometimes multiple sessions. The agent needs to track where it is in a task, what has already been done, what is pending, and what has failed. We use a structured task state object that persists across interactions. When a user comes back hours later and says “what happened with that maintenance request?” the agent can retrieve the full execution history and provide a status update.

  • Design a task state schema that captures: current step, completed actions, pending actions, and blockers
  • Persist task state to a database, not just in-memory context
  • Implement task resumption — the agent must be able to pick up where it left off
  • Add a task timeline that users can inspect to understand what the agent did and why
Phase 04

Design error recovery, not just error handling

Error handling catches exceptions. Error recovery resolves them. When a tool call fails, the agent should not just report the error — it should diagnose the cause, attempt an alternative approach, and only escalate to a human when it has exhausted its options. In Dynabric, when a contractor scheduling API returns a conflict, the agent automatically checks alternative time slots, proposes them to the user, and rebooks — rather than simply saying “scheduling failed.”

  • Categorise errors: retryable, recoverable with alternative approach, requires human intervention
  • Implement retry with exponential backoff for transient failures
  • Build alternative action paths for common failure scenarios
  • Set maximum retry and recovery attempts — the agent must know when to stop and ask for help
  • Never let the agent silently fail — every failed task must be surfaced to the user
Phase 05

Implement human-in-the-loop controls

The most important design decision in any agent system is the approval boundary. Some actions the agent can take autonomously (reading data, drafting documents). Others require explicit human approval (sending communications, committing financial transactions, modifying records). This boundary should be configurable per organisation, per role, and ideally per task type. In Yezda, the agent can gather and analyse screening data autonomously but cannot submit a final vetting decision without human sign-off.

  • Define a clear taxonomy: autonomous actions, confirmable actions, and human-only actions
  • Build an approval queue where pending actions are presented with full context
  • Allow organisations to customise the approval boundary based on their risk tolerance
  • Implement approval expiry — pending actions should not hang indefinitely
  • Track approval rates as a product metric — low approval rates mean the boundary is too conservative