Skip to main content

Quick Start: CrewAI

Add persistent memory to your CrewAI agents in minutes.
Ensure the Aegis server is running before proceeding. See the installation guide if needed.

Install

pip install "aegis-memory[crewai]"

Basic Setup

from aegis_memory.integrations.crewai import AegisCrewMemory
from crewai import Crew, Agent, Task

# Initialize Aegis memory backend
memory = AegisCrewMemory(
    api_key="dev-key",           # Use your API key in production
    namespace="my-crew"           # Isolates memories for this crew
)

# Create agents with memory enabled
researcher = Agent(
    role="Researcher",
    goal="Find accurate information",
    memory=True
)

writer = Agent(
    role="Writer",
    goal="Create clear content",
    memory=True
)

# Define tasks
research_task = Task(
    description="Research the latest trends in AI agents",
    agent=researcher,
    expected_output="A summary of key trends"
)

write_task = Task(
    description="Write a blog post based on the research",
    agent=writer,
    expected_output="A 500-word blog post"
)

# Create crew with Aegis memory
crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, write_task],
    memory=memory
)

result = crew.kickoff()

What Gets Remembered

Aegis automatically persists:
  • Research findings — Knowledge gathered across sessions
  • Successful approaches — What worked for similar tasks
  • Coordination context — How agents worked together
  • Lessons learned — Insights from failures and successes

Next Steps