Skip to main content
Give your OpenAI Agents SDK agents structured memory that persists across sessions.

Why Use This Integration

  • Persistent Memory: Knowledge survives agent restarts and session boundaries
  • Advanced Retrieval: Natural language queries backed by graph + vector search
  • Sessionized tools: Built in session data organization in memory
  • Native SDK Tools: Works directly with OpenAI’s function_tool pattern
  • Async-First: Built for high-performance applications with proper concurrency handling

Installation

Quick Start

Configure your environment variables:
Add memory tools to your agent:

Cross-Session Persistence

Memory persists across different agent instances:

Custom Session Management

Control session isolation with custom session IDs:
Sessionized tools scope data to their session ID. Use non-sessionized add_tool and search_tool to access data across all sessions.

How It Works

  1. Add Tool: Stores data in cognee’s knowledge graph with embeddings
  2. Search Tool: Retrieves relevant information via cognee’s recall pipeline
  3. Auto-Processing: cognee extracts entities, relationships, and context automatically
  4. Session Scoping: Sessionized tools filter by session; non-sessionized tools access everything

Use Cases

Pre-load documents into cognee before creating agents:
Maintain user context across work sessions:
Isolate data per user or organization:
Share knowledge between specialized agents:
Route requests to specialized agents with shared memory:

GitHub Repository

View source code and examples

Example Notebook

Step-by-step tutorial with demos