Skip to main content
Build stateful agents with LangGraph that remember context across sessions. Supermemory handles memory storage and retrieval while LangGraph manages your graph-based conversation flow.

Overview

This guide shows how to integrate Supermemory with LangGraph to create agents that:
  • Maintain user context through automatic profiling
  • Store and retrieve relevant memories at each node
  • Use conditional logic to decide what’s worth remembering
  • Combine short-term (session) and long-term (cross-session) memory

Setup

Install the required packages:
Configure your environment:
Get your Supermemory API key from console.supermemory.ai.

Basic integration

A minimal agent that fetches user context before responding and stores the conversation after:

Core concepts

User profiles

Supermemory automatically builds user profiles from stored memories:
  • Static facts: Long-term information (preferences, expertise, background)
  • Dynamic context: Recent activity and current focus

Memory storage

Content you add gets processed into searchable memories:
Search returns both extracted memories and document chunks:

Complete example: support agent

A support agent that learns from past tickets and adapts to each user’s technical level: