v2.5.1 · mit · 201 mcp tools · sqlite

brainctl

────────────────────────────────────────────────────────────

memory that outlives the session.

A SQLite-backed memory layer for autonomous agents. Local-first. Typed. Neuroscience-grounded. 201 MCP tools plus 19 native plugins — agent frameworks (Claude Code, Codex CLI, Cursor, Eliza, Gemini CLI, Goose, Hermes, OpenClaw, OpenCode, Pi, Rig, Virtuals Game, Zerebro) and trading bots (Freqtrade, Jesse, Hummingbot, NautilusTrader, OctoBot, Coinbase AgentKit). Auto entity linking, quantum amplitude scoring, Thompson Sampling retrieval, 8-phase NREM/REM consolidation, and Q-value utility — backed by 120 peer-reviewed papers.

CA9mTxwi3r1NA3NwJobe1ooDE4H9McCbwTftdQsVyepump
quickstart
# install
$ pip install brainctl

# orient → work → persist
from agentmemory import Brain
brain = Brain(agent_id="my-agent")

ctx = brain.orient(project="api-v2")
brain.remember("rate-limit: 100/15s", category="integration")
brain.entity("RateLimitAPI", "service")
brain.wrap_up("auth module complete")
what it is

Agents forget. This is the fix.

Every agent session starts from zero. brainctl gives your agent a persistent brain it can read at session start, write to during work, and hand off to the next run.

sqlite, zero infra

The entire store lives in brain.db. WAL mode, foreign keys on, portable across machines. No Docker, no servers, no cloud vendor. Your memories live on your disk — no blobs rented from a chain, no queries billed by the MB, no relayer standing between your agent and its own past.

hybrid recall

FTS5 full-text search stacks on top of sqlite-vec embeddings via Ollama. Find memories by word or by meaning. Zero API spend on retrieval.

knowledge graph

Entities, observations, typed relations. Your agent builds a living model of people, services, projects, and decisions — not just a chat log.

handoff packets

One agent picks up exactly where another left off. Goal, state, open loops, next step — all preserved. Zero context loss across sessions.

any agent, any stack

Python API, CLI, and a 201-tool MCP server. 19 first-party plugins across agent frameworks (Claude Code, Codex CLI, Cursor, Eliza, Gemini CLI, Goose, Hermes, OpenClaw, OpenCode, Pi, Rig, Virtuals Game, Zerebro) and trading bots (Freqtrade, Jesse, Hummingbot, NautilusTrader, OctoBot, Coinbase AgentKit). Speaks stdio MCP to anything else (VS Code, Claude Desktop, Zed).

mit, forever

The software is free and will remain so under the MIT license, regardless of the token. The token funds the work; the code funds no one. No storage rent. No per-operation fees. No revocable access. The memory is yours, locally, for as long as you keep the file.

architecture

Caller → core → storage. All local.

Three layers sit between an agent and its memory. Everything below runs on your machine. No API calls on the hot path.

1 · caller surface
  caller
    ├── claude code · codex cli · cursor · openclaw
    ├── eliza · hermes · freqtrade · jesse
    ├── vs code · zed  (stdio mcp, no plugin needed)
    ├── ide / cli / python agent
    └── any stdio-speaking mcp client
          │
          ▼
  ┌────────────────────┐     ┌────────────────────┐
  │    Brain API       │     │    MCP server      │
  │    python library  │     │    201 tools       │
  └─────────┬──────────┘     └──────────┬─────────┘
            │                           │
            └─────────────┬─────────────┘
                          ▼
                     brain core
2 · core loop
  session
     │
     ▼
  orient  ────►  work  ────►  wrap_up
               │                  │
     ┌─────────┼──────────┐       ▼
     ▼         ▼          ▼    handoff_packets
  remember   decide    search      (next session)
     │         │          │
     ▼         ▼          ▼
  ┌────────────────────────────────────────────────┐
  │  every write  →  W(m) gate                       │
  │                  surprise score + semantic dedup│
  │                                                 │
  │  every read   →  hybrid retrieval                │
  │                  fts5 + sqlite-vec + rrf merge  │
  │                                                 │
  │  every conflict → AGM belief revision             │
  │                   ranked, collapsed, audited    │
  └────────────────────────┬───────────────────────┘
                           ▼
                       brain.db
3 · storage + consolidation
  brain.db   sqlite · wal · 59 tables · 50 migrations

  primitives
  ──────────
    memories         episodic + semantic, fts5 indexed
    events           temporal thread, causal chains
    entities         typed knowledge graph nodes
    knowledge_edges  typed relations between entities
    decisions        rationale + provenance ledger
    affect_log       emotional salience (VAD coords)
    agent_beliefs    per-agent AGM belief state
    dream_hypotheses consolidation-cycle conjectures
    handoff_packets  session-to-session state
    embeddings       sqlite-vec semantic vectors
    + 49 auxiliary (rbac, quarantine, workspace, audit, …)
                        │
                        │  quiet-hours cron
                        ▼
  ┌─────────────────────────────────────────────────┐
  │  dream cycle                                    │
  │  replay episodic → cluster → promote → decay    │
  │  hypothesis generation over the knowledge graph │
  └─────────────────────────────────────────────────┘

  local deps:  sqlite-vec  ·  ollama nomic-embed-text  (no api calls)
