An operating system for AI agents. The agent loop is a plugin, and every call is mediated.
A self-hosted AI agent built on a small kernel — the plugin contract, the SDK, boxes that plugins run in, the security policy and the loading and unloading of plugins — with everything else as plugins. Read AGENTS.md before changing the code, docs/KERNEL.md for the map and docs/SDK.md for writing plugins.
python3 -m venv .venv && .venv/bin/pip install -e .[dev]
.venv/bin/python main.py # the terminal front end (/help lists the commands); --no-repl runs headless
.venv/bin/python -m pytest # tests
On Windows use py -3 -m venv .venv and .venv\Scripts\python in place of .venv/bin/python.
On macOS, Python from python.org needs "Install Certificates.command" run once (in its
Applications folder), or every call to a model provider fails with a certificate error.
main.py bootstrap
kernel/ the kernel; plugins import only its front door (from kernel import Plugin, capability)
bundled/ plugins and scripts that ship with the app
docs/ KERNEL.md the map: boxes, loading and unloading, every fixed limit
SDK.md the plugin author's reference
POLICY.md the security policy
AGENT_GUIDE.md what the running agent reads about itself
KNOWN_ISSUES.md the one list of known bugs and gaps
templates/ a worked example plugin and script
tests/ README.md says what the tests pin
AGENTS.md read before changing the code
Mutable data (settings, installed plugins, the agent's workspace, logs) lives outside the checkout: ~/.local/share/second-brain on Linux, ~/Library/Application Support/Second Brain on macOS, %LOCALAPPDATA%\Second Brain on Windows; or $SECOND_BRAIN_DATA. Every path is defined once, in kernel/paths.py.