Drop-in CrewAI memory integration for Neruva. Replaces CrewAI's default storage with Records + KG federation. Substrate (v0.5.7) adds typed-shape context dispatch, tenant-specific PII rules, depth-unlimited nested-belief tracking, counterfactual rollouts, EFE planner, continual learning. Deterministic from seed (bit-identical replay). Persists across crew runs, supports semantic search via agent_recall, optional entity tracking via the HD knowledge graph. One-line install.
Project description
neruva-crewai
Drop-in CrewAI memory integration for Neruva. Three memory flavors backed by the Neruva substrate.
pip install neruva-crewai
What's new in the substrate (v0.5.7, May 2026)
The substrate this adapter wraps has gained a lot since the last release. Existing code keeps working — new capabilities are just available.
- Deterministic replay — every query is bit-identical across reruns from the same seed. Replay any past crew state for audit or debugging.
- Typed-shape context — pull structured JSON from records with
per-field citations.
{question, shape: {field: type}}→ typed result without an LLM at query time. Natural fit for crew tool calls that need a specific output schema. - Tenant-specific PII rules — register your custom ID formats (employee codes, patient codes, order IDs) from 3-5 examples. The substrate redacts them automatically.
- Depth-unlimited nested-belief tracking — store and retrieve
chains like
Alice → Bob → Carol thinks Xat any depth, with inner-position-swap rejection. Useful for multi-agent crew sims. - Counterfactual rollouts — "what if action k had been a' instead?" Replay an action sequence with one step substituted.
- Active inference planning — score candidate action sequences by KL distance to a goal-marginal.
- Continual K-gram learning — provable no-forgetting via integer-add commutativity.
Quick start
from neruva_crewai import NeruvaLongTermMemory
from crewai import Crew
memory = NeruvaLongTermMemory(
namespace="my_project", # one per crew / domain
api_key="nv_...", # or env NERUVA_API_KEY
)
crew = Crew(
agents=[...],
tasks=[...],
memory=True,
long_term_memory=memory, # plugged in here
)
Three memory flavors
| Class | What it backs | Underlying substrate |
|---|---|---|
NeruvaShortTermMemory |
CrewAI ShortTermMemory (per-run scratchpad) | Records, kind="short_term" |
NeruvaLongTermMemory |
CrewAI LongTermMemory (cross-run persistent) | Records, kind="long_term" |
NeruvaEntityMemory |
CrewAI EntityMemory (named entities + relationships) | Records + HD KG triples |
All three persist across process restarts via GCS — no Redis or Postgres setup required.
Entity memory with triple binding
Use the canonical extraction prompt to extract triples in your own LLM turn (Claude / GPT / etc), then pass them as metadata:
from neruva_crewai import NeruvaEntityMemory
entity_mem = NeruvaEntityMemory(namespace="my_project", api_key="nv_...")
# After your agent observes a fact about an entity:
entity_mem.save(
value="Caroline researches adoption agencies",
metadata={
"triples": [
["caroline", "researches", "adoption_agencies"],
["caroline", "works_at", "charity"],
],
},
)
# Later — sub-ms KG entity recall:
results = entity_mem.search("What did Caroline research?", limit=5)
Or use Neruva's agent_remember(extract="managed") to have the
substrate run extraction for you on every save (server-side,
sub-$0.001/turn typical).
Why use Neruva instead of CrewAI's default storage?
| Feature | CrewAI default | Neruva |
|---|---|---|
| Persists across process restart | ChromaDB local file | GCS-backed, multi-machine |
| Cross-crew recall | Manual setup | One namespace per crew, instant federation |
| Knowledge-graph entity tracking | LLM-based, opaque | HD KG, sub-ms cosine, deterministic |
| Causal queries / Pearl do-operator | Not offered | agent_causal_query |
| Provable replay | Not offered | agent_snapshot + agent_restore |
| GDPR forget by user | Manual | user_id auto-folds, one-call forget |
| Portability | None | .neruva zip container |
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 neruva_crewai-0.1.2.tar.gz.
File metadata
- Download URL: neruva_crewai-0.1.2.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcc0ef1b6b91e74ad8621a5d31da94000b852bfcde57c5f304e715ac4a108a6e
|
|
| MD5 |
037ccab6c13d0f266b68e3675bab1dbe
|
|
| BLAKE2b-256 |
466e6ad3524b34af8b91d9c327744bfb9a3693c96d22c18f6d4f8fd4b2e536a9
|
File details
Details for the file neruva_crewai-0.1.2-py3-none-any.whl.
File metadata
- Download URL: neruva_crewai-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.2 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 |
35d815ee05459762b0e4c9133adcf782ebf8c1cb57ee1c77d5fc1a737310029c
|
|
| MD5 |
c46e1217c176d47b91f3c09ffccdac44
|
|
| BLAKE2b-256 |
899be3c0bde424e2c10e9045c1d421775602539787eeee72fc6f5fe1dfc6c400
|