Skip to main content

MCP server for Neruva agent memory + reasoning substrate. v0.20 adds code_kg_callees/callers/class_of/module_of/imports for sub-ms structural code queries on KGs built locally via neruva-record-code-index. Plus Records, 5-engine KG, federated agent_remember/recall/context, Pearl do-operator, HD analogy, CBR, ToM, counterfactual rollouts, schema lifting, EFE, continual K-gram, rule induction, replay, .neruva V3. MCP drop-in for Claude Code, Cursor, Codex.

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.19.0 — pattern C postmortem + routing nudges

  • agent_postmortem_prompt tool (Pattern C mistake learning). Returns the canonical system prompt for failure-classification: your LLM runs it on a tool-failure context, emits a structured JSON shape (failure_class, root_cause, corrective_plan, is_agent_mistake), and you push the result to records_ingest(kind="mistake", ...). The substrate stays $0/call + LLM-free — your existing LLM does the work. Replaces the killed Magistral-backed /v1/agent/postmortem.
  • Tool-description routing nudges. All 17 high-leverage tools (records_*, agent_recall/context/remember, hd_kg_query, hd_analogy, hd_causal_query, agent_counterfactual_rollout, agent_model_belief(_add), agent_postmortem_prompt, agent_register_action, agent_plan_efe, agent_induce_rule, agent_extract_schema, agent_hierarchical_decode) now lead with "Call this when..." so LLMs route into the right substrate primitive without explicit prompting.
  • extract="managed" on agent_remember removed. Pairs with the substrate's "no server-side LLM calls" architecture decision: use extract="byo" with caller-side triple extraction via hd_kg_extraction_prompt.

What's new in 0.18.3 — depth-unlimited theory of mind + 125× faster cleanup

  • Theory of mind is now depth-unlimited (v0.5.4 substrate fix). Position-tagged at every chain index via non-commutative permutation binding. Inner-position swaps correctly reject; recursive self- reference (same agent at multiple chain positions) works natively.
  • Cleanup acceleration via FAISS-binary popcount. OPB query stage 2 uses SIMD popcount over sign-quantized atoms with deterministic float32 cosine rerank. Substantially faster on warm queries; replay bit-identical.
  • 551× compression on stored OPB pages (rank-12 SVD). Persistence blobs that were >100 MB now fit in under 1 MB at perfect recall on round-trip.

The 9-level cognitive ladder — no LLM vendor ships rows 3-9

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) agent_model_belief_add · agent_model_belief hallucinates at depth
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 agent_induce_rule fine-tune (many examples)
8 Persistent rule storage 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 a graduated, production-shipped engine. No published memory vendor offers more than rows 1-2. Substrate-augmented small LLMs can match frontier-class agentic capabilities at a fraction of the 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 varies <100ms
Cost per recall vs context-stuffing varies varies dramatically lower

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


Download files

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

Source Distribution

neruva_mcp-0.20.0.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

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

neruva_mcp-0.20.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file neruva_mcp-0.20.0.tar.gz.

File metadata

  • Download URL: neruva_mcp-0.20.0.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for neruva_mcp-0.20.0.tar.gz
Algorithm Hash digest
SHA256 dedb9e14833214976dea6b12d4fbe91bdc0517b6bf85945bc07b9884889eccc7
MD5 9281b858159461f78c9791b5af5da2eb
BLAKE2b-256 be56e39448929dbaeeb8cf729c93bc898f5c37ea568279d164d80cf29a0cdd1b

See more details on using hashes here.

File details

Details for the file neruva_mcp-0.20.0-py3-none-any.whl.

File metadata

  • Download URL: neruva_mcp-0.20.0-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for neruva_mcp-0.20.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06548037ee7baf5e7d65d701aec2efa3c48286df0f85aff4cafe56efbc2743a3
MD5 69863cbf6c808866ce8c62e9fabec61f
BLAKE2b-256 3b3dcc8839a5a1104c403cc59fe5e0d8b4565964455ba3db3b0c37cfbbd4c433

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