Metadata-Version: 2.4
Name: brain-neural-core
Version: 1.0.11
Summary: Brain — Engineering memory for AI-assisted teams
Author-email: BrainLedger Solutions <brainledger.solutions@gmail.com>
License-Expression: FSL-1.1-ALv2
Project-URL: Homepage, https://brainledger.solutions
Project-URL: Playground, https://try.brainledger.solutions/
Keywords: ai,agents,engineering-memory,mcp,llm,code-context,git,developer-tools,knowledge-base
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: GitPython>=3.1.43
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: click>=8.1.7
Requires-Dist: rich>=13.7.1
Requires-Dist: mcp<2,>=1.29
Provides-Extra: openai
Requires-Dist: openai>=1.35.0; extra == "openai"
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.28.0; extra == "anthropic"
Provides-Extra: google
Requires-Dist: google-generativeai>=0.7.0; extra == "google"
Provides-Extra: groq
Requires-Dist: openai>=1.35.0; extra == "groq"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Provides-Extra: all-cloud
Requires-Dist: openai>=1.35.0; extra == "all-cloud"
Requires-Dist: anthropic>=0.28.0; extra == "all-cloud"
Requires-Dist: google-generativeai>=0.7.0; extra == "all-cloud"
Provides-Extra: docs
Requires-Dist: python-docx>=1.1.0; extra == "docs"
Requires-Dist: pypdf>=4.0.0; extra == "docs"
Provides-Extra: all
Requires-Dist: openai>=1.35.0; extra == "all"
Requires-Dist: anthropic>=0.28.0; extra == "all"
Requires-Dist: google-generativeai>=0.7.0; extra == "all"
Requires-Dist: python-docx>=1.1.0; extra == "all"
Requires-Dist: pypdf>=4.0.0; extra == "all"
Dynamic: license-file

# Brain

![License: FSL-1.1-Apache-2.0](https://img.shields.io/badge/license-FSL--1.1--Apache--2.0-blue.svg)
![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)
![Status: Beta](https://img.shields.io/badge/status-beta-orange.svg)
![MCP server](https://img.shields.io/badge/MCP-server-8A2BE2.svg)

**Engineering memory for AI coding agents.** Brain captures the decisions, rules and past
failures in your repository on every push, keeps them in git next to your code, and hands them
to your agent (Claude Code, Cursor, Copilot, Windsurf, Cline) before it edits a file.

Deterministic by default: no LLM, API key or network needed. Nothing leaves your machine.

**Try it in your browser:** [try.brainledger.solutions](https://try.brainledger.solutions/)

## Install

```bash
pipx install brain-neural-core      # or: pip install brain-neural-core
brain setup                         # wire your repos, seed memory, check your agent can reach Brain
```

Then restart your editor and approve the `project-brain` server when it asks. `brain doctor`
confirms the connection with a real handshake.

## What it does

- **Captures** on every push and merge, from your commits and code: decisions, constraints,
  business rules, past failures, trade-offs, intents and technical debt.
- **Serves** each file's rules to your agent before it edits that file, over MCP, and writes them
  to `AGENTS.md` for agents without MCP.
- **Asks a person.** Uncertain items, and anything that contradicts a settled decision, wait in
  `brain review`. Accepting a replacement records what changed, when and by whom.
- **Learns from every change.** Agents end their commits and pull requests with a short
  `## Brain notes` block (decisions, rules, dos and don'ts); Brain captures it for review.
- **Stays local.** Memory is plain JSON in your repository. Secrets are scrubbed before anything
  is stored. What Brain does is logged on your machine only, and nothing is sent anywhere.

## Commands

| Command | What it does |
|---|---|
| `brain setup` | Check the machine, wire repositories, verify an agent can reach Brain |
| `brain init` | Wire the current repository (hooks and editor config); run once per clone |
| `brain doctor` | Verify the setup, with a real MCP handshake |
| `brain status` | What Brain knows about this repository |
| `brain review` | Accept or reject captured memory |
| `brain search <words>` | Search the memory |
| `brain context --file <path>` | Show what your agent receives for a file |
| `brain forget <text-or-id>` | Remove a wrong item so it does not come back |
| `brain value` | What Brain has actually changed for you |
| `brain upgrade` | Check what an upgrade needs and print the exact command |
| `brain uninstall` | Remove Brain's wiring from a repository; memory is kept |

`brain --help` lists the rest.

**Optional extras:** `[anthropic]`, `[openai]`, `[google]` or `[groq]` add an LLM enrichment pass
(`brain init --llm`, with your own key). `[docs]` reads `.docx` and `.pdf` files at push, not by
`brain bootstrap`.

## If your agent does not see Brain

- **Restart, then authorise.** An agent's tools are fixed when a session starts, so reopen the
  editor (or start a new agent session) after `brain setup`. Then authorise the server: in Claude
  Code, accept the prompt to trust the project; in Cursor, Windsurf or Cline, enable
  `project-brain` in the MCP settings.
- **Where the config is.** `brain init` writes `.mcp.json` (Claude Code), `.cursor/mcp.json`,
  `.windsurf/mcp.json` and `.cline/mcp_settings.json`, each holding the absolute path of
  `brain-mcp-server` on this machine, so git ignores them. If Claude Code never offers the server:
  `claude mcp add project-brain brain-mcp-server -e "BRAIN_REPO_ROOT=/path/to/your-repo"`, then
  `claude mcp list`.
- **After a reboot** there is nothing to restart: the server is not a background service, and your
  editor starts it on demand. What breaks the link is moving the executable (`pipx reinstall`, a
  Python upgrade, switching between pip and pipx): run `brain init` again, then `brain doctor`.
- **Is capture running?** `brain doctor` reports `capture is running`, `capture is STALE` (commits
  landed without it) or `capture never ran here`, which is expected in a fresh clone because git
  hooks are never cloned: run `brain init` there.

## On a team

Memory is committed, so everyone shares it through `git pull` and `git push`. Git does not clone
hooks, so each teammate runs `brain init` once in their clone. Keep everyone on one version
(`pipx install brain-neural-core==<version>`) and upgrade together.

## Status

Beta. Capture, conflict handling and MCP serving are in daily use and tested on Windows and
Linux. Extraction is not perfect: expect to prune the occasional item with `brain review` or
`brain forget`, and please report anything that looks wrong.

## License

Source-available under **FSL-1.1-Apache-2.0** (SPDX: `FSL-1.1-ALv2`): free for internal and most
uses. The full text ships as `LICENSE.md` inside the package.
