Skip to main content

Install

pip install synap-agno

What’s included

ClassPurpose
SynapDbExtends Agno’s InMemoryDb to persist user memories in Synap

Quick start

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from synap_agno import SynapDb

db = SynapDb(sdk=sdk, customer_id="acme")   # customer_id is optional

agent = Agent(
    db=db,
    model=OpenAIChat(id="gpt-4o-mini"),
    enable_user_memories=True,
)

agent.run("Remember that I prefer async communication", user_id="alice")
agent.run("What are my communication preferences?", user_id="alice")

How it works

SynapDb overrides the four memory methods of Agno’s InMemoryDb:
MethodBehavior
upsert_user_memoryWrites a new or updated memory to Synap
get_user_memoryFetches a specific memory by ID
get_user_memoriesRetrieves all memories for a user (semantic search)
get_all_memory_topicsReturns unique memory topics via a broad search
All other InMemoryDb behavior (including non-memory operations) is inherited unchanged.

Multi-user setup

The user_id is passed per-call by Agno’s agent runtime, so a single SynapDb instance serves all users:
db = SynapDb(sdk=sdk, customer_id="acme")

for user_id in ["alice", "bob", "carol"]:
    agent.run("What do you remember about me?", user_id=user_id)

Next steps

Google ADK

FunctionTool factory for Google ADK agents.

OpenAI Agents

Function tools for the OpenAI Agents SDK.