packages/pipecat-sdk-python/Agents.md
This package adds persistent memory to Pipecat voice AI pipelines using Supermemory.
Tech Stack: Python >=3.10, Pipecat, Supermemory SDK
pip install supermemory-pipecat
Place SupermemoryPipecatService between context aggregator and LLM in the pipeline:
from supermemory_pipecat import SupermemoryPipecatService
memory = SupermemoryPipecatService(
user_id="user-123", # Required: identifies the user
session_id="session-456", # Optional: groups conversations
)
pipeline = Pipeline([
transport.input(),
stt,
context_aggregator.user(),
memory, # <- Memory service here
llm,
tts,
transport.output(),
context_aggregator.assistant(),
])
memory = SupermemoryPipecatService(
api_key="...", # Or use SUPERMEMORY_API_KEY env var
user_id="user-123",
session_id="session-456",
params=SupermemoryPipecatService.InputParams(
search_limit=10, # Max memories to retrieve
search_threshold=0.1, # Similarity threshold 0.0-1.0
mode="full", # "profile" | "query" | "full"
system_prompt="Based on previous conversations:\n\n",
),
)
| Mode | Retrieves | Use When |
|---|---|---|
"profile" | User profile only | Personalization without search |
"query" | Search results only | Finding relevant past context |
"full" | Profile + search | Complete memory (default) |
SUPERMEMORY_API_KEY - Supermemory API keyOPENAI_API_KEY - For OpenAI services (STT/LLM/TTS)context_aggregator.user() and before llmuser_id - it's required