Skip to main content

NexusMemo

Local-first AI memory layer that gives LLMs persistent, structured memory.

"We are building the memory operating system that turns AI from a temporary assistant into a long-term collaborator."

Problem

LLMs are stateless. They forget previous sessions, lose architectural context, repeat mistakes, and require repeated explanations. NexusMemo fixes this by building a persistent knowledge graph from your conversations.

How It Works

conversation → entity extraction → relationship graph → retrieval → prompt injection

When you tell NexusMemo something, it:

  1. Extracts entities, relationships, and decisions via Claude (Client-side)
  2. Embeds the text for semantic search
  3. Builds a knowledge graph with NetworkX
  4. Stores everything in a local SQLite database

When you query, it:

  1. Searches semantically similar memories
  2. Expands through the knowledge graph
  3. Reranks by importance and relevance
  4. Compresses into context ready for LLM injection

Quick Start

Install

pip install -e .

Configure

cp .env.example .env
# Optional configuration, but everything works locally by default

Use via CLI

# Add a memory
nexusmemo add "We replaced Airflow with Dagster because DAG maintenance became difficult"

# Search memories
nexusmemo search "What orchestration tool do we use?"

# Check status
nexusmemo status

# Get entity info
nexusmemo entity "Dagster"

Initialize Project Guidelines

Tell your AI assistant to use NexusMemo by writing a guidelines file into your project. Each tool reads from a different config file — init handles all of them.

# Claude Code → CLAUDE.md
nexusmemo init
nexusmemo init --target claude

# Cursor → .cursor/rules/nexusmemo.mdc
nexusmemo init --target cursor

# Windsurf → .windsurfrules
nexusmemo init --target windsurf

# GitHub Copilot → .github/copilot-instructions.md
nexusmemo init --target copilot

# Antigravity, Codex, and other agents → AGENTS.md
nexusmemo init --target agents

# Write all config files at once
nexusmemo init --target all

Use via API

# Start the server
nexusmemo serve

# Add memory
curl -X POST http://localhost:8765/memory/add \
  -H "Content-Type: application/json" \
  -d '{"text": "We migrated from MongoDB to PostgreSQL for better ACID compliance"}'

# Query
curl -X POST http://localhost:8765/memory/query \
  -H "Content-Type: application/json" \
  -d '{"query": "What database do we use?"}'

Use with Claude Code (MCP)

The easiest way to run the MCP server is via uvx directly from PyPI.

# Add as MCP server (will automatically download and run the latest version)
claude mcp add nexusmemo -- uvx nexusmemo@latest mcp

Troubleshooting Path Issues: If Claude Code fails to find uvx (due to PATH environment issues), provide the absolute path to your uvx executable. You can find it by running which uvx in your terminal.

# Example with absolute path (replace with your actual path)
claude mcp add nexusmemo -- ~/.local/bin/uvx nexusmemo@latest mcp

Available MCP tools:

  • add_memory — Store project context
  • search_memory — Query past memories
  • get_project_context — Get rich context about a topic
  • find_related — Explore knowledge graph relationships
  • get_decisions — Review past decisions
  • memory_status — Check system stats
  • initialize_memory_guidelines — Write guidelines file for your AI tool

Supported AI Tools

NexusMemo works as an MCP server with any compatible AI coding assistant. Use initialize_memory_guidelines (or nexusmemo init) to configure each tool:

AI Tool Config File Target
Claude Code CLAUDE.md claude
Cursor .cursor/rules/nexusmemo.mdc cursor
Windsurf .windsurfrules windsurf
GitHub Copilot .github/copilot-instructions.md copilot
Antigravity / Codex / others AGENTS.md agents
# Via MCP tool (e.g. tell your AI: "initialize nexusmemo for cursor")
initialize_memory_guidelines(target="cursor")
initialize_memory_guidelines(target="all")   # write all at once

Architecture

┌──────────────┐
│   Interfaces │  CLI / FastAPI / MCP Server
├──────────────┤
│     Core     │  NexusMemo orchestration class
├──────────────┤
│   Services   │  Extraction, Embedding, Graph, Importance
├──────────────┤
│   Storage    │  SQLite + NetworkX (in-memory)
└──────────────┘

Tech Stack

  • Python 3.11+ with FastAPI
  • SQLite for persistent storage
  • NetworkX for in-memory knowledge graph
  • FastEmbed (ONNX) for local semantic search (Zero API Keys)
  • MCP SDK for native integration with Claude Code, Cursor, Windsurf, Copilot, and other AI tools

Database

Four tables:

  • memories — Raw text with embeddings
  • nodes — Knowledge graph entities
  • edges — Relationships between entities
  • decisions — Project decisions with reasoning

Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run API server in dev mode
nexusmemo serve

License

MIT

Metadata

Release files for nexusmemo 0.2.6

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

Source distribution (sdist)

Source distribution for nexusmemo 0.2.6
File Size Uploaded Provenance Actions
nexusmemo-0.2.6.tar.gz 194.4 kB Without provenance Details for nexusmemo-0.2.6.tar.gz

Built distribution (wheel)

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

Total release size: 219.6 kB

Release files / nexusmemo-0.2.6.tar.gz

Download URL nexusmemo-0.2.6.tar.gz
Size 194.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b8c8c46e90c03a41cf1ab184fa21f91d9480d650507a92b95cebb53d245b0b0a
BLAKE2b-256 checksum
How to use checksums
008cbe32ea88e2b303a6812ac636c24d90020860f61ee94a7af4d6ff7752dc0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.2

Release files / nexusmemo-0.2.6-py3-none-any.whl

Download URL nexusmemo-0.2.6-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56fa787d811e0de0d095e220a0358691a08ddef31a63e3cd876db6441fcc932a
BLAKE2b-256 checksum
How to use checksums
9518076c8a634f960f6f6e97ebfddc3a035aded8d56dc1e8117f596e897b1c89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.2

Security for nexusmemo 0.2.6

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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