Skip to main content

CrossAgentMemory 🧠

Open-source cross-agent memory layer for AI coding agents.

Your AI agent should remember what you built yesterday, why you rejected that approach last week, and that you prefer async/await over callbacks.

CrossAgentMemory makes that happen.

CI Python 3.10+ License: MIT


The Problem

Every time you start a new session with Claude Code, Codex, or Cursor, your agent remembers nothing. You re-explain your codebase. You re-teach your preferences. You burn tokens and patience.

CrossAgentMemory fixes session amnesia.


Features

Feature Status Description
Local-first storage ✅ SQLite database on your machine. No cloud. No API keys.
Cross-agent ✅ Works with Claude Code, Codex, Cursor, Gemini CLI, or any agent that reads text.
Semantic search ✅ Find memories by meaning, not just keywords. Pure numpy — no heavy deps.
Auto-summarize ✅ Generate project/session summaries automatically.
Confidence decay ✅ Old memories fade. Important ones stick.
Memory reinforcement ✅ Boost confidence when a memory is validated.
CLAUDE.md sync ✅ Auto-generates CLAUDE.md from memory. Claude Code reads it automatically.
Git hooks ✅ Auto-sync CLAUDE.md on every commit.
Auto-capture ✅ Capture from git log, shell history, and Claude sessions automatically.
Team sync ✅ Share memories via .crossagentmemory/ folder in your repo.
MCP server ✅ Expose CrossAgentMemory as an MCP server for Cursor/Copilot/Claude.
Web dashboard ✅ Browse, search, and manage memories in a local web UI.
Shell integration ✅ Auto-inject context into Claude Code via shell aliases.
Background daemon ✅ Silent auto-capture while you work.
Memory graph ✅ Visualize relationships between memories.
Mem0 importer ✅ Migrate from Mem0 to CrossAgentMemory.
Social sharing ✅ Auto-post milestones to Twitter/LinkedIn.
VS Code extension ✅ Capture memories directly from your editor.
LLM summarization ✅ GPT/Claude-powered project & session summaries.
Smart auto-tagging ✅ LLM-generated tags for every memory.
Conflict detection ✅ Detect contradictory memories automatically.
REST API ✅ Full HTTP API for any integration.
Backup & restore ✅ Export/import memories, projects, and embeddings as .zip or .json.
Config file ✅ ~/.crossagentmemory/config.yaml for persistent backend and LLM settings.
FTS5 search ✅ Ranked full-text search with SQLite FTS5 (falls back to LIKE).

Install

pip install crossagentmemory
# or
pipx install crossagentmemory
# or
uv tool install crossagentmemory

Quick Start

1. Initialize memory for your project

cd my-project
crossagentmemory init

2. Capture memories as you work

crossagentmemory capture "Chose PostgreSQL over MongoDB for ACID compliance" --category decision --confidence 0.95

crossagentmemory capture "Always use async/await, never callbacks" --category preference

crossagentmemory capture "Auth bug: JWT refresh tokens not rotating" --category error

3. Find related memories (semantic search)

crossagentmemory related "authentication flow"

Output:

┌────┬────────────┬──────────┬────────────────────────────────────────┐
│ ID │ Similarity │ Category │ Content                                │
├────┼────────────┼──────────┼────────────────────────────────────────┤
│ 4  │ 0.58       │ decision │ Chose FastAPI over Django for async    │
└────┴────────────┴──────────┴────────────────────────────────────────┘

4. Summarize your project

crossagentmemory summarize

5. Sync to CLAUDE.md

crossagentmemory sync

This generates CLAUDE.md in your project root. Claude Code reads it automatically on startup.

6. Install git hooks (auto-sync on commit)

crossagentmemory hook install

Now CLAUDE.md updates automatically every time you commit.


Full CLI Reference

