Skip to main content
Supermemory integrates with Pipecat, providing long-term memory capabilities for voice AI agents. Your Pipecat applications will remember past conversations and provide personalized responses based on user history.

Installation

To use Supermemory with Pipecat, install the required dependencies:
Set up your API key as an environment variable:
You can obtain an API key from console.supermemory.ai.

Configuration

Supermemory integration is provided through the SupermemoryPipecatService class in Pipecat:

Pipeline Integration

The SupermemoryPipecatService should be positioned between your context aggregator and LLM service in the Pipecat pipeline:

How It Works

When integrated with Pipecat, Supermemory provides two key functionalities:

1. Memory Retrieval

When a user message is detected, Supermemory retrieves relevant memories:
  • Static Profile: Persistent facts about the user
  • Dynamic Profile: Recent context and preferences
  • Search Results: Semantically relevant past memories

2. Context Enhancement

Retrieved memories are formatted and injected into the LLM context before generation, giving the model awareness of past conversations.

Memory Modes

ModeStatic ProfileDynamic ProfileSearch ResultsUse Case
"profile"YesYesNoPersonalization without search
"query"NoNoYesFinding relevant past context
"full"YesYesYesComplete memory (default)

Configuration Options

You can customize how memories are retrieved and used:

InputParams

ParameterTypeDefaultDescription
search_limitint10Maximum number of memories to retrieve per query
search_thresholdfloat0.1Minimum similarity threshold for memory retrieval
modestr”full”Memory retrieval mode: "profile", "query", or "full"
system_promptstr”Based on previous conversations:\n\n”Prefix text for memory context
inject_modestr”auto”How memories are injected: "auto", "system", or "user"

Injection Modes

The inject_mode parameter controls how memories are added to the LLM context:
ModeBehavior
"auto"Auto-detects based on frame types. If audio frames detected → injects to system prompt (speech-to-speech). If only text frames → injects as user message (STT/TTS).
"system"Always injects memories into the system prompt
"user"Always injects memories as a user message

Speech-to-Speech Models (Gemini Live, etc.)

For speech-to-speech models like Gemini Live, the SDK automatically detects audio frames and injects memories into the system prompt. No configuration needed:

Example: Voice Agent with Memory

Here’s a complete example of a Pipecat voice agent with Supermemory integration:

Example: Gemini Live with Memory

For a complete example using Gemini Live speech-to-speech with Supermemory, check out the reference implementation:

Pipecat Memory Example

Full working example with Gemini Live, including frontend and backend code.