More Software Engineering Radio episodes

Raju Dandigam on Building Production AI Agents thumbnail

Raju Dandigam on Building Production AI Agents

Published 30 Sept 2026

Duration: 57:35

"Explores production AI agents, their autonomy, safety, and engineering best practices, comparing workflows, tool design, orchestration, and memory systems while addressing challenges like cost, latency, and reliability."

Episode Description

Raju Dandigam speaks with host Amey Ambade about building robust AI agents for production. Raju recommends treating an agent as a software subsystem r...

Overview

The podcast discusses the design and implementation of production-grade AI agents, emphasizing the importance of combining model-driven flexibility with deterministic application control. A production AI agent is defined as a system where a model can autonomously choose actions or use tools to achieve a goal, but within strict engineering constraints such as authentication, authorization, policy checks, and timeouts. The model handles language-based tasks like interpreting user intent or ranking options, while the application manages reliable, rule-based logic such as access control and data validation. Pre-model checks ensure that only authorized, valid requests proceed, and structured workflows are contrasted with dynamic agent behaviors - workflows follow fixed paths for predictable tasks, while agents adaptively decide next steps for complex, open-ended problems.

Reliability in agent systems depends on robust tool design, structured outputs, and comprehensive failure handling. Tools must have clear contracts specifying inputs, outputs, and failure modes, with distinctions between low-risk read-only tools and high-risk actions requiring approval. Outputs should be structured (e.g., including outcome codes, reason messages, and confidence scores) and validated using schema checks, though additional business logic is needed to ensure semantic correctness. Failures are categorized - such as validation errors, policy rejections, or tool timeouts - to enable appropriate responses and debugging. Observability is critical, with detailed logging of model versions, context, reasoning traces, and performance metrics, while protecting sensitive data through masking or exclusion. Testing combines deterministic unit and integration tests with behavioral evaluations using live models, and debugging focuses on tracing execution paths to identify root causes.

For complex tasks, multi-agent architectures like the coordinator-specialist pattern allow parallel processing, where a central agent manages the overall goal and specialists handle domain-specific subtasks. However, such systems introduce higher costs and latency due to increased model usage and coordination overhead, making them suitable only when justified by task complexity. Long-running agents require durable state management, checkpoints, and mechanisms for resuming after interruptions. The choice between synchronous and asynchronous execution depends on expected latency, with user-facing systems needing fast acknowledgments and incremental progress updates. Ultimately, successful deployment involves starting with limited autonomy, carefully designing fallbacks, and measuring cost and performance at both the run and service levels to ensure efficiency and safety.

What If

  • What if you designed your first production AI agent with bounded autonomy and pre-validated tool contracts?

    • Move: Implement a food-ordering agent that only uses read-only tools (e.g., menu fetch, availability check) with strict schema validation (Pydantic/Zod) and hard-coded policy checks (budget $100, no allergens) before model execution.
    • Why Now?: Starting with low-risk, read-only tools reduces production failure surface; schema + policy checks prevent downstream damage from invalid outputs.
    • Expected Upside: You ship a reliable MVP in under two weeks, avoid financial/data integrity risks, and gain observability into model behavior without enabling irreversible actions.
  • What if you replaced a synchronous workflow with an asynchronous agent for complex user requests - but only when latency exceeds 10 seconds?

    • Move: Convert your current meal-planning endpoint to async if P95 latency crosses 10s; use run IDs, checkpoints, and progress cards (e.g., "Checking restaurant X...") streamed to the UI, while falling back to last valid state on failure.
    • Why Now?: Users expect fast feedback; by monitoring real-world latency now, you can proactively split workloads before scaling costs or UX issues compound.
    • Expected Upside: Maintain sub-second UX for simple cases, handle complex tasks reliably in the background, and reduce user drop-off by 30%+ through progress transparency.
  • What if you treated agent debugging like production incident response - with full traceability and failure attribution?

    • Move: Add structured logging with run IDs, model versions, tool calls, and sanitized context; build a local replay tool that mocks tool responses so you can debug agent decisions without live models.
    • Why Now?: As your agent handles more tasks, unexplained failures will increase; having logs + replayability now prevents debugging chaos at scale.
    • Expected Upside: Cut mean-time-to-fix (MTTR) by 50%, confidently iterate on prompts/tools, and isolate whether failures stem from model logic, tool errors, or app-level validation.

Takeaway

  • Implement pre-model checks (authentication, authorization, rate limiting, data freshness) to ensure only valid and safe requests reach the AI model.
  • Design agent outputs to be structured (e.g., JSON with outcome, reason code, confidence) and validate them using schema tools like Pydantic or Zod before downstream processing.
  • Use deterministic workflows instead of agents for simple, repetitive tasks (e.g., reorders), reserving agent autonomy for complex, open-ended problems requiring flexibility.
  • Enforce tool contracts with clear input/output schemas, idempotency for write operations, and separate read-only vs. approval-gated tools to prevent unsafe actions.
  • Instrument full trace logging with run IDs, model versions, tool calls, and context - while stripping or masking PII - to enable debugging, cost tracking, and failure attribution in production.

Recent Episodes of Software Engineering Radio

29 Oct 2026 Danilo Krummrich on Rust in the Linux Kernel

"Nova GPU driver project integrates Rust into the Linux kernel to replace the aging Novo driver, leveraging Rust's memory safety for better reliability and performance while addressing firmware and architectural challenges through incremental, collaborative updates."

7 Oct 2026 Sahil Walia on Schema Changes and Data Migrations

Recommended: Schema as source of truth

"Schemas define data structure, apply across systems, and require careful evolution to avoid breaking changes, with best practices including additive updates, blue-green deployments, and stable identifiers."

16 Sept 2026 Milan Milanovic on the Laws of Software Engineering

"Explores key software engineering principles (like Conway's Law, Brooks' Law) and their impact on systems, teams, and decision-making, emphasizing context-dependent trade-offs, AI's role, and practical applications like measuring technical debt."

9 Sept 2026 Owen McGirr on Software Accessibility

"Accessibility in software development must be prioritized from the start, integrating inclusive design practices like multiple input methods, proper labeling, and user testing to benefit all users, not just those with disabilities."

3 Sept 2026 Sahil Walia on Apache Iceberg

"Apache Iceberg is a scalable, interoperable data framework that unifies OLTP and OLAP workloads, separates storage and compute, and enables efficient metadata-driven operations, governance, and cost savings across industries."

More Software Engineering Radio episodes