add_tool and retrieve it via natural language with search_tool — memory that survives across crews and runs.
Why Use This Integration
- Shared crew memory: Multiple agents read and write the same knowledge graph
- Semantic recall: Retrieve information using natural language queries
- Session isolation: Multi-tenant support with per-user/session data separation
- Drop-in tools: Add
add_toolandsearch_toolto any CrewAI agent
Installation
Requires Python 3.10+. Pins
cognee>=0.4.0, crewai>=1.5.0, and crewai-tools>=1.5.0.Quick Start
Set your LLM key, then attach the tools to a CrewAI agent:Tools
| Tool | Signature | Description |
|---|---|---|
add_tool | add_tool(data: str, node_set: Optional[List[str]] = None) | Store information in the knowledge base for later retrieval |
search_tool | search_tool(query_text: str) | Search and retrieve stored information with natural language |
add_tool queues writes and runs cognee.cognify() after each batch, so data is indexed before searches. Async operations have a default 120-second timeout.Session Management
Useget_sessionized_cognee_tools(session_id) to isolate data per user or session:
If you omit
session_id, a UUID-based session ID is generated automatically. Session isolation is implemented by injecting the session ID into the node_set of add_tool.How It Works
- Add Tool: Stores data in cognee’s knowledge graph with embeddings, then cognifies it
- Search Tool: Retrieves relevant information via
cognee.search() - Auto-Processing: cognee extracts entities, relationships, and context automatically
- Background loop: cognee’s async API runs on a dedicated background event loop with safe concurrent writes
GitHub Repository
View source code and examples
Examples
Runnable example scripts