Building an agent locally is straightforward: write a function, call it, print the result. Deploying it to production is harder — you need a server, request handling, health checks, error formatting, and a stable interface for other systems to call. AWS Bedrock AgentCore handles all of that for you. By wrapping your agent with theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/NirDiamant/agents-towards-production/llms.txt
Use this file to discover all available pages before exploring further.
BedrockAgentCoreApp SDK, you get a managed HTTP runtime without touching your core agent logic.
Separation of concerns
Agent logic stays in plain Python. AgentCore owns the HTTP layer, routing, and monitoring.
Standardized interface
Every agent exposes the same
/invocations and /ping endpoints, making integration predictable.Production foundation
Add tools, logging, and access control later without rewriting the agent or its runtime wiring.
How AgentCore works
AgentCore acts as a control tower between incoming HTTP requests and your agent function. It does not change what your agent does — it changes how the outside world reaches it. The runtime server starts on port8080 by default and exposes two endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/invocations | POST | Send requests to your agent |
/ping | GET | Health check |
Prerequisites and installation
AgentCore requires Python 3.10 or higher. Install the SDK and supporting libraries:.env file in your working directory:
.env
Step 1: Build the base agent
Write your agent as a plain Python function. Keep it free of any AgentCore-specific logic — this makes it easy to test in isolation and swap out later.agent.py
Step 2: Create the AgentCore application
BedrockAgentCoreApp sets up all the HTTP infrastructure in a single line:
agent.py
Step 3: Register your agent as the entrypoint
The@app.entrypoint decorator connects your function to the runtime. AgentCore calls this function for every incoming POST /invocations request and passes the request body as a payload dictionary.
By convention, the user’s message arrives in the prompt field:
agent.py
Your core
process_message function remains completely unchanged. The entrypoint is a thin adapter that reads the payload and formats the response.Step 4: Start the runtime server
Callapp.run() to start the HTTP server. In production, save the complete agent to a file and run it as a standalone script:
agent.py
Step 5: Send requests to your agent
Once the server is running, interact with it over HTTP. The request goes to/invocations with a JSON body containing a prompt field.
- curl
- Python
Before and after AgentCore
The table below shows what changes and what stays the same when you adopt AgentCore:| Concern | Before AgentCore | After AgentCore |
|---|---|---|
| Agent logic | process_message(msg) | Unchanged |
| Calling the agent | Direct Python function call | HTTP POST to /invocations |
| Health checks | Manual | Built-in /ping endpoint |
| Request tracking | None | Automatic |
| Error formatting | Ad hoc | Structured HTTP responses |
What to add next
Once your agent runs through the AgentCore runtime, you can extend it without modifying the core logic:Add tools
Give your agent the ability to search the web, query databases, or call external APIs.
Enable logging
Capture every request and response for debugging and compliance.
Access control
Restrict which callers can invoke specific agent capabilities.
Deploy to AWS
Use the AgentCore starter toolkit to move from localhost to production AWS infrastructure.