# Core memory operations
crossagentmemory init                          # Initialize memory for project
crossagentmemory capture "content"             # Store a memory
crossagentmemory capture "..." --auto-tag      # Auto-generate tags with LLM
crossagentmemory recall                        # List recent memories
crossagentmemory search "keyword"              # Keyword search
crossagentmemory related "query"               # Semantic search
crossagentmemory summarize                     # Auto-summarize project
crossagentmemory summarize --llm               # LLM-powered rich summary
crossagentmemory summarize --session ID        # Summarize one session
crossagentmemory digest                        # Weekly digest
crossagentmemory digest --llm                  # LLM-powered weekly digest
crossagentmemory check-conflicts               # Detect contradictory memories
crossagentmemory reinforce <id>                # Boost memory confidence
crossagentmemory decay                         # Apply confidence decay
crossagentmemory decay --dry-run               # Preview decay

# Auto-capture
crossagentmemory capture-auto                  # Auto-capture from git + shell + Claude
crossagentmemory capture-auto --dry-run        # Preview what would be captured
crossagentmemory capture-auto --sources git    # Only capture from git log

# Agent integration
crossagentmemory load                          # Generate context brief
crossagentmemory sync                          # Sync to CLAUDE.md
crossagentmemory export                        # Export to markdown

# Team sync
crossagentmemory team export                   # Export memories to .crossagentmemory/
crossagentmemory team import                   # Import team-shared memories
crossagentmemory team status                   # Show team sync status

# Shell integration
crossagentmemory shell show                    # Show shell integration script

# Background daemon
crossagentmemory daemon start                  # Start silent auto-capture
crossagentmemory daemon status                 # Check daemon status

# Import & migration
crossagentmemory import <path> --format mem0   # Import from Mem0
crossagentmemory import <path> --format markdown
crossagentmemory import <path> --format json

# Social sharing
crossagentmemory post "Milestone!"             # Post to Twitter/LinkedIn

# Memory graph
crossagentmemory graph                         # Build relationship graph

# MCP server & dashboard & API
crossagentmemory mcp                           # Start MCP server (stdio)
crossagentmemory dashboard                     # Start web dashboard on :8745
crossagentmemory server                        # Start REST API on :8746

# Backup & restore
crossagentmemory backup                        # Create dated .zip backup
crossagentmemory backup -p my-project          # Backup single project
crossagentmemory restore backup.zip            # Restore from backup
crossagentmemory restore backup.zip --dry-run  # Preview restore

# Management
crossagentmemory stats                         # Show statistics
crossagentmemory hook install                  # Install git hooks
crossagentmemory hook uninstall                # Remove git hooks
crossagentmemory delete <project>              # Wipe project memory

How It Works

Your Terminal Agent
       │
       ├──► crossagentmemory capture "..."   ──► SQLite (~/.crossagentmemory/memory.db)
       │
       ├──► crossagentmemory capture-auto    ──► Auto-import from git / shell / Claude
       │
       ├──► crossagentmemory related "..."   ──► TF-IDF + Cosine Similarity (numpy)
       │
       ├──► crossagentmemory load            ──► Markdown brief for agent context
       │
       ├──► crossagentmemory sync            ──► CLAUDE.md (auto-read by Claude Code)
       │
       ├──► crossagentmemory team export     ──► .crossagentmemory/ (git-shared)
       │
       ├──► crossagentmemory mcp             ──► MCP server for Cursor/Copilot/Claude
       │
       └──► crossagentmemory dashboard       ──► Web UI on http://localhost:8745

Storage: Plain SQLite. Query it with any tool. Back it up. Version it.

Semantic Search: Built with TF-IDF + cosine similarity in pure numpy. No scikit-learn, no sentence-transformers, no API calls.

Privacy: Nothing leaves your machine.


Memory Categories

Category Use For
decision Architecture choices, tech stack decisions
preference Coding style, conventions, personal rules
fact Project structure, API behavior, domain knowledge
action What you built, refactored, deployed
error Bugs, gotchas, things that broke

Why Not Just Use CLAUDE.md?

