Google ADK and Amazon Bedrock AgentCore
One is a kit for building agents. The other is a set of services for running them. Compare them with that in mind.
Google's Agent Development Kit (ADK) is an open-source framework for defining agents, tools and, since version 2.0, graph-based workflows. Amazon Bedrock AgentCore is a group of managed services for running agents, including isolated runtime sessions, a gateway to tools, memory, identity and observability, and it accepts agents written with a range of frameworks. They solve different problems, so the comparison is usually between layers.
What you will learn: what each covers, a runnable ADK agent and workflow, the HTTP contract of an AgentCore runtime application, how state and permissions work, testing offline and how to plan for portability.
Prerequisites: The Agent Loop: Observe, Reason, Plan, Act, Reflect, Orchestration vs Automation vs Frameworks and basic familiarity with a cloud platform.
Checked in November 2026. Run locally with google-adk 2.15.1 and bedrock-agentcore 1.28.0 using a scripted model or a local test client. Nothing was deployed to Google Cloud or AWS, and no cloud service was called. Services, regions and prices change, so confirm them in the providers' documentation.
Where each one sits
| Aspect | Google ADK | Bedrock AgentCore |
|---|---|---|
| Kind of product | Open-source development kit | Managed cloud services with SDKs |
| You write | Agents, tools, workflows | An application that meets the runtime contract, plus configuration |
| Languages | Python, Java, Go, TypeScript, Kotlin | Any that your runtime package supports |
| Models | Gemini first, others through adapters | Models inside or outside Amazon Bedrock |
| Runs where | Locally, in containers, or on Google Cloud services | On AWS |
Google Agent Development Kit
An ADK Agent has a name, a model, an instruction and tools. A Runner executes it against a session and produces a stream of events: the user's message, model calls for tools, tool results and replies. Reading events is how you debug and test.
import asyncio
from google.adk import Agent
from google.adk.models import BaseLlm, LlmResponse
from google.adk.runners import InMemoryRunner
from google.genai import types
SCRIPT = [
types.Part.from_function_call(name="stock_level",
args={"sku": "KT-2"}),
types.Part.from_text(text="There are 4 units of KT-2 in stock."),
]
class ScriptedLlm(BaseLlm):
"""Offline stand-in for a Gemini or other model."""
async def generate_content_async(self, llm_request, stream=False):
yield LlmResponse(content=types.Content(
role="model", parts=[SCRIPT.pop(0)]))
def stock_level(sku: str) -> dict:
"""Return the units in stock for one product code."""
return {"sku": sku, "units": {"KT-2": 4}.get(sku, 0)}
root_agent = Agent(
name="stock_agent",
model=ScriptedLlm(model="scripted"),
instruction="Answer stock questions from the tool only.",
tools=[stock_level],
)
async def main():
runner = InMemoryRunner(agent=root_agent, app_name="demo")
for event in await runner.run_debug("How many KT-2?", quiet=True):
for part in (event.content.parts if event.content else []):
if part.function_call:
print("call:", part.function_call.name,
part.function_call.args)
if part.function_response:
print("result:", part.function_response.response)
if part.text and event.author != "user":
print("answer:", part.text)
asyncio.run(main())
Output:
call: stock_level {'sku': 'KT-2'}
result: {'sku': 'KT-2', 'units': 4}
answer: There are 4 units of KT-2 in stock.
The scripted model class implements the base model interface. The framework executed the function and recorded call, result and answer as events. InMemoryRunner and run_debug are for development; a service needs a persistent session store and your own handling of users.
How ADK sees your function
The function in the listing has a typed argument and a docstring. Those become the declaration the model receives. Small choices here decide whether the model calls the tool correctly.
| Choice | Guidance |
|---|---|
| Name | Say what it returns or does, such as stock_level |
| Docstring | State when to use it and what each argument looks like |
| Return value | A small dictionary with clear keys, including an explicit not-found case |
| Errors | Return a safe, actionable status; log the detail privately |
| Identity | Read the user from the session context your server controls |
Note one weakness in the example: an unknown product code reports zero units, which the model would pass on as "out of stock". Returning a separate "unknown product" status avoids that mistake. Gaps like this are found by testing tools with unexpected input, not by reading the happy path.
Graph workflows in ADK 2.0
ADK 2.0, generally available for Python from May 2026 with Go following in June, introduced a graph-based workflow runtime and structured collaboration between agents. A workflow lists edges; functions and agents are nodes. A node can emit a route that selects the next one.
import asyncio
from google.adk import Event, Workflow
from google.adk.runners import InMemoryRunner
def read_claim(node_input):
amount = int(node_input.parts[0].text.split()[-1])
route = "manual" if amount > 500 else "auto"
return Event(output=amount, route=route)
def auto_pay(node_input: int):
return f"{node_input}: paid automatically"
def manual_review(node_input: int):
return f"{node_input}: queued for a person"
flow = Workflow(name="claims", edges=[
("START", read_claim),
(read_claim, {"auto": auto_pay, "manual": manual_review}),
])
async def main():
runner = InMemoryRunner(node=flow, app_name="demo")
for amount in (120, 900):
events = await runner.run_debug(
f"claim amount {amount}", session_id=str(amount), quiet=True)
print(events[-1].output)
asyncio.run(main())
Output:
120: paid automatically
900: queued for a person
No model is involved in this graph, which is the point: rules that must hold are written as code. An agent can be added as a node where judgment is needed. If a node emits a route that no edge matches, the branch ends, so include a default or test every route.
Version 2.0 has breaking changes to the agent API, the event model and the session schema. Google's documentation states that sessions written by 2.0 can be read by 1.28 and later but are incompatible with older releases. Plan the order of upgrades for every service that shares a session store.
Sessions, state and memory
| Concept | Holds | Question to settle |
|---|---|---|
| Session | One conversation and its events | Where is it stored, and for how long? |
| State | Values the agent and tools read and write | Which keys are private to a user? |
| Memory | Information searchable across sessions | Who may see and delete it? |
| Artifacts | Files produced or used | How is access controlled? |
Function tools can be marked as requiring confirmation, either always or according to a function of the arguments. Treat that as the start of an approval design, with identity, expiry and an audit record; see Human-in-the-Loop and Approval Gates.
Developer tooling
The package includes a command line with a local web interface for inspecting runs, commands for evaluation against saved test cases, and deployment helpers. The web interface is a development aid: do not expose it to the internet.
More than one agent
ADK can compose agents, either by letting one delegate to others or by placing them as nodes in a workflow. Prefer the workflow form when the order is known, since it is easier to test and to explain. Give each agent its own instructions and the smallest set of tools, and pass defined data between nodes instead of whole conversations. Compare against a single agent before keeping the extra parts; Single-Agent vs Multi-Agent Systems shows how.
Amazon Bedrock AgentCore
AWS announced general availability in October 2025, describing a platform that works with any framework, model or protocol. You can adopt parts separately.
| Service area | What it does |
|---|---|
| Runtime | Runs your agent, with an isolated environment for each session |
| Gateway | Turns APIs and Lambda functions into tools, including over MCP |
| Memory | Stores short and longer-term context; fine-grained access control was added in August 2026 |
| Identity | Manages how agents authenticate and act for users |
| Observability | Traces and metrics for agent runs |
| Built-in tools | Managed code execution and browser use |
| Agent Registry | A catalog of agents and related resources, generally available since August 2026 |
| Managed harness | Runs the agent loop from configuration, generally available since June 2026 |
The runtime application contract
An application built with the Python SDK is a small web app. It answers health checks on /ping and receives work on /invocations. You decorate one function as the entry point. The listing exercises both routes with a test client, passing the session header the runtime uses.
import logging
from bedrock_agentcore.runtime import BedrockAgentCoreApp
from starlette.testclient import TestClient
app = BedrockAgentCoreApp()
logging.getLogger("bedrock_agentcore.app").setLevel(logging.WARNING)
@app.entrypoint
def invoke(payload, context):
"""Call your agent here; any framework will do."""
question = payload.get("prompt", "").strip()
if not question:
return {"error": "prompt is required"}
return {"session": context.session_id,
"answer": f"(agent reply to: {question})"}
if __name__ == "__main__":
# In a container you would call app.run() to serve port 8080.
# Here the same HTTP contract is exercised without a network.
client = TestClient(app)
header = {"X-Amzn-Bedrock-AgentCore-Runtime-Session-Id": "s-123"}
print("ping:", client.get("/ping").json()["status"])
for body in ({"prompt": "Where is A-17?"}, {}):
reply = client.post("/invocations", json=body, headers=header)
print(reply.status_code, reply.json())
Output when run locally:
ping: Healthy
200 {'session': 's-123', 'answer': '(agent reply to: Where is A-17?)'}
200 {'error': 'prompt is required'}
Look at the second response. The input was missing, yet the status is 200, because the function returned normally with an error object. Decide how callers learn of failures, and test it. Inside the function you can call any agent code; keeping that call to one line makes the same agent usable elsewhere.
Identity and permissions
On either cloud, the most important design question is whose authority a tool call uses. An agent with a broad service role can be talked into using all of it.
| Control | Practice |
|---|---|
| Workload identity | One role per agent, with only the actions it needs |
| Acting for a user | Pass verified identity to tools; check it in the target service |
| Session identifiers | Create or verify them on the server and bind them to a user |
| Network | Restrict outbound access, above all for code and browser tools |
| Secrets | Use the platform's secret store, never prompts or state |
| Spend | Budgets, quotas and alerts on model and service use |
A session header such as the one in the listing identifies a conversation. It does not prove who the caller is. Authentication has to happen before your function trusts anything. See Agent Identity, Authorization and Secrets.
Seeing what happened
Both products can emit traces and logs. Agree on a small set of fields so that one request can be followed from the caller to every tool.
| Field | Why |
|---|---|
| Request and session identifiers | Join application, runtime and tool logs |
| Agent, model and release version | Explain a change in behavior |
| Tool name, status and duration | Find slow and failing dependencies |
| Tokens and cost estimate | Control spend |
| Approval and decision identity | Answer who allowed an action |
Capturing full prompts and results helps debugging and stores whatever users and tools put in them. Choose what is captured, mask sensitive values and set retention before launch. See Tool Testing and Observability.
Failures to rehearse
| Failure | Question to answer |
|---|---|
| Runtime session ends mid-task | What was saved, and can the task continue? |
| Client retries after a timeout | Could the action happen twice? |
| Model quota is exhausted | Does the caller get a clear status? |
| A tool service is down | Does the agent stop or invent an answer? |
| A new release misbehaves | How quickly can the previous one serve again? |
A managed runtime isolates sessions and scales your code. It does not know whether repeating your payment call is safe. Operation keys and recorded outcomes remain your job, as described in Reliable Tool Execution and Error Recovery.
Testing before deployment
- Tools are tested as plain functions
- The agent runs with a scripted model on every commit
- Each workflow route has a case, including one that matches nothing
- The runtime routes are tested locally, with bad and oversized input
- A staging deployment checks identity, network rules and logs
- An evaluation set runs against the real model
Understanding cost
Count each meter separately: model tokens, runtime compute, memory storage and retrieval, gateway calls, built-in tools, logging and tracing. A long idle session or a verbose trace may cost more than expected. Take current prices from the provider, run a realistic sample of traffic and divide by successful tasks.
Staying portable
| Keep independent | Platform-specific by nature |
|---|---|
| Business rules and tool functions | Deployment definitions |
| Evaluation cases | Identity and network policy |
| Export of data you must keep | Managed memory formats |
| Standard protocols at boundaries | Monitoring dashboards |
Some dependence is a fair price for not running infrastructure yourself. Write down which parts would need rewriting, so the choice is made knowingly. See Choosing Frameworks: Lock-In, Upgrades and Benchmarks.
Choosing
| Situation | Reasonable first trial |
|---|---|
| Team on Google Cloud using Gemini | ADK with Google's hosting options |
| Team on AWS with an existing framework | Keep the framework; try AgentCore runtime |
| Need a managed tool gateway on AWS | Gateway on its own |
| Must run on your own servers | An open-source framework in your containers |
| Simple internal helper | A plain service and a model client |
A company writes an agent with ADK, packages it in a container and hosts it on AWS behind the AgentCore runtime contract. Tools stay in the company's own services with their own authorization. The team accepts two vendors' upgrade cycles in return, and records that cost.
Common mistakes
| Mistake | Better practice |
|---|---|
| Comparing a kit with a platform feature by feature | Compare layer with layer |
| In-memory sessions in a service | Persistent storage with retention rules |
| Trusting a session identifier as identity | Authenticate, then bind the session |
| One powerful role for all agents | Least privilege per agent |
| Errors returned as success | Use clear statuses callers can act on |
| Upgrading ADK across a shared store all at once | Check session compatibility first |
Checklist
- The layer each product supplies is clear
- Tool calls run with the narrowest authority
- Sessions and memory have owners and retention periods
- Routes, errors and limits are tested locally
- Costs are measured per successful task
- Upgrade and exit plans are written down
Frequently asked questions
Does ADK work only with Gemini?
No. It is designed around Gemini and offers adapters and a base class for other models. Test tool calling and streaming with the model you choose.
Must AgentCore use Amazon Bedrock models?
No. AWS describes it as working with any framework and model. Network access, credentials and data handling for outside providers are your responsibility.
Can I test AgentCore code on a laptop?
You can test the application's routes and logic, as shown. Identity, gateway, memory and scaling behavior need a deployed environment.
Which is better for beginners?
ADK runs locally with little setup. A managed platform adds cloud accounts, permissions and cost, which are worth learning after the agent itself works.
References and further reading
- ADK 2.0 documentation
- Why Google built ADK 2.0
- AgentCore general availability announcement
- AgentCore release notes
Next steps
TypeScript: Mastra and Vercel AI SDK
Agents in TypeScript.
Agent Identity, Authorization and Secrets
Decide whose authority agents use.
Durable Execution, Checkpoints and Approvals
Keep long tasks alive.