Open-source cross-agent memory layer for AI coding agents
Project description
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.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crossagentmemory-0.3.9.tar.gz.
File metadata
- Download URL: crossagentmemory-0.3.9.tar.gz
- Upload date:
- Size: 70.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fec1f88f9f299767f16a57e0326de24403600019b08364930742eb26bd64cb07
|
|
| MD5 |
aa4f01b0fb182ac89ae6f3b4a9dd1487
|
|
| BLAKE2b-256 |
130249174013161cad85b29060702fdde2f60e0af716ade7b72056e5b37774b2
|
Provenance
The following attestation bundles were made for crossagentmemory-0.3.9.tar.gz:
Publisher:
publish.yml on Vish150988/crossagentmemory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crossagentmemory-0.3.9.tar.gz -
Subject digest:
fec1f88f9f299767f16a57e0326de24403600019b08364930742eb26bd64cb07 - Sigstore transparency entry: 1355905341
- Sigstore integration time:
-
Permalink:
Vish150988/crossagentmemory@c84cc2340095e65b79d0f3561503f05193da7338 -
Branch / Tag:
refs/tags/v0.3.9 - Owner: https://github.com/Vish150988
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c84cc2340095e65b79d0f3561503f05193da7338 -
Trigger Event:
push
-
Statement type:
File details
Details for the file crossagentmemory-0.3.9-py3-none-any.whl.
File metadata
- Download URL: crossagentmemory-0.3.9-py3-none-any.whl
- Upload date:
- Size: 63.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f69176d5dfb8c65c529dc02392cdac66cbccb022b9f35fceaa8eb75ea35d283
|
|
| MD5 |
6f58bd8b06bbb13dd8f70a70eb82b5a9
|
|
| BLAKE2b-256 |
cf49f4ba9ddfa04fb7178d5818154b64e6862d070b418a71a4d6e2bdb61a525b
|
Provenance
The following attestation bundles were made for crossagentmemory-0.3.9-py3-none-any.whl:
Publisher:
publish.yml on Vish150988/crossagentmemory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crossagentmemory-0.3.9-py3-none-any.whl -
Subject digest:
6f69176d5dfb8c65c529dc02392cdac66cbccb022b9f35fceaa8eb75ea35d283 - Sigstore transparency entry: 1355905389
- Sigstore integration time:
-
Permalink:
Vish150988/crossagentmemory@c84cc2340095e65b79d0f3561503f05193da7338 -
Branch / Tag:
refs/tags/v0.3.9 - Owner: https://github.com/Vish150988
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c84cc2340095e65b79d0f3561503f05193da7338 -
Trigger Event:
push
-
Statement type: