crewai-substrate-memory
SUBSTRATE persistent memory provider for CrewAI. Gives your AI crew causal memory, emotional context, and cryptographic identity continuity through the SUBSTRATE MCP server.
What SUBSTRATE adds to CrewAI
- Causal memory -- episodes linked by cause-effect rules, not just vector similarity
- Emotional context -- valence, arousal, dominance, certainty (no other provider has this)
- Identity continuity -- cryptographically signed proof-of-existence chain across sessions
- Trust architecture -- consistency ratings and verification status for every memory
- Hybrid search -- semantic + keyword retrieval across the entity's full knowledge store
Installation
pip install crewai-substrate-memory
Quick start
import os
from crewai import Agent, Task, Crew
from crewai_substrate import SubstrateMemoryProvider
# 1. Create the SUBSTRATE memory provider
memory = SubstrateMemoryProvider(
api_key=os.environ["SUBSTRATE_API_KEY"],
)
# 2. Define your agents
researcher = Agent(
role="Researcher",
goal="Find relevant information on a topic",
backstory="Expert researcher with deep analytical skills",
)
writer = Agent(
role="Writer",
goal="Write clear, compelling content",
backstory="Professional writer who crafts engaging narratives",
)
# 3. Define tasks
research_task = Task(
description="Research the latest developments in causal AI",
agent=researcher,
expected_output="A summary of key developments",
)
writing_task = Task(
description="Write a brief article based on the research",
agent=writer,
expected_output="A 500-word article",
)
# 4. Create the crew with SUBSTRATE memory
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, writing_task],
memory=True,
memory_config={"provider": memory},
verbose=True,
)
result = crew.kickoff()
print(result)
SUBSTRATE-exclusive features
Emotional context
# Get the entity's emotional state (UASV -- Unified Affective State Vector)
emotion = memory.get_emotional_context()
print(emotion)
# {"valence": 0.7, "arousal": 0.4, "dominance": 0.6, "certainty": 0.8}
Entity state (identity + trust)
# Verify cryptographic identity and get trust scores
state = memory.get_entity_state()
print(state["identity"]) # Continuity chain verification
print(state["trust"]) # Trust scores and consistency ratings
Memory statistics
stats = memory.get_memory_stats()
print(stats)
# {"episode_count": 142, "rule_count": 37, "avg_probability": 0.82, ...}
Configuration
| Parameter | Default | Description |
|---|---|---|
api_key |
$SUBSTRATE_API_KEY |
Your SUBSTRATE API key |
base_url |
https://substrate.garmolabs.com/mcp-server/mcp |
MCP server endpoint |
timeout |
30.0 |
HTTP request timeout (seconds) |
API key
Get your API key at garmolabs.com. The free tier includes memory_search and get_emotion_state. Upgrade to Pro for hybrid_search and get_trust_state.
License
MIT -- see LICENSE for details.
Built by Garmo Labs.
Metadata
Release files for crewai-substrate-memory 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| crewai_substrate_memory-0.2.0.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| crewai_substrate_memory-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.6 kB
Release files / crewai_substrate_memory-0.2.0.tar.gz
| Download URL | crewai_substrate_memory-0.2.0.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1feebc79e5d45fca6a9d3bdb6f52aed56d93e4c4999a1ea21cf2a6b958f581e2
|
|
BLAKE2b-256 checksum How to use checksums |
eb079f55dd8d511b6d13f7b1f19ccc2baa046f9c165776b9af8c0d8bd31c38c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / crewai_substrate_memory-0.2.0-py3-none-any.whl
| Download URL | crewai_substrate_memory-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
22cc0aa79d24e149e18414ea2ab439760b80661ef2294f2b5a4b3d3754166ab3
|
|
BLAKE2b-256 checksum How to use checksums |
b212b784dfe4906cce1a7463f2299483a292e472973a06e59c9a0b6f4b21c4f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|