Skip to main content

Sovereign Agent OS — Persistent Memory, Governance & Compliance for AI Agents

Project description

.brain — the portable decision log

The portable decision log your AI tools all read. One MCP server. Any AI tool. Plain files.

PyPI version License: MIT MCP Compatible NPM nucleus-mcp MCP server

Every AI coding session starts by re-explaining context the last session already knew. .brain is a folder in your repo that Claude Code, Cursor, and Codex all read via one MCP server. Decisions, policies, plans — written once, remembered across every session and every tool.

MIT licensed. File-based (plain JSON + markdown). No embeddings. No vendor lock-in.


Also included: nucleus-rabbithole

nucleus-mcp ships a second, fully independent tool: nucleus-rabbithole, a rabbit-hole depth tracker for focus-prone developers.

It gives your AI a push/pop depth stack, a context-switch thrash detector, an open-loop externaliser, and a weekly review — all backed by local SQLite, no network, no daemon.

# Already installed with nucleus-mcp — just run:
nucleus-rabbithole

Claude Code .mcp.json snippet:

{
  "mcpServers": {
    "nucleus-rabbithole": {
      "command": "nucleus-rabbithole",
      "args": []
    }
  }
}

Full documentation: docs/RABBITHOLE.md


Three Frontiers

The core loop that makes AI reliability compound over time:

  GROUND              ALIGN               COMPOUND
  ──────              ─────               ────────
  Machine verifies    Human corrects      System learns

  AI writes code  →  You fix a mistake →  Delta recorded
  GROUND checks   →  Verdict stored    →  DPO pair created
  Receipt logged  →  Event emitted     →  Training data grows
       │                   │                    │
       └───────────────────┴────────────────────┘
                    Reliability improves

GROUND — 5-tier execution verification. Syntax, imports, tests, runtime. Goes outside the formal system to check the AI's work.

ALIGN — One-call corrections. nucleus_align(action="correct", params={context, correction}). Each correction automatically records a verdict, creates a training pair, and emits an event.

COMPOUND — Deltas measure the gap between intent and reality. Recurring patterns become strategy. Negative deltas become training signal.

Every tool response shows frontier health:

[frontiers: GROUND 42 | ALIGN 12 | COMPOUND 28]

Quick Start

Option A — No install (ChatGPT, Claude, Perplexity):

Add https://relay.nucleusos.dev/mcp as a remote MCP server in your platform's connector settings. That's it — your AI now has persistent memory.

Option B — Local install (Cursor, Windsurf, Claude Desktop):

pip install nucleus-mcp
nucleus init --recipe founder

Two commands. Nucleus is running. AI outputs are now verified. nucleus init auto-configures your MCP client — just restart it.


What It Does

114 MCP tools across 13 facades:

  • GROUND — Execution verification (5 tiers: diff, syntax, imports, tests, runtime)
  • ALIGN — Human corrections (verdict + delta + DPO + event in one call)
  • Memory — Engrams that persist across sessions. Write once, recall forever.
  • Sessions — Save context, resume later. Session arc shows your last 3 sessions.
  • Tasks — Priority queue with escalation, HITL gates, and heartbeat monitoring.
  • Governance — Kill switch, compliance configs (EU DORA, MAS TRM, SOC2), audit trails.
  • Orchestration — Agent slots, multi-brain sync, task dispatch.
  • Archive — Training pipeline (SFT + DPO), delta tracking, frontier health dashboard.

Benchmark: decision-retention-evals — does your AI agent remember why the code is the way it is?


Nucleus Pro

Everything above is free (MIT). Nucleus Pro adds verifiable governance:

nucleus trial                              # 14-day free trial
nucleus compliance-check                   # Score your AI governance
nucleus audit-report --signed -o report.html  # Cryptographically signed report

$19/month or $149/yearnucleusos.dev/pricing

Free Pro
13 tools, 10 resources, 3 prompts Yes Yes
Persistent memory Yes Yes
Governance & HITL Yes Yes
Audit trails (DSoR) Yes Yes
Signed audit reports - Ed25519
Compliance exports Score only Full PDF/HTML
Priority issues - Yes

