Skip to main content

SUBSTRATE persistent memory provider for CrewAI -- causal memory, emotion, and identity for your AI crews.

Project description

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.

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

crewai_substrate_memory-0.2.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

crewai_substrate_memory-0.2.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file crewai_substrate_memory-0.2.0.tar.gz.

File metadata

  • Download URL: crewai_substrate_memory-0.2.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for crewai_substrate_memory-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1feebc79e5d45fca6a9d3bdb6f52aed56d93e4c4999a1ea21cf2a6b958f581e2
MD5 351a4581df1b99f8190b251375d06752
BLAKE2b-256 eb079f55dd8d511b6d13f7b1f19ccc2baa046f9c165776b9af8c0d8bd31c38c2

See more details on using hashes here.

File details

Details for the file crewai_substrate_memory-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for crewai_substrate_memory-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22cc0aa79d24e149e18414ea2ab439760b80661ef2294f2b5a4b3d3754166ab3
MD5 5fe10e0306c6dd25fb961dde548c8d4c
BLAKE2b-256 b212b784dfe4906cce1a7463f2299483a292e472973a06e59c9a0b6f4b21c4f4

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