A policy-governed capability operating system for persistent, composable autonomous intelligence.
Genesis OS is a Python kernel that turns long-lived objectives into auditable execution graphs. It acquires missing trusted capabilities, routes work across interchangeable providers, persists objective and world state across runs, learns from outcomes, and promotes repeated successful plans into reusable procedures β all through a single policy boundary.
Design thesis: The system should resemble an operating system more than a chatbot framework. Models are processors. Agents are ephemeral processes. Capabilities are syscalls. Memory is a hierarchy. Policy is the kernel security boundary.
Most agent systems stop at model β tools β actions. Genesis owns the layer above:
Persistent Objective
β
βΌ
Capability Graph ββββ missing? βββΆ Trusted Capability Acquisition
β β
βΌ βΌ
Provider Router βββββββββ outcome history / cost / latency
β
βΌ
Central Policy Gate
β
βΌ
Execution β Evaluation β Episodic Memory
β β
βΌ βΌ
World Model Procedure Compiler
β β
βββββββ Learning / Curiosity ββββββββββ
β
βΌ
next heartbeat
Agents, models, skills, browsers, sandboxes, APIs, humans, and machines are all replaceable capability providers. Genesis keeps the durable objective, policy, memory, learning, and capability-selection state β not the providers.
# install with dev dependencies
pip install -e '.[dev]'
# run the test suite (25 tests)
pytest -q
# basic 3-step capability demo
genesis demo
# 3-heartbeat objective demo: acquire β compile β reuse
genesis objective-demoExpected output from objective-demo:
heartbeat 1: acquired_capabilities=["analyze.signal"], procedure_reused=false
heartbeat 2: procedure_compiled=true, procedure_reused=false
heartbeat 3: procedure_compiled=false, procedure_reused=true
| Feature | Module | Description |
|---|---|---|
| Persistent objectives | objectives.py |
Objectives survive individual runs; advanced through explicit heartbeats |
| Structured world model | world.py |
SQLite entity/relation graph holds durable state outside prompt context |
| Safe capability acquisition | acquisition.py |
Registers only verified adapters with trust β₯ 0.8; rejects critical-risk and offensive-security candidates |
| Provider routing | routing.py |
Multiple providers per capability; ranked by observed reliability minus cost and latency penalties |
| Procedure compilation | compiler.py |
Repeatedly successful plans promoted to reusable deterministic procedures after N successes |
| Learning / curiosity signals | learning.py |
Failures and weak outcomes generate stored questions for future investigation |
| Central policy gate | policy.py |
Every execution crosses one gate; providers cannot override a denial |
| Dependency planner | planner.py |
Topological sort of capability DAG with cycle detection |
| Episodic memory | memory.py |
Per-provider run history, procedure store, objective state, curiosity log |
| Evaluator | evaluator.py |
Outcome scoring per step; feeds routing and learning |
| CLI | cli.py |
genesis demo, genesis objective-demo, genesis capabilities |
A capability describes the logical operation independently of which provider performs it:
{
"name": "browser.navigate",
"description": "Navigate an approved browser session",
"tags": ["browser", "computer-use"],
"risk": "MEDIUM",
"permissions": ["browser_use"],
"provider": "browser-use",
"cost": 0.02,
"latency_ms": 800
}Multiple providers can register the same name. The router selects among them using observed outcomes, cost, and latency. Providers are swappable without changing the objective or policy.
On each heartbeat the runtime:
- Loads the persistent objective.
- Checks for a compiled procedure and reuses it if available.
- Otherwise resolves the dependency graph (topological sort).
- Attempts to acquire any missing capabilities from configured trusted sources.
- Routes each capability to a provider via the outcome-aware router.
- Authorises the selected provider through the policy gate.
- Executes and evaluates each step; stores episodes.
- Promotes the plan to a compiled procedure when the success threshold is reached.
- Updates objective and world-model state.
- Converts failures and weak scores into curiosity signals.
Genesis is designed for long-running autonomy without making the base runtime unrestricted.
| Hard stop | Default |
|---|---|
CRITICAL-risk capabilities |
Always denied |
offensive-security tagged capabilities |
Always denied |
defensive-security capabilities |
Require explicit owned_assets scope |
live-trading capabilities |
Require allow_live_finance=True |
HIGH-risk capabilities |
Require high_risk_execute permission |
| Unverified capability acquisition | Rejected (must be verified=True, trust_score β₯ 0.8) |
These are reference defaults enforced in policy.py. They are not a substitute for production governance β they establish the minimum safe baseline.
See docs/THREAT_MODEL.md for the full threat model.
src/genesis_os/
βββ types.py # Shared contracts: CapabilityManifest, Goal, RunResult, RiskTier, β¦
βββ policy.py # Central policy gate (the kernel security boundary)
βββ registry.py # Capability registry β multi-provider, discoverable
βββ planner.py # Dependency-aware topological planner with cycle detection
βββ routing.py # Outcome-aware provider router
βββ acquisition.py # Safe capability acquisition from trusted sources
βββ compiler.py # Procedure compilation: repeated success β reusable plan
βββ evaluator.py # Step outcome scorer
βββ learning.py # Curiosity signals from failures and weak outcomes
βββ memory.py # SQLite store: episodes, procedures, objectives, curiosity
βββ world.py # SQLite entity/relation world model
βββ objectives.py # Persistent objective control plane and heartbeats
βββ runtime.py # Closed-loop orchestration (the kernel)
βββ catalog.py # Demo registry, manifest loader, example capability source
βββ cli.py # CLI entry point
βββ __init__.py # Public API
Every design decision traces to one of these:
- Every action has a named capability.
- Every capability has a manifest and risk tier.
- Every execution crosses the policy gate.
- Every run has an immutable run identifier.
- Every meaningful outcome is evaluated and stored.
- Providers never write directly into another provider's private state.
- Long-lived knowledge is outside prompt history.
- A domain pack cannot weaken kernel policy.
- Self-extension means adding/versioning a capability, not silently rewriting the kernel.
- High-risk actions require stronger authorisation than reasoning/research.
| Layer | Storage | Lifetime |
|---|---|---|
| Working memory | Current run state dict |
Single run |
| Episodic memory | episodes table |
Persistent across runs |
| World / semantic memory | entities + relations tables |
Persistent |
| Procedural memory | procedures table |
Persistent; versioned by signature |
| Curiosity / learning | curiosity table |
Persistent until resolved |
from genesis_os import CapabilityManifest, RiskTier
from genesis_os.registry import CapabilityRegistry
registry = CapabilityRegistry()
registry.register(
CapabilityManifest(
name="search.web",
description="Execute a web search and return structured results",
tags=("search", "web"),
risk=RiskTier.LOW,
permissions=("web_search",),
provider="duckduckgo",
cost=0.001,
latency_ms=400,
),
handler=lambda state: {"results": ["β¦"]},
)from genesis_os import GenesisRuntime, Goal, ExecutionContext
runtime = GenesisRuntime(registry)
result = runtime.run(
Goal(
objective="Find recent news on AI safety",
required_capabilities=("search.web",),
metadata={"query": "AI safety 2025"},
),
ExecutionContext(approved_permissions={"web_search"}),
)
print(result.success, result.metadata)from genesis_os import GenesisRuntime, ObjectiveEngine, Goal
from genesis_os.memory import MemoryStore
from genesis_os.world import WorldModel
memory = MemoryStore("objectives.db")
world = WorldModel("world.db")
engine = ObjectiveEngine(GenesisRuntime(registry, memory=memory), memory, world)
record = engine.create(Goal("Monitor signals", ("analyze.signal",)))
# Each call advances the objective by one heartbeat
result = engine.heartbeat(record.objective_id)# install
pip install -e '.[dev]'
# lint
ruff check src/ tests/
# test
pytest -q
# smoke tests
genesis demo
genesis objective-demo
genesis capabilitiesgenesis-os/
βββ src/genesis_os/ # Library source
βββ tests/ # 25 pytest tests
βββ docs/ # Architecture, threat model, capability map, v0.2 spec
βββ domains/ # Domain pack descriptors (capital-markets, defensive-security, research)
βββ capabilities/ # manifest.schema.json β JSON Schema for capability manifests
βββ research/ # Upstream project validation notes
βββ pyproject.toml # Build, test, and lint configuration
βββ .github/workflows/ # CI: lint + tests + smoke tests on every push
Persistent objectives, safe acquisition, provider routing, procedure compilation, learning signals, world model, policy gate.
- MCP adapter with capability-manifest translation
- A2A peer adapter
- E2B / Firecracker-class sandbox provider
- Durable scheduler / heartbeat worker
- Model router and context-budget manager
- Signed capability packages and provenance
- Human approval service for elevated permissions
- Distributed run ledger and observability exporter
- Semantic / graph memory adapter
- Control-plane UI (objectives, capabilities, permissions, runs, learning signals)
The reference kernel does not ship production MCP/A2A adapters, distributed scheduling, a frontier-model router, remote sandbox execution, a human-approval service, or a web control plane. Those belong behind the interfaces already present β not inside the kernel.
- Fork the repo and create a branch from
main. - Make your change. Add or update tests β
pytest -qmust pass. - Run
ruff check src/ tests/β zero errors required. - Open a pull request with a clear description of the change and its motivation.
Bug reports and feature proposals are welcome as GitHub Issues.
The Genesis OS reference code in this repository is Apache-2.0.
Upstream projects referenced in docs/CAPABILITY_MAP.md and research/ remain governed by their own licenses.