Skip to main content
Glama

AI-BRAIN

Your AI coding tools forget everything when you close a session. AI-BRAIN gives Claude Code, OpenAI Codex, Cursor, and Antigravity a shared memory on your computer using a local folder of plain Markdown files.

When you make a decision in Cursor, it is saved locally and available the next time you open Claude Code or Codex, without copying and pasting context.

  • Switch between Cursor, Claude Code, Codex, and Antigravity without re-explaining your project.

  • Keep everything in plain Markdown files (compatible with Obsidian) indexed by local SQLite FTS5.

  • Run it with Python 3.9+ standard library only. No pip install, no Docker, and no external API keys.

Start in Cursor, Continue in Claude Code (15-Second Demo)

AI-BRAIN Cross-Agent Memory Demo

[10:02 AM — Cursor]
You: "Let's use PostgreSQL with row-level security for multi-tenancy."
Cursor (via brain-memory): Captures decision -> ~/AI-Brain/50_Memory/Semantic/Multi-Tenancy Auth.md
                           (Secrets auto-redacted, deduplicated, indexed in <5ms)

[10:15 AM — Claude Code / Antigravity / Gemini CLI]
You: "Implement the billing endpoint."
Claude (via brain-memory): Silently retrieves "Multi-Tenancy Auth.md" before answering
Claude: "I'll add the billing endpoint using PostgreSQL RLS tenant isolation as decided..."

Related MCP server: EleSync

Try it in 1 Command

Paste one command in your terminal. It creates your local vault, initializes SQLite FTS5, and configures your installed MCP clients (Claude Code/Desktop, Cursor, Antigravity) without manual JSON editing.

Option A: Zero-clone with uvx (60 seconds)

uvx --from git+https://github.com/robertomontella/obsidian-ai-brain ai-brain-setup --mode fresh --dest ~/AI-Brain --agents all --non-interactive

Option B: Interactive wizard after cloning

git clone https://github.com/robertomontella/obsidian-ai-brain.git && cd obsidian-ai-brain && python3 setup.py

Already have an Obsidian vault? Run with --mode index --vault /path/to/your-vault --writable-inbox AI-Memory to index your existing notes in read-only mode while keeping new AI memories isolated in AI-Memory/.

What Problem It Solves

Without AI-BRAIN

With AI-BRAIN

Session amnesia forces you to re-explain your stack, rules, and past decisions.

Decisions and conventions are captured automatically and recalled before you ask.

Cursor, Claude Code, Codex, and Antigravity each keep separate context.

Every MCP agent reads and writes to the same local Markdown vault.

Cloud memory services store your code and notes on external servers.

Everything runs offline on SQLite FTS5 and Markdown with automatic secret redaction.

Heavy setups require Docker, vector databases, or extra Python packages.

Pure Python 3.9+ stdlib delivers sub-15ms BM25 search and 5-level deduplication.

How AI-BRAIN is Structured

AI-BRAIN Architecture

Privacy & Security

  • All indexing, retrieval, and storage happen on your machine. Nothing is sent to external clouds, third-party vector databases, or telemetry endpoints.

  • Runs offline using Python's standard library, with no accounts, API keys, or subscriptions.

  • A multi-pass regex sanitizer scrubs private keys, JWTs, OpenAI/Anthropic/Google API keys, GitHub tokens, Slack tokens, Bearer headers, and passwords before writing to disk.

  • The vault lives outside your git repositories (by default at ~/AI-Brain) so personal notes and database files are not committed by mistake.

  • Licensed under the MIT License.

Available Tools

13 tools
brain_add_memoryB

Salva una nuova memoria nel vault con sanitizzazione anti-leak automatica e indicizzazione FTS5 immediata.

Inputs: title (required), content (required), tags, project, +3 more.

brain_archive_memoriesA

Archivia esplicitamente in 40_Archive/ le memorie inattive o indicate (mai invocata implicitamente durante search/read/add/sync).

Inputs: ids, paths, dry_run, older_than_days, +1 more.

brain_auto_captureB

Alias per brain_add_memory per salvataggio autonomo di decisioni o conoscenze (accetta text o content e deriva il titolo se omesso).

Inputs: tags, text, title, content, +5 more.

