Level 03 / AI engineers
Open Agent Kernel (OAK) sits between your agent code and the infrastructure it runs on. This page covers how it compares with the alternatives, where it sits in a request, and the memory, hook and queue machinery you can build on.
01Compare
Managed platforms give you a runtime and take the choice of cloud and framework. Frameworks leave you the choice and no runtime. OAK is built to give you both.
| Question | Managed cloud platformsBedrock AgentCore, Azure AI Foundry, Vertex AI | Agent frameworksLangGraph, CrewAI, OpenAI Agents and others | OAKOpen Agent Kernel |
|---|---|---|---|
| Switch cloud platform later? | Rewrite | You build it | One config change |
| Run agents from several frameworks together? | Not possible | Not possible | In one runtime |
| Integrations out of the box?Slack, Teams, REST, A2A, MCP | Partial | Build your own | Built in |
| Sessions, memory and observability? | Proprietary | Build your own | Built in and pluggable |
| Knowledge bases? | Proprietary | Build your own | Built in and pluggable |
| Open source, with no licence fee? | No | Yes | Apache 2.0 |
| Lift and shift an existing agent? | Rewrite | Rewrite | Wrap and ship |
02Placement
Three views of one system: what you set out to build, what it takes to run it, and the part OAK takes over.
Multi-Agent System
03Memory
Keep the conversation coherent, enrich a single request, and carry session data forward, without filling the model's context with it.
Session
The turns of the conversation, kept by the session store. This is what gives a chat its continuity.
One request
A scratchpad for a single request: retrieved passages, file reads, intermediate results. It clears after every reply.
Session
Supporting data that should outlive a request: user preferences, auth context, counters. Tools and hooks read it without spending model tokens.
from agentkernel import PreHook, Session
from agentkernel.core.memory import KeyValueCache
class MyHook(PreHook):
async def on_run(self, session: Session, agent, requests):
# Get caches from session
v_cache: KeyValueCache = session.get_volatile_cache()
nv_cache: KeyValueCache = session.get_non_volatile_cache()
# Use the caches
v_cache.set("temp_data", "value")
user_pref = nv_cache.get("user_language")
return requests
04Hooks
Control what reaches an agent and what leaves it, without touching the agent's own logic. Hooks work with every framework adapter.
A pre-hook receives the requests and may change them: redact, validate, add retrieved context or attach files.
A post-hook receives the reply, and each one sees what the hook before it returned: moderate, add a disclaimer, log for audit.
A pre-hook that returns a reply ends the run before the model is called. Use it for input guardrails, rate limits and cached answers.
from agentkernel.openai import OpenAIModule
from agents import Agent
# Create your agent
agent = Agent(name="assistant", instructions="...")
# Register agent and hooks using method chaining
OpenAIModule([agent]).pre_hook(agent, [
RAGHook(),
GuardRailHook(),
]).post_hook(agent, [
ModerationHook(),
DisclaimerHook(),
])
05Scale and evidence
A queue between the caller and the agent sets how the system behaves under load. Traces you can read back tell you how it behaved.
Spans written to Langfuse, OpenLLMetry, Pydantic Logfire or CloudWatch come back through one provider-neutral call, grouped into traces with their input, output, tool calls and usage. An evaluation job can grade real runs.
from datetime import timedelta
from agentkernel.trace import SpanStatus, Trace
for trace in Trace.get().fetch_traces(session_id="session-123", last=timedelta(hours=24)):
if trace.root is None:
continue # the root span isn't stored (yet), so there is no request to grade
print(trace.trace_id, trace.user_input, trace.output, trace.usage.cost, trace.agent_names)
failed = [span.name for span in trace.tool_spans if span.status == SpanStatus.ERROR]
Free and open source under Apache 2.0. No licensing costs and no lock-in.