> ## Documentation Index
> Fetch the complete documentation index at: https://cortex-e852fafe-t3code-rewrite-docs-declutter.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CrewAI

> Give CrewAI agents memory that survives across runs, backed by HydraDB.

HydraDB as external memory for [CrewAI](https://crewai.com) agents. Crews recall
relevant history on each task and persist their outputs into HydraDB, so memory
survives across runs.

Install the [PyPI package](https://pypi.org/project/crewai-hydradb/):

```bash theme={"dark"}
pip install crewai-hydradb
```

```python theme={"dark"}
from crewai import Crew
from crewai.memory.external.external_memory import ExternalMemory
from hydradb_crewai import HydraDBClient, HydraDBStorage

client = HydraDBClient(api_key="sk_live_...", tenant_id="your-database")

crew = Crew(
    agents=[...],
    tasks=[...],
    external_memory=ExternalMemory(storage=HydraDBStorage(client)),
)
crew.kickoff()
```

<Note>
  Implements CrewAI's `Storage` interface via `ExternalMemory`, available in
  **CrewAI 1.0-1.10**. On **1.11+** (which restructured memory around an
  embedding-based `StorageBackend`), use HydraDB over [MCP](/plugins/mcp)
  instead. Outputs are stored as knowledge via the public `/context/ingest` path;
  `search` uses `POST /query`.
</Note>

## Feedback and contributions

This plugin is open source. Feel free to [raise an issue](https://github.com/hydra-db/hydradb-crewai-plugin/issues) or [contribute on GitHub](https://github.com/hydra-db/hydradb-crewai-plugin).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.