Skip to main content

Install

pip install synap-crewai

What’s included

ClassPurpose
SynapStorageBackendImplements CrewAI’s StorageBackend protocol for persistent memory

Quick start

from crewai import Agent, Crew, Task
from crewai.memory import Memory
from synap_crewai import SynapStorageBackend

backend = SynapStorageBackend(
    sdk=sdk,
    user_id="alice",
    customer_id="acme",   # optional
)

memory = Memory(storage=backend)

crew = Crew(
    agents=[your_agent],
    tasks=[your_task],
    memory=memory,
)

result = crew.kickoff(inputs={"topic": "quarterly planning"})

How it works

SynapStorageBackend translates CrewAI’s memory calls to Synap’s API:
  • save(value, metadata) — ingests a memory fragment with optional metadata tags
  • search(query, limit, score_threshold) — semantic search, returns ranked results
  • list_records(limit) — returns recent memories (uses Synap search with a broad query)
  • count() — returns an approximate count via a broad search
CrewAI operations that have no direct Synap equivalent (e.g., delete) are no-ops with a warning.

Async-first

CrewAI 0.100+ supports async task execution. SynapStorageBackend exposes asearch for use in async crews:
results = await backend.asearch("project deadlines", limit=5)
The synchronous search method wraps asearch via an event loop bridge, so it works in both sync and async contexts.

Next steps

AutoGen

Tool implementations for AutoGen agents.

Pydantic AI

Deps and tools for Pydantic AI.