Skip to content

CrewAI

Add Suprflo long-term memory to CrewAI crews and agents. Ships in the Python SDK.

Install

bash
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 CrewAI Storage (save, search, reset) you hand to ExternalMemory, 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 classes SaveMemoryTool / SearchMemoryTool are exported too if you'd rather bind them yourself.

External memory for a crew

python
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

python
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_threshold is forwarded to Suprflo's server-side threshold. CrewAI's default of 0.35 was 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 no user_id / agent_id / run_id it would wipe every memory in the workspace, so it raises ValueError instead.

If crewai isn't installed, importing this module raises a clear ImportError telling you to pip install "suprflo[crewai]".

The memory layer for AI agents.