CrewAI integration
Astrocyte as shared crew memory and per-agent memory for CrewAI applications.
Module: astrocyte.integrations.crewai
Pattern: Crew/agent memory — save, search, reset, per-agent banks
Framework dependency: crewai (optional)
Install
Section titled “Install”pip install astrocyte crewaifrom astrocyte import Astrocytefrom astrocyte.integrations.crewai import AstrocyteCrewMemory
brain = Astrocyte.from_config("astrocyte.yaml")
# Shared crew memory + per-agent banksmemory = AstrocyteCrewMemory( brain, bank_id="team-shared", agent_banks={"devops": "devops-bank", "researcher": "research-bank"},)
# Save with agent attributionawait memory.save( "Kubernetes deploys via Helm charts", agent_id="devops", tags=["infrastructure"],)
# Search across the crew's shared bankresults = await memory.search("deployment strategy")
# Reset a specific agent's memoryawait memory.reset(agent_id="devops")Integration pattern
Section titled “Integration pattern”| CrewAI operation | Astrocyte call |
|---|---|
memory.save(content, agent_id=...) | brain.retain() with agent metadata |
memory.search(query, agent_id=...) | brain.recall() scoped to agent or shared bank |
memory.reset(agent_id=...) | brain.forget(scope="all") on the agent’s bank |
API reference
Section titled “API reference”AstrocyteCrewMemory(brain, bank_id, *, agent_banks=None, auto_retain=False)
Section titled “AstrocyteCrewMemory(brain, bank_id, *, agent_banks=None, auto_retain=False)”| Parameter | Type | Description |
|---|---|---|
brain | Astrocyte | Configured Astrocyte instance |
bank_id | str | Shared crew bank |
agent_banks | dict[str, str] | Agent ID → bank ID mapping for per-agent memory |
auto_retain | bool | Auto-retain after each task (default: False) |
Methods
Section titled “Methods”save(content, *, agent_id=None, tags=None, metadata=None)→Nonesearch(query, *, agent_id=None, max_results=5, tags=None)→list[dict]reset(*, agent_id=None)→None