Skip to main content

ShellBrain logo

ShellBrain

Long-term Memory for AI Agents.

ShellBrain carries useful lessons from one agent task to the next. It preserves decision reasons, failed approaches, product direction, and preferences that the resulting code does not explain.

Install

curl -L shellbrain.ai/install | bash

Works for Codex, Claude Code, and Cursor. The installer configures the runtime automatically. Repos register themselves on first use.

Requirements.

  • macOS or Linux, Python 3.11+, Docker for the managed local Postgres+pgvector runtime.

Upgrade for latest capabilities

shellbrain upgrade

You can also run curl -L shellbrain.ai/upgrade | bash.


Recall in one command

ShellBrain recall uses vector search and BM25 to search your memories. An inner recall agent summarizes the search results.


Architecture

ShellBrain stores evidence and two forms of reusable knowledge:

  • Episodic knowledge records evidence. It stores prompts, agent steps, tool calls, and outputs from each session.
  • Empirical knowledge extracts concrete memories. It organizes problems, solutions, failed tactics, facts, preferences, and changes in a semantic graph for case-based reasoning.
  • Conceptual knowledge abstracts reusable ideas. Its concept graph connects claims, relations, and implementations to empirical knowledge.

Memories and concept claims link to supporting evidence. A concept can express a product principle without a duplicate memory. Current code remains the source of truth for implementation details.


How Agents Use ShellBrain

Recall

Working agents run shellbrain recall to get one compact brief for the current task.

Recall and automatic learning use the same evidence selector. It combines BM25, vector similarity, and graph links. Learning agents receive the selected records. The recall agent can summarize them.

Recall receives only the quoted query. Include the relevant task, failure, subsystem, or decision in the question.

shellbrain recall "What is ShellBrain, and how does it help a working coding agent?"

Response format:

{
  "status": "ok",
  "data": {
    "brief": {
      "summary": "...",
      "constraints": ["..."],
      "known_traps": ["..."],
      "prior_cases": ["..."],
      "concept_orientation": ["..."],
      "anchors": ["`README.md`"],
      "conflicts": ["..."],
      "gaps": ["..."],
      "next_checks": ["..."]
    },
    "fallback_reason": null
  },
  "errors": []
}

Recall selects an evidence pack in code, then asks an inner agent to summarize it. Source attribution comes from the selected records. Provider failures return a brief directly from that same pack.

Recall provider

Codex is the default. Choose one provider for recall across repositories:

shellbrain admin recall provider inception
shellbrain admin recall provider codex
shellbrain admin recall provider claude

For faster recall with Mercury, set your Inception API key and select Inception:

export INCEPTION_API_KEY="your-inception-api-key"
shellbrain admin recall provider inception

Start your agent host with that environment. .env files are not loaded automatically. Automatic memory building is unchanged.

Selection is stored in ~/.shellbrain/recall-provider.toml (or under SHELLBRAIN_HOME). API failures return deterministic context with failure metadata. The API uses a 10-second socket timeout and no automatic retries; a slowly trickling response can exceed that elapsed time.


Memory Discipline

ShellBrain keeps memory grounded in evidence and narrow in scope. Agents request memory when they need it.

Memory that cannot justify itself should not persist.


Use ShellBrain

Use Shellbrain with your preferred agent. Then work as usual.

  • Claude Code: Use /shellbrain to recall context at task boundaries.
  • Codex: Use $shellbrain to recall context at task boundaries.
  • Cursor: Use /shellbrain to recall context at task boundaries.

Repair

Run shellbrain upgrade to repair an existing installation. Setup and schema migrations run automatically.


Docs

Metadata

Release files for shellbrain 0.1.60

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shellbrain 0.1.60
File Size Uploaded Provenance
shellbrain-0.1.60.tar.gz 360.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for shellbrain 0.1.60
File Interpreter ABI Platform
shellbrain-0.1.60-py3-none-any.whl Python 3 none any Details

Total release size: 881.8 kB

Release files / shellbrain-0.1.60.tar.gz

Download URL shellbrain-0.1.60.tar.gz
Size 360.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dae589afdea5fa67369ea1e0705e1c3e09fc9f3a430dbe012886b09958dea3f0
BLAKE2b-256 checksum
How to use checksums
ad664198953368f08f189572dae40370c72682e58faa397fdc3b0bab3328f930
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release files / shellbrain-0.1.60-py3-none-any.whl

Download URL shellbrain-0.1.60-py3-none-any.whl
Size 521.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0968886c2629af9a31a1a79d06b8e429ffaf1c83a04f891ab7b9e7fad5c14455
BLAKE2b-256 checksum
How to use checksums
c172b91a6af449fdeb8eb309de36454cd86f3ded3144a929ccbc3bc741db3a95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Security for shellbrain 0.1.60

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for shellbrain-0.1.60.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.60 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page