Skip to main content

Persistent memory for AI coding agents. Your agent learns your codebase the way a senior engineer would — what files go together, what you usually edit next, what patterns matter. Works with Claude Code, Cursor, Cline, Continue, and any MCP-compatible agent. 100% local. Side effect: 12-50× cheaper code questions.

Project description

🧠 NeuralMind

PyPI version Downloads CI Self-benchmark License: MIT Python 3.10+ Local-First

Persistent memory and context compression for AI coding agents. Your agent learns your codebase the way a senior engineer would — what goes together, what you usually touch next — and remembers it across sessions. 100% local, no telemetry. Side effect: 12–50× cheaper code questions, measured in CI on every commit.

After install, your agent:

  • Boots with SYNAPSE_MEMORY.md (learned associations, strongest hub files)
  • Receives PostToolUse compression automatically (Bash output → errors + signals)
  • Queries your codebase in ~800 tokens instead of ~50,000

Works out of the box with Claude Code, Codex, Cursor, and Cline. Any other MCP agent: neuralmind install-mcp --all

Website: neuralmind.uk · Docs: docs.neuralmind.uk · Changelog: CHANGELOG.md · Release notes: docs/releases/

Graph view — force-directed code graph with the Hebbian synapse overlay


⚡ 30-second proof — see the memory work

The clearest evidence the memory is working is the measurable side effect: the agent stops re-loading context it already understood. Reproduce it on a fresh clone:

git clone https://github.com/dfrostar/neuralmind && cd neuralmind
bash scripts/demo.sh

The script creates an isolated venv, installs the deps, builds the index for the bundled fixture project, and runs three real questions. Output looks like:

  Q: How does authentication work in this codebase?
     naive = 4,736 tok   neuralmind =  829 tok   reduction =   5.7×

  Average reduction:   5.5×  across 3 queries
  Avg context size:    859 tokens  (vs 4,736 naive)

The fixture is intentionally tiny (~500 lines) — it runs in CI as a regression gate. Real repos measure 12–50× on the same pipeline (benchmarks · measured production results). Then get your own number:

pip install neuralmind
cd /path/to/your-repo
neuralmind build .
neuralmind benchmark .

🚀 Quick start

Method Command
pip pip install neuralmind
pipx pipx install neuralmind (global CLI, no env pollution)
uv uv pip install neuralmind
Docker docker pull ghcr.io/dfrostar/neuralmind:latest (multi-arch, published on every release)
Source git clone https://github.com/dfrostar/neuralmind && pip install -e .

No external tools required — a built-in tree-sitter backend indexes Python, TypeScript, Go, Rust, Java, C, C++, C#, Ruby, and PHP out of the box, and the default index is ChromaDB-free (smaller deps, 8–16× smaller index, same answer quality). Full path-by-path walkthrough: install paths.

cd your-project
neuralmind build .          # index the codebase (tree-sitter, ~seconds to minutes)

neuralmind wakeup .         # what the agent sees at session start
neuralmind query . "How does authentication work?"
neuralmind impact MyClass --depth 2   # blast radius: callers, importers, subclasses

neuralmind install-hooks .  # Claude Code: automatic PostToolUse compression
neuralmind serve .          # Obsidian-style graph view in your browser
neuralmind savings . --cost # measured token savings, priced for your model
neuralmind doctor           # verify the install end to end

🧠 What you get

  • Progressive context disclosure (L0–L3). A question costs ~800 tokens, not your whole repo. The agent asks for more depth only where it needs it.
  • A synapse layer that learns. Hebbian co-activation strengthens edges between code that's used together; unused edges decay. Recall is spreading activation over that graph — your agent's context gets better the more you work.
  • Session memory. SYNAPSE_MEMORY.md is exported for Claude Code so every session boots already knowing the hub files and learned associations.
  • Tool-output compression + recovery. PostToolUse hooks compress noisy Bash output to errors + signals, and a recovery cache brings back tool output the context window dropped.
  • Team memory. neuralmind memory publish commits a learned-weights bundle (no source code) that teammates' agents inherit on their next session — a fresh clone starts with the team's earned intuition.
  • MCP server for any agent. Claude Code, Codex, Cursor, Cline, Continue, or anything MCP-compatible: neuralmind install-mcp --all.
  • Graph view. neuralmind serve renders the index as a force-directed, community-coloured graph with the synapse overlay — backlinks, semantic quick-switcher, clickable neighbours. There's also a VS Code extension.
  • Team tier ($29/user/mo). Governance, append-only hash-chained audit log, seat management, self-hosted deployment. MIT core stays MIT — the Team tier only activates with a license. See pricing.

