Deploy and scale hosted agents
Agentic AI Foundations · Lesson 15 of 20 · 1:47:58
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the Oracle Agentic AI Foundations Associate exam (1Z0-1157-26). In this lesson: the two ways to run agents on OCI, the five steps of a hosted deployment (container image, OCI Container Registry, a Generative AI application, and a deployment), application settings, and scaling with replicas and autoscaling. Includes three original practice questions, with Fairhaven Furniture, a fictional furniture seller, as the example.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
From script to service
Fairhaven's delivery planner is an agent built with the OpenAI Agents SDK, and it works on a laptop. Now the website and the support agent must call it, all day long, as a service. Traffic is quiet at night, and it jumps during weekend sales.
Two ways to run agents
OCI Enterprise AI Agents gives you two ways to run agents, and the difference is where your application runs. With the Responses API, your application runs wherever you want, on a laptop, a Kubernetes cluster, or a virtual machine, and it calls the API, while OCI runs the models and the built-in tools. With hosted applications, OCI runs your whole agentic application, built with any framework, and takes care of scaling, networking, authentication, and endpoints. Think of the first as API consumption, and the second as managed application deployment.
Five steps
A hosted deployment takes five steps. First, develop your agent locally, with LangGraph, LangChain, the Agents SDK, or any other framework. Second, package it as a container image, with your code and all its dependencies. Third, push the image to OCI Container Registry, also called OCIR. Fourth, create a Generative AI application, which holds the scaling, storage, networking, and authentication settings. Fifth, create a deployment in that application, select your image and its tag, and activate it: OCI then provides an HTTP endpoint that clients, or other agents, can call.
Application settings
The application holds the settings that every deployment uses. Scaling sets the minimum and maximum number of replicas, and the metrics for autoscaling. Storage can add managed services, like File Storage, OCI PostgreSQL, OCI Cache, or Autonomous Database, and persistent file storage keeps files across restarts and redeployments. Networking places the application in a VCN and a subnet, with a public or a private endpoint. And authentication can use an identity domain, with a bearer token or a browser session, OCI IAM, or no platform-managed authentication.
Deployments
Inside an application, you can create several deployments, each pointing to an image and a tag. Only one deployment is active at a time, and the active one serves the application's endpoint. When you activate a new deployment, the previous one becomes inactive, which is how you roll out a new version. Before you send traffic, wait until the deployment is active, and the container is ready to serve.
Scaling
A deployment runs as one or more replicas, and each running replica uses compute. Autoscaling adds replicas when traffic grows, between the minimum and the maximum that you set, and a Generative AI application can even scale down to zero. To cap the scale-out, lower the maximum, and to turn autoscaling off, set the minimum and the maximum to the same value. Usage follows the replicas: more replicas, for more hours, means more compute.
Which container option?
OCI has other ways to run containers, so when do you pick a Generative AI application? It is made for web services, especially agentic applications and MCP servers, with managed HTTPS endpoints, built-in load balancing, autoscaling to zero, and low operations overhead. OCI Container Instances suit batch jobs, scripts, and workers, with no built-in autoscaling. And Kubernetes Engine, OKE, gives full control, with manifests and Helm charts, but much more to operate.
Recap
Let's recap. With the Responses API, your application runs anywhere and calls OCI, while a hosted application lets OCI run the whole agent. The five steps are: develop, package as a container image, push to OCI Container Registry, create a Generative AI application, and create and activate a deployment, which serves an HTTP endpoint. The application holds scaling, storage, networking, and authentication, and only one deployment is active at a time. Replicas scale between a minimum and a maximum, down to zero, and Generative AI applications suit agents and MCP servers with little to operate.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
Fairhaven’s team has created a Generative AI application for the delivery planner, and now wants to create a deployment. What must already exist?
- A vector store with the planner’s documents
- A dedicated AI cluster for the model
- A conversation for each client
- The planner’s image in OCI Container Registry
Show the answer
The planner’s image in OCI Container Registry
A deployment selects a container image, and its tag, from OCI Container Registry, so the image must be pushed first. “A vector store with the planner’s documents” is a building block for retrieval, which a deployment does not require. “A dedicated AI cluster for the model” serves a model, and the planner calls models through OCI anyway. And “A conversation for each client” is created at run time, for each chat, not before a deployment.
Fairhaven has pushed version two of the planner’s image, with a new tag. The team wants the same endpoint to serve the new version. What should they do?
- Deploy the new tag and activate it
- Create a second application for it
- Push the new image and do nothing else
- Keep two active deployments at once
Show the answer
Deploy the new tag and activate it
Create a deployment for the new tag in the same application, and activate it, so the previous deployment becomes inactive. “Create a second application for it” would create a second application, with its own endpoint. “Push the new image and do nothing else” changes nothing, because a deployment points to a specific tag. And “Keep two active deployments at once” is impossible, since only one deployment is active at a time.
Fairhaven’s planner gets almost no traffic at night, and heavy traffic during weekend sales. The team wants low operations overhead, and no replicas running when nobody calls. Which option fits best?
- OCI Container Instances, started by hand
- An OKE cluster with manifests and Helm charts
- A Generative AI application with autoscaling
- A fixed five replicas, day and night
Show the answer
A Generative AI application with autoscaling
A Generative AI application scales automatically, down to zero, behind a managed endpoint, with little to operate. “OCI Container Instances, started by hand” has no built-in autoscaling, so someone would start and stop instances. “An OKE cluster with manifests and Helm charts” could scale, but it brings manifests, Helm charts, and much more to operate. And “A fixed five replicas, day and night” would keep five replicas running all the time.