MCP server for Neruva agent memory: typed Records, 5-engine knowledge graph, managed/BYO-LLM extraction, federated agent_remember/recall/context with question-type dispatch, Pearl's do-operator, HD analogy, concept blending, CBR, snapshot/restore for provable replay, quorum anomaly detection, fact invalidation, portable .neruva container. Drop-in for any MCP host (Claude Code, Cursor, Codex, Gemini CLI). LangChain / LangGraph / CrewAI adapters. Sub-100ms p95.
Project description
neruva-mcp
MCP server for Neruva — memory + reasoning substrate for AI agents. Knowledge graph (5 engines), Pearl do-operator, HD analogy, episodic CBR, deterministic replay. Drop into Claude Code / Cursor / Codex / Gemini CLI in one line.
For Claude Code users: see neruva.io/claude-code for the 30-second install + first-queries to try.
What's new in 0.17 — 9 cognitive primitives no LLM vendor ships
The substrate now exposes the full 9-level cognitive ladder. Every primitive runs sub-100ms, deterministic from seed, behind one MCP install.
| # | Capability | MCP tool(s) | Frontier LLM equivalent |
|---|---|---|---|
| 1 | Vector retrieval (OPB pages + spectral routing) | records_query(engine="opb") |
Pinecone/Zep (Level 1 only) |
| 2 | KG + Pearl do-operator + HD analogy + CBR | hd_kg_* · agent_causal_query · hd_analogy · hd_cbr_* |
nobody |
| 3 | Theory of Mind (nested-belief depth-4) | agent_model_belief_add · agent_model_belief |
hallucinates @ depth ≥3 |
| 4 | Counterfactual rollouts ("what if k → a'?") | agent_counterfactual_rollout |
confabulates |
| 5 | Schema lifting (analogical pattern matching) | agent_extract_schema |
needs fine-tuning |
| 6 | Active Inference planning (Friston EFE) | agent_register_action · agent_plan_efe |
not a primitive |
| 7 | Few-shot rule induction (3-shot → 100% on 28-rule ARC) | agent_induce_rule |
fine-tune (>100 examples) |
| 8 | Persistent rule storage (~26,000× cheaper recall) | agent_persist_rule · agent_recall_rule |
re-feed demos every recall |
| 9 | Continual learning, zero forgetting | agent_continual_train · agent_continual_predict |
catastrophic forgetting |
| + | Hierarchical chunking (recursive L^K decode) | agent_hierarchical_add · agent_hierarchical_decode |
not a primitive |
~90 tools across Records, KG, Causal, Analogy, CBR, Blend, Vector memory, federated agent_*, the 9 cognitive primitives above, self-introspection.
Why this is unique
Every primitive in rows 3-9 is empirically validated (probes 34 / 47 / 48 / 49 / 50 / 60 / 70) and graduated to production engines at neruva_hd/engines/. No published memory vendor offers more than rows 1-2. The algorithmic moat is 17 trade-secret VSA primitives that compound — none individually replicable in <6-12 months by a competitor.
The structural pitch: substrate-augmented small LLMs (Haiku, Llama-1B) can match frontier-class agentic capabilities at ~26,000× lower cost per recall.
Install
# In Claude Code (any directory, user scope):
claude mcp add-json neruva '{"command":"npx","args":["-y","@neruva/mcp@latest"],"env":{"NERUVA_API_KEY":"nv_..."}}'
Or one-line install via npx for any MCP host:
npx -y @neruva/mcp@latest # one-off
npm i -g @neruva/mcp # then `neruva-mcp`
Get an API key at https://app.neruva.io (free tier, no credit card).
Wire into a host
Claude Code
claude mcp add-json neruva '{"command":"npx","args":["-y","@neruva/mcp@latest"],"env":{"NERUVA_API_KEY":"..."}}'
Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"neruva": {
"command": "npx",
"args": ["-y", "@neruva/mcp@latest"],
"env": { "NERUVA_API_KEY": "..." }
}
}
}
Codex (~/.codex/config.toml)
[mcp_servers.neruva]
command = "npx"
args = ["-y", "@neruva/mcp@latest"]
env = { NERUVA_API_KEY = "..." }
Gemini CLI (~/.gemini/settings.json)
{ "mcpServers": { "neruva": { "command": "npx", "args": ["-y", "@neruva/mcp@latest"], "env": { "NERUVA_API_KEY": "..." } } } }
The substrate, in one paragraph
Five layers, one API. Records = typed agentic events (decisions, mistakes, tool_calls, llm_turns; auto-embedded at D=1024). Knowledge Graph = mutable structured state across 5 engines, sub-ms cosine retrieval, matrix-power N-hop derive. Causal = Pearl's do-operator (observation vs intervention arithmetically distinct). Analogy = a:b::c:? in HD feature space. Concept Blending = provenance-preserving merge of multiple memories. CBR = factored episode store. The new federated agent_* layer (agent_remember / agent_recall / agent_context) routes across all substrates so a single call handles "where does X store, and how do I get it back?"
Deterministic from a seed. Replayable bit-exactly. Portable as .neruva containers — your data is yours.
Three-line LangChain integration
# pip install neruva-langchain
from neruva_langchain import NeruvaChatMessageHistory
history = NeruvaChatMessageHistory(namespace="user_alice")
# wire into any chain that takes BaseChatMessageHistory
Same pattern: neruva-langgraph (BaseCheckpointSaver + BaseStore), neruva-crewai (Storage interface + 3 memory flavors).
Auto-record for Claude Code
pip install neruva-record && neruva-record-install
Every Claude Code session lands in your Neruva account: tool calls, chat turns, secrets-redacted client-side, queryable across sessions.
Why use this over a vector DB or Zep
| Vector DB | Zep | Neruva | |
|---|---|---|---|
| KG engines | 0 | 1 | 5 |
| Causal queries (Pearl do-operator) | ❌ | ❌ | ✅ |
| Provable replay (deterministic snapshot/restore) | ❌ | ❌ | ✅ |
| Anomaly detection (quorum disagreement) | ❌ | ❌ | ✅ |
| Federated context (records+KG one call) | ❌ | partial | ✅ |
| Portable container | ❌ | ❌ | ✅ .neruva |
| p95 latency | varies | 189–200ms | <100ms |
| Cost per recall vs context-stuffing | varies | varies | ~3,125× cheaper |
Auth
Set NERUVA_API_KEY in env. NERUVA_URL defaults to https://api.neruva.io.
Optional: NERUVA_AUTO_RECORD=namespace[:ttl_days] — every tool call this agent makes auto-records into the named records namespace. Fire-and-forget, never blocks or breaks the call.
Update flow
The startup banner prints when a newer version is available:
[neruva-mcp] update available: you have 0.16.0, latest is 0.16.1.
If registered with @neruva/mcp@latest, a Claude Code restart auto-updates.
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 Distributions
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 neruva_mcp-0.17.0-py3-none-any.whl.
File metadata
- Download URL: neruva_mcp-0.17.0-py3-none-any.whl
- Upload date:
- Size: 25.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0518ec3442b81a8c2c406a411488d67f3636b160cde9863b8899be1e1783088
|
|
| MD5 |
fd50b14691c4507629dfb8fcbda2f090
|
|
| BLAKE2b-256 |
fc62d496ab3a1dae76126f7fac752f9b7905e10012406797a02d7a7b67e5fbc3
|