chapter eight

8 Deploying agents and agentic systems

 

This chapter covers

  • Strategies for consuming and deploying agents
  • Dockerizing agent systems
  • Considering advanced deployment strategies
  • Security, safety, and governance in production

At some point in your agent journey, you will need to deploy and perhaps productize your agents. This could be as simple as embedding an agent within an existing application or something more scalable and controlled, such as containers. There are numerous strategies, practices, and implementations for building AI agent systems.

In this chapter, we will look at how agents built with the OpenAI Agents SDK can be deployed and productized. Keep in mind that there are numerous agent frameworks and platforms you can use to develop and deploy your agents, and the skills covered in this book will apply to all of them. By the end of the chapter, you should be able to choose an appropriate deployment strategy for your agent, containerize it, orchestrate multiple agents, and understand the basics of securing and operating them in production.

8.1 Strategies for consuming agents

For much of this book, we have looked at simple toy examples that put agent concepts into practice. But most of these examples omitted how such agents could be consumed or deployed. How we consume agents may often dictate how we deploy them, whether they are embedded in an application or deployed as a separate microservice.

8.1.1 Embedding real-time voice agents into web applications

8.1.2 Hosting agents through an API

8.1.3 Consuming an agent web service in a web application

8.2 Dockerizing agent systems

8.2.1 Containerizing an agent microservice

8.2.2 Orchestrating agentic systems with Docker Compose

8.2.3 Externalizing local agent microservices

8.3 Considering advanced deployment strategies

8.3.1 Choosing a runtime: Edge, API, or event-driven

8.3.2 The three “wires” of communication

8.3.3 Practical multi-agent topologies that adapt well

8.3.4 State, memory, and idempotency

8.3.5 Release engineering for agents (prompts, tools, models)

8.3.6 Observability matters

8.3.7 Reliability patterns: Timeouts, fallbacks, and budgets

8.3.8 Cost control and model routing