Run Your AgentOS

Run a local AgentOS in 20 lines of code.

Save the following code to agno_assist.py:

1from kern.agent import Agent
2from kern.db.sqlite import SqliteDb
3from kern.models.anthropic import Claude
4from kern.os import AgentOS
5from kern.tools.mcp import MCPTools
6
7agno_assist = Agent(
8 name="Kern Assist",
9 model=Claude(id="claude-sonnet-4-5"),
10 db=SqliteDb(db_file="kern.db"),
11 tools=[MCPTools(url="https://kern.ndx.rocks/mcp")],
12 add_datetime_to_context=True,
13 add_history_to_context=True,
14 num_history_runs=3,
15 markdown=True,
16)
17
18agent_os = AgentOS(agents=[agno_assist])
19app = agent_os.get_app()

In ~20 lines: an Agent with memory, state and MCP, served as a FastAPI application.

Run Your AgentOS

Set up your virtual environment

1uv venv --python 3.12
2source .venv/bin/activate
1uv venv --python 3.12
2.venv\Scripts\activate

Install dependencies

1uv pip install -U 'kern-ai[os]' anthropic mcp

Export your Anthropic API key

1export ANTHROPIC_API_KEY=sk-***
1setx ANTHROPIC_API_KEY sk-***

Run your AgentOS

1fastapi dev agno_agent.py

Your AgentOS is now running at http://localhost:8000.

EndpointDescription
http://localhost:8000Connect to the control plane
http://localhost:8000/docsInteractive API documentation
http://localhost:8000/configView AgentOS configuration