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:

  1. Run the agent on demand, via an API request, or via interfaces like Slack, Telegram, and others.
  2. Maintain long-running sessions that last from minutes to days to weeks.
  3. Be durable across restarts, replicas, and infrastructure failures.
  4. Be secure against unauthenticated access.
  5. 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 Agent
2from kern.db.postgres import PostgresDb
3from kern.models.openai import OpenAIResponses
4from kern.os import AgentOS
5
6db = PostgresDb(db_url="postgresql://user:pass@host:5432/kern")
7
8agent = Agent(model=OpenAIResponses(id="gpt-5.5"), db=db)
9
10agent_os = AgentOS(agents=[agent], db=db)
11app = agent_os.get_app()
12
13if __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:

ConcernHow AgentOS handles it
HTTP APIAuto-generated endpoints for every registered agent, team, and workflow
PersistenceSessions and memory persisted to your db
StreamingSSE on every run endpoint; tokens and tool calls stream as they happen
AuthJWT validation with RBAC scopes built-in
SchedulingIn-process cron that polls the database and fires due jobs
ObservabilityOpenTelemetry tracing into the same db, queryable with SQL
InterfacesSlack, Telegram, WhatsApp, A2A, AG-UI
Human in the loopPause runs for user confirmation, admin approval, or external execution
Tip

AgentOS can also serve agents built with the Claude Agent SDK, LangGraph, and DSPy.

See Multi-framework support.

Explore