Skip to main content

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

Project description

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 using LLM
  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
# Edit .env and add your OpenAI API key

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"

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)

# Add as MCP server
claude mcp add nexusmemo -- nexusmemo mcp

# Or if installed via pip in a specific path:
claude mcp add nexusmemo -- /path/to/venv/bin/nexusmemo 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

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
  • OpenAI API for extraction and embeddings
  • MCP SDK for Claude Code integration

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexusmemo-0.1.1.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexusmemo-0.1.1-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file nexusmemo-0.1.1.tar.gz.

File metadata

  • Download URL: nexusmemo-0.1.1.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.2

File hashes

Hashes for nexusmemo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3c73a29450c30cf33916d0fd7aa6b6bdd41a3ce3f77246488df329c14c43ee52
MD5 1fc41b4e661ea15670d7fbcf6be66bf2
BLAKE2b-256 8e6bf93e311e68fa46151fe9398fa092a49b7b7061a0850a20f20741f6c70ad2

See more details on using hashes here.

File details

Details for the file nexusmemo-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nexusmemo-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.2

File hashes

Hashes for nexusmemo-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2218f31d5c8d4286c5ab0415277b60a777279ac2f34ae5546089404e6951ac08
MD5 15e8c0307d4207665d91a75212cf3db4
BLAKE2b-256 9c6432ac34b405e3e44ccc395bba18b7f6a4a9122a132285e041b3b1cfa6d44b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page