CrewAI
Add Suprflo long-term memory to CrewAI crews and agents. Ships in the Python SDK.
Install
pip install "suprflo[crewai]"Version support
Targets the CrewAI 0.70 → 0.119 memory contract (Storage + ExternalMemory). CrewAI's newer 1.x line restructured the memory package and removed both, so this adapter is not expected to work there. It was written against the v0.119.0 source and is not verified against a live install.
What you get
Both are built on the Python SDK MemoryClient:
SuprfloStorage— a CrewAIStorage(save,search,reset) you hand toExternalMemory, so the whole crew shares one memory across runs.create_memory_tools(client, user_id)— CrewAI tools (save_memory,search_memory) to drop into an agent's toolset. The classesSaveMemoryTool/SearchMemoryToolare exported too if you'd rather bind them yourself.
External memory for a crew
from crewai import Crew
from crewai.memory import ExternalMemory
from suprflo import MemoryClient
from suprflo.integrations.crewai import SuprfloStorage
client = MemoryClient(api_key="YOUR_API_KEY")
storage = SuprfloStorage(client, user_id="alice")
crew = Crew(
agents=[...],
tasks=[...],
external_memory=ExternalMemory(storage=storage),
)search returns dicts carrying a memory key, which is what CrewAI's ContextualMemory reads when it builds task context.
Tools for an agent
from crewai import Agent
from suprflo.integrations.crewai import create_memory_tools
agent = Agent(
role="Assistant",
goal="Help Alice, remembering what she tells you",
backstory="...",
tools=create_memory_tools(client, user_id="alice"),
)Scoping
SuprfloStorage(client, user_id=..., agent_id=..., run_id=...) — whatever you set is applied to every save, search and reset.
Notes and caveats
score_thresholdis forwarded to Suprflo's server-sidethreshold. CrewAI's default of0.35was tuned for other backends and Suprflo scores aren't guaranteed to be on the same scale — tune it if recall looks wrong.reset()needs a scope. With nouser_id/agent_id/run_idit would wipe every memory in the workspace, so it raisesValueErrorinstead.
If
crewaiisn't installed, importing this module raises a clearImportErrortelling you topip install "suprflo[crewai]".