Nexus Memory

Nexus Memory

Nexus Memory gives every MCP-compatible agent one persistent, self-hosted shared memory with hybrid retrieval, drift detection, and anti-poisoning features.

Category
Visit Server

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!

Stars License Python 3.11+ Qdrant Version Tests MCP

πŸ€– Bot Self-Install: Tell your agent: "Read AGENTS.md and install Nexus Memory." It does the rest.

πŸ‘‰ Bot Self-Install

πŸ‘‰ ⭐ Star this repo


Architecture


πŸ€– 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_KEY in .env (768d)
  • πŸ’œ Jina β€” JINA_API_KEY in .env (1024d, best value)
  • πŸ¦™ Ollama β€” ollama pull nomic-embed-text
  • ☁️ Voyage β€” VOYAGE_API_KEY in NEXUS_ENV_FILE or MCP env:-block (1024d, best quality)
  • ☁️ OpenAI β€” OPENAI_API_KEY in NEXUS_ENV_FILE or MCP env:-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_KEY in .env (768d)
  • πŸ’œ Jina β€” JINA_API_KEY in .env (1024d, best value)
  • πŸ¦™ Ollama β€” ollama pull nomic-embed-text
    • ☁️ Voyage β€” VOYAGE_API_KEY in .env
    • ☁️ OpenAI β€” OPENAI_API_KEY in .env
    • 🏠 Local β€” pip install sentence-transformers
  • Optional: bm25s for 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured