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 runs shellbrain init for you. 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. Manual alternative: pipx upgrade shellbrain && shellbrain init.


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, automatic learning, and teaching 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. Fast mode and provider failures return a brief directly from that same pack.

Teach

Run shellbrain teach only when you explicitly want ShellBrain to remember something important.


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 admin doctor to inspect the installation. If it reports a problem, run shellbrain init. Do not run init every session.


Docs

Metadata

Release files for shellbrain 0.1.59

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.59
File Size Uploaded Provenance
shellbrain-0.1.59.tar.gz 445.8 kB With provenance Details

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / shellbrain-0.1.59.tar.gz

Download URL shellbrain-0.1.59.tar.gz
Size 445.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6946a48f6ca0e8b2b785668d2bf55e596a636d0d1b62f1ff0ea07233544bb679
BLAKE2b-256 checksum
How to use checksums
7f647449fd91f67d86248951db6d18dd09b0d22fc48c58e5034b07fac18746d6
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 22, 2026.

Transparency log

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

Download URL shellbrain-0.1.59-py3-none-any.whl
Size 612.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bc00d24a9f578d53fe9d60c9683d4c94ae5af7d64cf2379b7c06ffad888a7b7
BLAKE2b-256 checksum
How to use checksums
7b7122d53aa5f61d352d24aa54e1997c3de7ba9f00df4278c0cf22fed659e128
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 22, 2026.

Transparency log

Security for shellbrain 0.1.59

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.59.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 22, 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.59 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