brain_auto_retrieveB

Alias per brain_search_memory per auto-retrieval contestuale usando prompt/query con ranking FTS5 BM25 + recency.

Inputs: tag, limit, query, prompt, +2 more.

brain_crew_log_readA

Legge gli entry più recenti dal Crew Logbook (50_Memory/Working/crew_log.md). Restituisce entries in ordine cronologico inverso (più recenti prima).

Inputs: limit.

brain_crew_log_writeB

Scrive un entry di handoff nel Crew Logbook (50_Memory/Working/crew_log.md). Registra agente, attività, file toccati e punti aperti per il prossimo agente. Sanitizzazione zero-leak automatica.

Inputs: agent (required), activity (required), files, project, +1 more.

brain_lintA

Esegue un controllo di integrità read-only sul vault (wikilink rotti, note orfane, frontmatter incompleto e disallineamenti superseded).

Inputs: db_path, vault_path.

brain_log_handoffA

Writes a handoff entry to the Crew Logbook (50_Memory/Working/crew_log.md). Records agent, activity, files, and open items for the next agent. Alias for brain_crew_log_write with English parameter names.

Inputs: agent (required), activity (required), files, project, +1 more.

brain_memory_statsA

Restituisce metriche e statistiche aggregate sul database di memoria (conteggio per layer, stato WAL, dimensione DB).

Inputs: no named parameters.

brain_read_crew_logA

Reads the most recent entries from the Crew Logbook (50_Memory/Working/crew_log.md). Alias for brain_crew_log_read with English parameter names. Returns entries in reverse chronological order (most recent first).

Inputs: limit.

brain_read_memoryB

Legge il contenuto completo e i metadati di una memoria dato il suo percorso (path) nel vault o ID deterministico.

Inputs: path (required).

brain_search_memoryB

Cerca nella memoria a lungo termine usando FTS5 BM25 per trovare decisioni, architetture o fatti rilevanti.

Inputs: query (required), tag, limit, project, +1 more.

brain_syncB

Sincronizza bidirezionalmente i file Markdown del vault con l'indice SQLite FTS5 (scansione ricorsiva, rilevamento modifiche via hash, rimozione note eliminate).

Inputs: dry_run, vault_path.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 13 tools

    Disambiguation2/5

    Four tools are explicit aliases of others (brain_auto_retrieve=brain_search_memory, brain_auto_capture=brain_add_memory, brain_log_handoff=brain_crew_log_write, brain_read_crew_log=brain_crew_log_read), giving the agent no principled way to choose between duplicates that differ only in parameter language. The remaining tools are distinct, but nearly a third of the surface is redundant.

    Naming Consistency3/5

    All tools use a brain_ snake_case prefix, which is readable, but the word order varies (brain_memory_stats vs brain_search_memory vs brain_crew_log_write vs brain_read_crew_log), mixing prefix_object_verb and prefix_verb_object patterns. The same operation is also named two different ways (crew_log_write vs log_handoff), undermining predictability.

    Tool Count3/5

    13 tools is within a reasonable range for a memory vault server, but four of them are pure aliases, so the effective surface is ~9 functions padded out with duplicates. The inflation is borderline rather than extreme.

    Completeness3/5

    The surface covers search, read, add, sync, archive, stats, lint, and crew-log handoff well, but no update/edit operation exists for an existing memory, leaving a notable gap in the lifecycle. Archiving serves as a soft-delete, but revision of stored content is a dead end.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      A local-first shared memory layer for MCP-aware agents like Claude, Codex, and Hermes, enabling persistent memory across chats and clients via Markdown files and SQLite FTS.
      6
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude Code, Codex and other MCP agents to share one bounded, persistent memory across sessions, so a session starts from what earlier sessions learned instead of re-reading the repository. Storage and retrieval run locally on SQLite full-text search with per-client tokens and scopes, and optional local model enrichment, without any paid model in the path.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Gives every MCP-capable AI agent a shared, local-first memory store, letting them save, search, update, and delete preferences, decisions, and facts kept as plain Markdown files versioned in git. Memories are ranked by relevance on recall and shared across Claude Code, Cursor, Codex, and any other MCP client.
      MIT