Why Use This Integration
- Cross-Session Memory: Context persists across agent instances and conversation sessions
- Semantic Recall: Retrieve information using natural language queries
- Session Isolation: Multi-tenant support with per-user data separation
- Drop-in tools:
add_toolandsearch_toolwork with LangGraph agents out of the box
Installation
Quick Start
Before using the integration, configure your environment variables:ainvoke():
Tools
get_sessionized_cognee_tools(session_id=None, include_persist_tool=False, user=None) returns the memory tools:
Session Management
Pass asession_id to isolate memory per user or organization:
Session isolation is implemented by scoping data with
node_set=[session_id] for add_tool, and injecting the session_id into search_tool. Data added outside a session forms separate clusters.How It Works
- Add Tool: Stores data in cognee’s knowledge graph with embeddings
- Search Tool: Retrieves relevant information via cognee’s recall pipeline
- Auto-Processing: cognee extracts entities, relationships, and context automatically
- Session Scoping: Data is organized by session clusters but globally accessible
Use Cases
Knowledge Accumulation
Knowledge Accumulation
Build domain knowledge incrementally over multiple sessions:
Context-Aware Assistance
Context-Aware Assistance
Maintain user context across work sessions:
Multi-Tenant Applications
Multi-Tenant Applications
Isolate data per user/organization while sharing global knowledge:
GitHub Repository
View source code and examples
Examples
Runnable example scripts