Skip to main content
Give your Strands agents persistent memory powered by cognee. Built on cognee v1.0, the integration exposes two tools — 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:

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

  1. Remember: Stores data in cognee’s memory — the permanent graph, or a session cache when session_id is set
  2. Recall: Retrieves relevant information via cognee’s recall pipeline
  3. Auto-Processing: cognee extracts entities, relationships, and context automatically
  4. 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