remember and recall — that write to a permanent knowledge graph or a lightweight session cache, and survive across agent instances.
Why Use This Integration
- Two memory tiers: Write straight to the permanent knowledge graph, or to a cheap per-session cache that you promote later
- Natural language recall: Retrieve stored knowledge with graph traversal and vector similarity
- Cross-session memory: Context persists across agent instances and restarts
- Drop-in tools:
cognee_tools()returns ready-to-use Strands tools
Installation
Requires Python 3.10+. Pins
cognee>=1.0.0,<=1.1.2 and strands-agents>=1.42.0,<2.0.0.Quick Start
Set your LLM key (cognee extracts knowledge with an LLM), then attach the tools:Tools
cognee_tools(session_id=None, *, remember_kwargs=None, recall_kwargs=None) returns a list of two tools:
| Tool | Description |
|---|---|
remember | Store information in memory for later retrieval (wraps cognee.remember) |
recall | Search and retrieve stored information with natural language (wraps cognee.recall) |
Session Memory
By default,remember writes straight to the permanent knowledge graph. Pass a session_id to write to that session’s lightweight cache instead, then promote the cache into the graph when you’re ready:
Passing
remember_kwargs={"self_improvement": False} keeps session writes in cache-only mode until you call cognee.improve(...). Without a session_id, writes go directly to the permanent graph.How It Works
- Remember: Stores data in cognee’s memory — the permanent graph, or a session cache when
session_idis set - Recall: Retrieves relevant information via cognee’s recall pipeline
- Auto-Processing: cognee extracts entities, relationships, and context automatically
- Background loop: cognee’s async API runs on a dedicated background event loop;
run_cognee_task()handles this transparently
GitHub Repository
View source code and examples
Examples
Runnable example scripts