201
mcp tools
50
migrations
59
tables
19
shipped plugins
mint · v2.5

Sign a memory bundle, mint it on Solana.

brainctl export --sign --mint turns a signed memory bundle into a Light Protocol compressed token. AES-256-GCM ciphertext goes to Arweave; only the bundle hash + ciphertext URI are on chain. Your wallet owns the token. Mainnet + devnet, ~$0.0001 per mint.

the command, working in production
  # one-time setup
  $ pip install 'brainctl[mint]'
  $ cd ~/agentmemory/tools && npm install
  $ brainctl wallet new --yes
  $ solana airdrop 1 $(brainctl wallet address) --url devnet

  # mint a memory bundle to your wallet
  $ brainctl export --sign --mint --cluster devnet --json
  {
    "minted": true,
    "mint_address": "<base58 compressed-token mint>",
    "mint_tx_signature": "<Solana tx>",
    "arweave_metadata_uri": "ar://...",
    "arweave_ciphertext_uri": "ar://... (encrypted bundle)",
    "bundle_key_path": "~/.brainctl/keys/<mint>.key"
  }

cost

Light Protocol’s compressed-token program. Rent is sponsored by the protocol, so you only pay the Solana tx fee — about $0.0001 per mint at current SOL price.

encryption

Per-bundle AES-256-GCM key written to ~/.brainctl/keys/<mint>.key at mode 0600. The chain sees the bundle hash and the Arweave URI of the ciphertext. It does not see plaintext.

transfer

Standard Solana asset. Transferable from any wallet UI and indexable by Tensor, Magic Eden, Helius, etc.

custody

Your keypair lives at ~/.brainctl/wallet.json (mode 0600). brainctl reads it locally to sign. It is never transmitted.

the token

The community token will fund the work. The software stays free.

brainctl is and will remain MIT-licensed. The token exists so that the people building the memory layer for autonomous agents can afford to keep building it. No gatekeeping, no paywall, no closed source. Every dollar in and out of the dev wallet is published live on /transparency. The ticker has not been finalised and is intentionally not published yet — anything circulating with a brainctl-style symbol ahead of an announcement here is not us.

status · live
  the token is live on pump.fun.

  contract address  9mTxwi3r1NA3NwJobe1ooDE4H9McCbwTftdQsVyepump
  pump.fun          pump.fun/coin/9mTxwi3r1NA3NwJobe1ooDE4H9McCbwTftdQsVyepump

  verify the CA against this page before buying — anything
  else trading under a brainctl-style ticker is not us.
  the dev wallet below is live and every inflow/outflow is
  on /transparency.
dev wallet
  balance   7.67 SOL
  30d in    3.94 SOL
  30d out   3.01 SOL
  wallet    Emajxa…ePRo4i
  source    helius · ISR 60s

  last flows
    48m ago   → −0.0001 SOL     to   3AVi…Z6jT  5i75X…XR3u ↗
    48m ago   → −1 SOL     to   AzNY…6JRv  5i75X…XR3u ↗
    48m ago   → −0.002 SOL     to   AzNY…6JRv  5i75X…XR3u ↗

  → full ledger on /transparency
ticker
withheld until launchany token in market today claiming to be brainctl is not us
launchpad
pump.fun
chain
solana
planned supply
1,000,000,000
team allocation
none — fair launch
utility
funds ongoing dev + research
marketplace

An open market for signed memory bundles.

Sellers publish signed bundles. Buyers pay in SOL. The chain records every listing, offer, accept, and settlement as a Solana memo plus an Arweave manifest — anyone can run their own indexer. The API + CLI are live now; the human-facing browse + buy UI lives at /marketplace.

what’s live · what comes next
  live now:
    brainctl.org/api/marketplace  · 13 REST routes
    brainctl marketplace api ...  · python CLI (v2.6+)
    brainctl.org/marketplace     · browse open listings

  pricing:    USD-pegged, $10,000 cap per listing
  fee:        2.5% protocol fee at settle (atomic with seller transfer)
              + flat $0.10 on each list/offer/counter/accept/etc.
              + $0.50 on mint, $0.10 on --pin-onchain (devnet free)
  settlement: SOL today. post-launch, the community token via
              one env flip; buyers still pay in SOL with an
              inline Jupiter swap, so no token to pre-acquire.

  this saturday:
    - community token launches on pump.fun (ticker withheld
      until launch — anything circulating now is not us)

chain-canonical state

Every listing, offer, counter, accept, reject, withdraw, settle, and release is a signed Solana memo plus an Arweave manifest. brainctl.org indexes them; you can build your own indexer from the same chain data.

provenance

Each bundle carries the creator’s ed25519 signature. The marketplace surfaces the seller wallet’s history — earlier listings, sales, the age of the wallet — so a buyer can weigh provenance before paying.

encryption

Bundles are AES-256-GCM encrypted client-side before they touch Arweave. At sale time the seller’s daemon NaCl-SealedBoxes the per-bundle key to the buyer’s wallet-derived X25519 pubkey. Only the buyer’s wallet can decrypt.

buyer safeguards

Schema validation at decrypt. Quarantined ingest into scope=imported:<listing>; purchased memories don’t touch the buyer’s primary scope until they explicitly promote them. Prompt-injection regex scan on contents.