CLAUDE.md is static documentation. CrossAgentMemory is learned memory:

CLAUDE.md CrossAgentMemory
You write it manually Captured as you work
Same every session Grows and evolves
No confidence scoring Tags confidence + source
One file per project Searchable across all history
No semantic search Find related ideas by meaning

Use both. CLAUDE.md for stable conventions. CrossAgentMemory for dynamic context.


Storage Backends

CrossAgentMemory supports multiple storage backends. SQLite is the default — zero config, works offline, perfect for individuals.

PostgreSQL is available for teams, concurrent access, and larger deployments.

SQLite (default)

# No configuration needed — works out of the box
crossagentmemory init

Database file: ~/.crossagentmemory/memory.db

PostgreSQL

# 1. Install with PostgreSQL support
pip install crossagentmemory[postgres]

# 2. Start PostgreSQL (Docker Compose included)
docker compose up -d

# 3. Set the connection URL
export DATABASE_URL=postgresql://crossagentmemory:crossagentmemory@localhost:5432/crossagentmemory

# 4. Initialize
crossagentmemory init

Switching Backends

from crossagentmemory import MemoryEngine

# Auto-detect: uses Postgres if DATABASE_URL is set, otherwise SQLite
engine = MemoryEngine()

# Explicit SQLite
engine = MemoryEngine(backend="sqlite")

# Explicit PostgreSQL
engine = MemoryEngine(backend="postgres")

Migrating Data

# Migrate all memories from SQLite to PostgreSQL
crossagentmemory migrate --from-backend sqlite --to-backend postgres

# Migrate a single project
crossagentmemory migrate -p my-project --from-backend sqlite --to-backend postgres

# Specify custom source DB or target DSN
crossagentmemory migrate --from-db-path ./old.db --to-dsn postgresql://user:pass@host/db

Roadmap

  • Core SQLite engine
  • CLI (init, capture, recall, search, load, export)
  • Markdown context brief generation
  • CLAUDE.md sync
  • Git hooks
  • Semantic search (TF-IDF + cosine similarity)
  • Auto-summarization
  • Confidence decay & reinforcement
  • Auto-capture from agent sessions
  • Team sync (shared memory via git)
  • MCP server integration
  • Web dashboard
  • Shell integration
  • Background daemon
  • Memory graph visualization
  • Mem0 importer
  • Social sharing
  • VS Code extension
  • Pluggable storage backends (SQLite + PostgreSQL)
  • Schema versioning
  • Backup & restore
  • Config file support
  • FTS5 full-text search

Contributing

PRs welcome! This is a community project.

git clone https://github.com/Vish150988/crossagentmemory.git
cd crossagentmemory
pip install -e ".[dev]"
pytest tests/ -v

License

MIT © Open Source Community

Metadata

Release files for crossagentmemory 0.3.9

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

Source distribution (sdist)

Source distribution for crossagentmemory 0.3.9
File Size Uploaded
crossagentmemory-0.3.9.tar.gz 70.5 kB Details

Built distribution (wheel)

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

Total release size: 134.2 kB

Release files / crossagentmemory-0.3.9.tar.gz

Download URL crossagentmemory-0.3.9.tar.gz
Size 70.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fec1f88f9f299767f16a57e0326de24403600019b08364930742eb26bd64cb07
BLAKE2b-256 checksum
How to use checksums
130249174013161cad85b29060702fdde2f60e0af716ade7b72056e5b37774b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 22, 2026.

Transparency log

Release files / crossagentmemory-0.3.9-py3-none-any.whl

Download URL crossagentmemory-0.3.9-py3-none-any.whl
Size 63.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f69176d5dfb8c65c529dc02392cdac66cbccb022b9f35fceaa8eb75ea35d283
BLAKE2b-256 checksum
How to use checksums
cf49f4ba9ddfa04fb7178d5818154b64e6862d070b418a71a4d6e2bdb61a525b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.9 This release

2 release files

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