How it works under the hood: Architecture · brain-like learning.


📊 Benchmarks

Measured, not marketed — the numbers are produced by CI on every commit (every merged PR carries a sticky benchmark comment) and reproduce locally with python -m tests.benchmark.run:

  • 100% gold-file recall at 38–85× fewer tokens on the public benchmark.
  • Synapse recall A/B: +11 points top-k hit rate at ±0 token cost.
  • Real production rebuild: 48.8× average reduction, 1,033 tokens/query (full field report).
  • Backend parity gate: the built-in tree-sitter backend is held within tolerance of the legacy graphify backend on every PR.

Benchmark chart

Methodology, gold sets, and community submissions: benchmarks/ · public methodology · honest assessment (when NOT to use this).


🔒 Security & Compliance

  • 100% local engine. NeuralMind makes zero network calls of its own and ships no telemetry. Only the minimal relevant slice of code ever reaches your AI tool.
  • CycloneDX SBOM per release, hash-chained audit log (Team tier), signed licenses (Ed25519), tarball integrity instructions on every release.
  • Live posture page: neuralmind.uk/security · Policy: SECURITY.md · Compliance summary · SDLC policy

Behavior toggles: NEURALMIND_BYPASS=1 (skip compression), NEURALMIND_SYNAPSE_INJECT=0 (skip prompt-time recall), NEURALMIND_SYNAPSE_EXPORT=0 (skip memory export), NEURALMIND_TEAM_MEMORY=0 (skip team-bundle import). All fail-open.


📚 Documentation

I want to… Read
Install and set up Setup guide · Installation
See every command CLI reference
Wire up my agent (MCP) Usage · wiki Home
Understand the design Architecture · Limits & failure modes
Follow real workflows Use-case walkthroughs (20+)
Compare with alternatives Comparisons
Evaluate for a team
Run on multiple codebases
Upgrade safely
See what changed CHANGELOG · release notes · ROADMAP

❓ FAQ

How is this different from RAG? RAG retrieves similar text. NeuralMind maintains a weighted graph of your code and learns from use — retrieval is spreading activation over structural edges plus Hebbian synapses, disclosed progressively so the agent pays only for the depth it needs.

Does my code leave my machine? No. The engine is fully local. Your agent still talks to its own model — NeuralMind just makes what it sends smaller.

What if it doesn't help on my repo? Run neuralmind benchmark . and read the number. If it's not worth it, uninstall — and see the honest assessment for when that's the right call.

Is the paid tier required? No. The core is MIT and complete. The Team tier adds governance, audit, and seat management for organizations.


🤝 Contributing

Contributions welcome — see CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SUPPORT.md. Tests live in tests/; pytest tests/ must pass (the synapse layer's tests are stdlib-only). Security reports: see SECURITY.md.

📄 License

MIT for the core — see LICENSE. The optional Team tier is licensed separately — see LICENSE-COMMERCIAL.md.

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

neuralmind-2.0.1.tar.gz (539.8 kB view details)

Uploaded Source

Built Distribution

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

neuralmind-2.0.1-py3-none-any.whl (527.9 kB view details)

Uploaded Python 3

File details

Details for the file neuralmind-2.0.1.tar.gz.

File metadata

  • Download URL: neuralmind-2.0.1.tar.gz
  • Upload date:
  • Size: 539.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for neuralmind-2.0.1.tar.gz
Algorithm Hash digest
SHA256 0f9bd5e3398fdd499c5472cdeeebf8172559f0f23ad7ef1ff499d7cb1f4ef4f7
MD5 aea1c4fd9ceda1d56dc7db438d1092f0
BLAKE2b-256 bac3e9f841c696beb132bb2c0533b46a3b1e249fe27d0808ab30b8c73d037736

See more details on using hashes here.

Provenance

The following attestation bundles were made for neuralmind-2.0.1.tar.gz:

Publisher: release.yml on dfrostar/neuralmind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file neuralmind-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: neuralmind-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 527.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for neuralmind-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef9fb5172bee3cd51f298c4f137be5903bfdbe07874c3a8b8791f5227f8c3bba
MD5 e3dab763417ddd0aca86a03cd4f51fc4
BLAKE2b-256 1565cab83f3c5267a4d184854aa421e24ee836f22d727ce430be5622004fd2aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for neuralmind-2.0.1-py3-none-any.whl:

Publisher: release.yml on dfrostar/neuralmind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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