CrewAI Adapter

Status: 🔶 Beta
Language: Python
Package: hippocortex[crewai]

Install

pip install hippocortex[crewai]

Quick Start

from crewai import Agent, Task, Crew
from hippocortex.adapters import crewai as hx_crewai

# Build your crew normally
researcher = Agent(role="Researcher", ...)
writer = Agent(role="Writer", ...)
crew = Crew(agents=[researcher, writer], tasks=[...])

# Wrap with memory
crew = hx_crewai.wrap(crew, api_key="hx_live_...")

# Use normally
result = crew.kickoff()

What It Does

  1. Before kickoff: Synthesizes context from task descriptions and injects it into agent backstories.
  2. During kickoff: Captures task descriptions as tool call events.
  3. After kickoff: Captures the crew's final result.
  4. Cleanup: Restores original backstories after execution.

Configuration

crew = hx_crewai.wrap(
    crew,
    api_key="hx_live_...",       # Required (or set HIPPOCORTEX_API_KEY)
    session_id="crew-session",   # Custom session ID
    inject_memory=True,          # Inject context into backstories (default: True)
)

Supported Methods

MethodDescription
kickoff(inputs?)Synchronous kickoff with memory hooks
akickoff(inputs?)Async kickoff with memory hooks

Beta Limitations

  • CrewAI's internal API evolves frequently — the adapter targets the current stable interface but may need updates for future versions.
  • Context is injected via backstory augmentation, which may not work perfectly with all CrewAI configurations.
  • Task input interpolation uses Python's str.format() and may fail silently on complex templates.