Metadata-Version: 2.4
Name: neruva-crewai
Version: 0.1.1
Summary: Drop-in CrewAI memory integration for Neruva substrate. Replaces CrewAI's default storage with Records + KG federation. Persists across crew runs, supports semantic search via agent_recall, optional entity tracking via the HD knowledge graph. One-line install.
Author-email: Clouthier Simulation Labs <info@neruva.io>
License: MIT
Project-URL: Homepage, https://neruva.io/integrations/
Project-URL: Documentation, https://neruva.io/docs/
Project-URL: Source, https://github.com/CloutSimLabs/neruva
Keywords: crewai,neruva,agent-memory,memory,ai,llm,multi-agent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27
Requires-Dist: crewai>=0.30.0
Dynamic: license-file

# neruva-crewai

Drop-in CrewAI memory integration for [Neruva](https://neruva.io).
Three memory flavors backed by the Neruva substrate.

```bash
pip install neruva-crewai
```

## Quick start

```python
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:

```python
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 (calls Sonnet 4.6,
~$0.002/turn).

## 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 |

[Get an API key](https://app.neruva.io) · [Docs](https://neruva.io/docs/)
