Agent Runtime
Run your agents as a secure, stateless service.
We build our agents, teams, and workflows with the Kern SDK and take them live using AgentOS. What does it mean to take an agent live? We should be able to:
- Run the agent on demand, via an API request, or via interfaces like Slack, Telegram, and others.
- Maintain long-running sessions that last from minutes to days to weeks.
- Be durable across restarts, replicas, and infrastructure failures.
- Be secure against unauthenticated access.
- Monitor every run and action taken.
Kern's agent runtime, AgentOS, takes agents, teams, and workflows built with the Kern SDK or any other framework and runs them as a secure, scalable service.
Here's the smallest possible AgentOS example:
1from kern.agent import Agent2from kern.db.postgres import PostgresDb3from kern.models.openai import OpenAIResponses4from kern.os import AgentOS56db = PostgresDb(db_url="postgresql://user:pass@host:5432/kern")78agent = Agent(model=OpenAIResponses(id="gpt-5.5"), db=db)910agent_os = AgentOS(agents=[agent], db=db)11app = agent_os.get_app()1213if __name__ == "__main__":14 agent_os.serve(app="my_app:app", reload=False)This script starts a FastAPI application that you can scale horizontally. Persistent sessions, streaming, JWT auth, tracing, and a scheduler, all come built-in.
What the runtime gives you
The runtime covers the ground between your agent code and a production service:
| Concern | How AgentOS handles it |
|---|---|
| HTTP API | Auto-generated endpoints for every registered agent, team, and workflow |
| Persistence | Sessions and memory persisted to your db |
| Streaming | SSE on every run endpoint; tokens and tool calls stream as they happen |
| Auth | JWT validation with RBAC scopes built-in |
| Scheduling | In-process cron that polls the database and fires due jobs |
| Observability | OpenTelemetry tracing into the same db, queryable with SQL |
| Interfaces | Slack, Telegram, WhatsApp, A2A, AG-UI |
| Human in the loop | Pause runs for user confirmation, admin approval, or external execution |
AgentOS can also serve agents built with the Claude Agent SDK, LangGraph, and DSPy.
Explore
Agent API
Run your agent platform as an API.
Agent Storage
Add durability and persistence.
Observability
Tracing, run history, and audit logs in your own database.
Security and Auth
JWT validation, RBAC scopes, and per-request isolation.
Scheduling
In-process cron and multi-step workflows.