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:
- Extracts entities, relationships, and decisions using LLM
- Embeds the text for semantic search
- Builds a knowledge graph with NetworkX
- Stores everything in a local SQLite database
When you query, it:
- Searches semantically similar memories
- Expands through the knowledge graph
- Reranks by importance and relevance
- 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 contextsearch_memory— Query past memoriesget_project_context— Get rich context about a topicfind_related— Explore knowledge graph relationshipsget_decisions— Review past decisionsmemory_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 embeddingsnodes— Knowledge graph entitiesedges— Relationships between entitiesdecisions— 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
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 nexusmemo-0.1.4.tar.gz.
File metadata
- Download URL: nexusmemo-0.1.4.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
214f136ef0dfca40d7a20660a156348d365338b08713c5cb880643736888b8c3
|
|
| MD5 |
1125bdf257113631b5c794a27ba6a426
|
|
| BLAKE2b-256 |
a7bab65e1c61132b3d0dbf0eb2f275b9ac215d3c222e96e1987dfb9070736c10
|
File details
Details for the file nexusmemo-0.1.4-py3-none-any.whl.
File metadata
- Download URL: nexusmemo-0.1.4-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e15b0c27ddf9e31591be8933220d1a370bdf0f421b209a0a4b40fb5e7c1abf0f
|
|
| MD5 |
c21f88156313d1c834748565747123c3
|
|
| BLAKE2b-256 |
8ad1bf42664c77e24b16e28bd09830c555394f34cf02460a0f0af5b0ee36694a
|