Nexus Memory
Nexus Memory gives every MCP-compatible agent one persistent, self-hosted shared memory with hybrid retrieval, drift detection, and anti-poisoning features.
README
π¦ Nexus Memory
One brain for all your agents.
Your agents forget. Your context gets lost. Your setup knowledge is scattered across chats, tools and repos.
Nexus Memory gives every MCP-compatible agent one persistent, self-hosted memory they all share.
Hermes β’ OpenClaw β’ Claude Code β’ Codex β’ Cursor β’ Cline β’ Roo Code β’ GitHub Copilot β’ Pi β’ Continue β’ Odysseus β’ Kilo Code β¦and more!
π€ Bot Self-Install: Tell your agent: "Read AGENTS.md and install Nexus Memory." It does the rest.

π€ Quick Start
Tell your agent to install it
Send this prompt to any MCP-compatible agent:
Read https://raw.githubusercontent.com/Neboy72/nexus-memory/main/AGENTS.md and follow the installation instructions.
Your agent will check prerequisites, install everything, configure the provider, and verify. Zero manual steps.
π οΈ Or install manually
git clone https://github.com/Neboy72/nexus-memory.git
cd nexus-memory
pip install -e .
Choose your embedding (auto-detected at runtime, you pick):
- π Google / Vertex AI β
GOOGLE_API_KEYin.env(768d) - π Jina β
JINA_API_KEYin.env(1024d, best value) - π¦ Ollama β
ollama pull nomic-embed-text - βοΈ Voyage β
VOYAGE_API_KEYinNEXUS_ENV_FILEor MCPenv:-block (1024d, best quality) - βοΈ OpenAI β
OPENAI_API_KEYinNEXUS_ENV_FILEor MCPenv:-block (1536d) - π Local (default) β
pip install nexus-memory[local](sentence-transformers, no key)
Start the server:
nexus-memory
π Platform Configuration
Choose your agent:
<details> <summary>π· Hermes Agent</summary>
~/.hermes/config.yaml:
mcp_servers:
nexus:
command: nexus-memory
Restart: hermes gateway restart
</details>
<details> <summary>π· OpenClaw</summary>
~/.openclaw/openclaw.json (mcp.servers.<name>.env β nested, not top-level):
{
"mcp": {
"servers": {
"nexus-memory": {
"command": "nexus-memory",
"env": { "VOYAGE_API_KEY": "vo-your-key-here" }
}
}
}
}
</details>
<details> <summary>π· Claude Code</summary>
~/.claude/settings.json or .mcp.json in project root:
{
"mcpServers": {
"nexus": {
"command": "python3",
"args": ["-m", "nexus_memory.mcp_server"]
}
}
}
</details>
<details> <summary>π· Codex CLI</summary>
~/.codex/config.toml:
[mcp_servers.nexus]
command = "python3"
args = ["-m", "nexus_memory.mcp_server"]
</details>
<details> <summary>π· GitHub Copilot (VS Code)</summary>
.vscode/mcp.json in your project:
{
"mcpServers": {
"nexus": {
"command": "python3",
"args": ["-m", "nexus_memory.mcp_server"]
}
}
}
</details>
<details> <summary>π· Cursor</summary>
Settings β Features β MCP Servers β Add:
- Name: nexus
- Command:
python3 - Arguments:
-m nexus_memory.mcp_server</details>
<details> <summary>π· Cline / Roo Code</summary>
MCP Server Config:
{
"mcpServers": {
"nexus": {
"command": "python3",
"args": ["-m", "nexus_memory.mcp_server"]
}
}
}
</details>
<details> <summary>π· Kilo Code</summary>
.mcp.json in your project:
{
"mcpServers": {
"nexus": {
"command": "python3",
"args": ["-m", "nexus_memory.mcp_server"]
}
}
}
</details>
<details> <summary>π· Pi Coding Agent</summary>
~/.pi/config.json:
{
"mcpServers": {
"nexus": {
"command": "python3",
"args": ["-m", "nexus_memory.mcp_server"]
}
}
}
</details>
<details> <summary>π· Continue.dev</summary>
.mcp.json or ~/.continue/config.json:
{
"mcpServers": {
"nexus": {
"command": "python3",
"args": ["-m", "nexus_memory.mcp_server"]
}
}
}
</details>
<details> <summary>π· Odysseus (PewDiePie)</summary>
Settings β MCP Management β Add Server:
- Name: nexus
- Command:
python3 - Arguments:
-m nexus_memory.mcp_server</details>
<details> <summary>π· Any MCP-compatible agent</summary>
Standard MCP stdio config:
{
"mcpServers": {
"nexus": {
"command": "python3",
"args": ["-m", "nexus_memory.mcp_server"]
}
}
}
</details>
π― MCP Tools
| Tool | Description | Parameters |
|---|---|---|
remember πΎ |
Store a memory | text (req), access_level, category, source, source_url, confidence |
recall π |
Hybrid search (BM25 + Vector + RRF) | query (req), limit, filter_level |
forget ποΈ |
Delete a memory | memory_id (req) |
update βοΈ |
Update in-place, preserve metadata | memory_id (req), text, modified_by |
health β€οΈ |
Check server status | β |
Memory Categories
| Category | Scope | Use Case |
|---|---|---|
fact β
|
Permanent | Verified facts, decisions (default) |
belief π€ |
Drift-prone | Assumptions that may change over time |
session π |
Ephemeral | Current conversation context |
rule π |
Permanent | Operating rules, policies |
preference β€οΈ |
Permanent | User likes, dislikes, habits |
temp β³ |
Temporary | Short-lived notes, TTL-managed |
Access Levels π‘οΈ
| Level | Visible to | Example |
|---|---|---|
π’ public |
All agents | Project knowledge, technical info |
π‘ trusted |
Approved agents only | Personal preferences, habits |
π΄ private |
Owner only | Financial data, passwords, bills |
β¨ Features
Hybrid Retrieval π‘οΈ
Pure vector search is vulnerable to RAG poisoning β adversarial documents that rank high semantically but contain garbage. Nexus Memory blends BM25 + Vector + Reciprocal Rank Fusion:
Query β ββ BM25 Index βββββββ Keyword Rankings
β β
ββ Vector Embeddings βββ Semantic Rankings
β
RRF Fusion ββββ Combined Rankings
| Method | Strengths | Weaknesses |
|---|---|---|
| BM25 π€ | Keyword-exact, poison-resistant | Misses semantics |
| Vector π§ | Semantic matching, fuzzy queries | Vulnerable to poisoning |
| Hybrid (RRF) π | Best of both | β |
Source-Tier Boosting π·οΈ
| Tier | Sources | Boost |
|---|---|---|
| π’ Tier 1 | Agent, user, official docs | 1.2Γ |
| π‘ Tier 2 | Curated external | 1.0Γ |
| π΄ Tier 3 | Uncurated / unknown | 0.8Γ |
MemoryCategory Enum π·οΈ
Six scopes from Agentic Design Patterns (Ch8): fact, belief, session, rule, preference, temp. Every memory knows its purpose.
Provenance Tracking π
Every memory carries its origin: source_url, confidence (0.0β1.0), modified_by, timestamps. Full audit trail from creation to today.
Guardrails π‘οΈ
Content-length warnings for entries >5,000 chars. PII detection hints for emails and phone numbers in non-private entries.
Fact Lifecycle Model π§¬
Append-only state machine: pending β canonical | deprecated | rolled_back. Every revision is versioned with fact_id, version_id, content_hash, supersedes, and mandatory decision_event. No silent overwrites. No zombie facts.
Staging + Rollback π
| Operation | What it does |
|---|---|
create_pending() |
Stage new facts for review |
promote() |
Promote staged β canonical |
deprecate() |
Mark canonical as deprecated |
rollback() |
Restore previous canonical version |
Auto-Discovery + Graph Analytics π
Zero-token relation discovery between canonical facts via Qdrant (O(nΒ·k)) + heuristic classification. Graph analytics: hub scores, isolation scores, knowledge gaps, connected components. Facts connect themselves β no manual edges needed.
Skill Export π―
export_skill() searches canonical facts β clusters into Steps/Pitfalls/Prerequisites/Verification β generates complete SKILL.md. Turn learned facts into reusable agent skills.
Belief Drift Detection π
| Score | Status |
|---|---|
| π’ < 1 | Healthy |
| π‘ 1β3 | Attention needed |
| π΄ > 3 | Action required |
Detects stale entries, old patterns ("X running as fallback" β but X was replaced), age thresholds. Weighted 0β10 scoring.
π vs Other Memory Solutions
| Feature | Nexus Memory π¦ | Walrus Memory π¦ | mem0 | Honcho | agentmemory | Holographic |
|---|---|---|---|---|---|---|
| π Semantic search | β local or cloud | β via API | β Cloud | β pgvector | β Gemini | β HRR algebra |
| π Hybrid retrieval | β BM25 + Vector + RRF | β | β Multi-signal | β | β | β |
| π©Ί Drift detection | β Scored 0β10 | β | β * | β | β | β |
| π‘οΈ Anti-poisoning | β Source tiers | β | β | β | β | β |
| π Multi-Level Provenance | β Source + Corroboration + Dep. | β On-chain | β | β | β | β |
| π·οΈ MemoryCategory Enum | β 6 scopes | β | β | β | β | β |
| 𧬠Fact Lifecycle | β Append-only | β | β | β | β | β |
| π Staging + Rollback | β Promote/Deprecate/Rollback | β | β | β | β | β |
| π― Skill Export | β Facts β SKILL.md | β | β | β | β | β |
| π SkillGraph | β 5 relation types, BFS/DFS | β | β | β | β | β |
| π Auto-Discovery | β 0 token cost | β | β | β | β | β |
| π Graph Analytics | β Hub scores, gaps | β | β | β | β | β |
| π Graph Boost | β Search ranking boost | β | β | β | β | β |
| π‘οΈ Access Control | β public/trusted/private | β Permissions | β | β | β | β |
| π Self-hosted | β Your machine | β Blockchain | β Cloud | β Cloud | β Cloud | β Local |
| π° Cost | π Free | WAL token | Subscription | Subscription | API costs | Free |
| π¦ Code size | ~9.6K Python | Managed service | Managed service | Managed service | ~50K TS | ~1.5K Python |
| β±οΈ Setup time | 1 command | Signup + SDK | API key + signup | Postgres + pgvector | 30+ min + OAuth | 1 command |
*Mem0 lists staleness as an "open problem" in their 2026 report but does not ship a solution.
Nexus Memory is the only solution with hybrid retrieval, drift detection, provenance, fact lifecycle, staging/rollback, auto-discovery, graph analytics, skill export, memory categories, and access control β all self-hosted, all in one package.
π§© Embedding Providers
One server. Multiple backends. Same API.
| Provider | Type | Setup | Dims | Quality |
|---|---|---|---|---|
| Voyage βοΈ | Cloud API | VOYAGE_API_KEY in .env |
1024 | β Best |
| OpenAI βοΈ | Cloud API | OPENAI_API_KEY in .env |
1536 | β Great |
| Ollama π¦ | Local | ollama pull nomic-embed-text |
768 | Better |
| sentence-transformers π | Local | pip install sentence-transformers |
384 | Good β (default) |
π§ Troubleshooting
| Symptom | Check | Fix |
|---|---|---|
mcp_nexus_* tools missing |
grep 'nexus' ~/.hermes/logs/agent.log |
Gateway restart |
| Qdrant not running | curl http://127.0.0.1:6333/healthz |
brew services start qdrant |
| Hybrid search missing | pip list | grep bm25s |
pip install bm25s |
| Voyage embedding fails | echo $VOYAGE_API_KEY |
Set in ~/.hermes/.env |
| ModuleNotFoundError | Check PYTHONPATH | Set PYTHONPATH=/path/to/nexus-memory |
π§ͺ Tests
pytest tests/ -v # 224 tests β
π Requirements
- Python 3.11+
- Qdrant v1.12+ running on
localhost:6333 - One embedding provider (auto-detected):
- π Google / Vertex AI β
GOOGLE_API_KEYin.env(768d)
- π Google / Vertex AI β
- π Jina β
JINA_API_KEYin.env(1024d, best value) - π¦ Ollama β
ollama pull nomic-embed-text- βοΈ Voyage β
VOYAGE_API_KEYin.env - βοΈ OpenAI β
OPENAI_API_KEYin.env - π Local β
pip install sentence-transformers
- βοΈ Voyage β
- Optional:
bm25sfor hybrid search
π License
MIT β use it, modify it, ship it.
βοΈ Found it useful? Give it a star on GitHub β it helps others find it!
<sub>Built by Nebo Β· June 2026 Β· v0.2.0 β One memory for all your agents</sub>
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.