Install

One-Click

IDE Install
Cursor Add to Cursor
Claude Code npx -y nucleus-mcp
Any IDE pip install nucleus-mcp

pip / npx

pip install nucleus-mcp

Or use npx (zero Python setup required):

npx -y nucleus-mcp

Configure Your MCP Client

Claude Desktop / Cursor / Windsurf

Add to your MCP config (claude_desktop_config.json or equivalent):

{
  "mcpServers": {
    "nucleus": {
      "command": "npx",
      "args": ["-y", "nucleus-mcp"]
    }
  }
}
Alternative: use pip install directly
{
  "mcpServers": {
    "nucleus": {
      "command": "python3",
      "args": ["-m", "mcp_server_nucleus"],
      "env": {
        "NUCLEUS_BRAIN_PATH": "/path/to/your/project/.brain"
      }
    }
  }
}

Claude Code

Add to .mcp.json in your project root:

{
  "mcpServers": {
    "nucleus": {
      "command": "npx",
      "args": ["-y", "nucleus-mcp"]
    }
  }
}

Path Discovery

Nucleus finds your .brain automatically:

  1. NUCLEUS_BRAIN_PATH environment variable (explicit)
  2. Walk up from CWD looking for .brain/ directory
  3. Fall back to $HOME/.nucleus/brain

CLI

Nucleus has a full CLI alongside the MCP tools. Auto-detects TTY (table output) vs pipe (JSON).

# Memory
nucleus engram write my_key "insight here" --context Decision --intensity 7
nucleus engram search "compliance"
nucleus engram query --context Strategy --limit 10

# Tasks
nucleus task list --status READY
nucleus task add "Ship the feature" --priority 1

# Sessions
nucleus session save "Working on auth refactor"
nucleus session resume

# Health
nucleus status --health
nucleus sovereign

# Compliance
nucleus comply --jurisdiction eu-dora
nucleus audit-report --format html -o report.html

# Chat (multi-provider: Gemini, Anthropic, Groq)
nucleus chat

Pipe-friendly:

nucleus engram search "test" | jq '.key'
nucleus task list --format tsv | cut -f1,3

Compliance

One-command configuration for regulatory frameworks:

nucleus comply --jurisdiction eu-dora       # EU DORA
nucleus comply --jurisdiction sg-mas-trm    # Singapore MAS TRM
nucleus comply --jurisdiction us-soc2       # US SOC2
Jurisdiction Retention HITL Ops Kill Switch
eu-dora 7 years 5 types Required
sg-mas-trm 5 years 5 types Required
us-soc2 1 year 3 types Optional
global-default 90 days 2 types Optional

Telemetry

Nucleus collects anonymous, aggregate usage statistics (command name, duration, error type, versions, OS). No engram content, no file paths, no prompts, no API keys, no PII — ever.

nucleus config --no-telemetry
# or: NUCLEUS_ANON_TELEMETRY=false

See TELEMETRY.md for details.


Contributing

License

MIT © 2026 | hello@nucleusos.dev

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nucleus_mcp-1.14.1.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nucleus_mcp-1.14.1-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file nucleus_mcp-1.14.1.tar.gz.

File metadata

  • Download URL: nucleus_mcp-1.14.1.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for nucleus_mcp-1.14.1.tar.gz
Algorithm Hash digest
SHA256 c75b80aa06c2bcdc78566762630141e5fd9cd7b921e6f04aadb8526e6eea3fa3
MD5 3778ab572817806df2a47487e837dcab
BLAKE2b-256 743bef99ee484d388958559144972b9e37cf301ef846aecc2661400be662740d

See more details on using hashes here.

File details

Details for the file nucleus_mcp-1.14.1-py3-none-any.whl.

File metadata

  • Download URL: nucleus_mcp-1.14.1-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for nucleus_mcp-1.14.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03fef39ff2528b7088a99fdbcff1a480610cd88c72f9c3d361100e35a6bbe22a
MD5 bc36160dcc7d3dd35a1fec73b2c4361e
BLAKE2b-256 bfb5c1df5b5d54a215f034d6207cc7d022842a4789104873b75b298d016cbda3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page