Skip to main content

Install

pip install synap-google-adk

What’s included

FunctionPurpose
create_synap_toolsReturns a list of two ADK FunctionTool objects for memory search and store

Quick start

from google.adk.agents import Agent
from synap_google_adk import create_synap_tools

tools = create_synap_tools(
    sdk=sdk,
    user_id="alice",
    customer_id="acme",   # optional
)

agent = Agent(
    name="MemoryAgent",
    model="gemini-2.0-flash",
    instruction="Use the synap_search tool to recall context about the user. Use synap_store to remember new facts.",
    tools=tools,
)
create_synap_tools returns [search_memory, store_memory] — two FunctionTool instances ready to pass directly to Agent(tools=...).

Tool signatures

search_memory(query: str, max_results: int = 5) -> list[dict] Semantic search over the user’s memories. Returns a list of {"content": "...", "type": "...", "confidence": float}. store_memory(content: str, memory_type: str = "fact") -> dict Stores a new memory. Returns {"status": "stored", "id": "..."}.

Multi-user setup

Create separate tool sets per user — the tools close over user_id and customer_id at construction time:
def build_agent_for_user(user_id: str) -> Agent:
    tools = create_synap_tools(sdk=sdk, user_id=user_id)
    return Agent(name="MemAgent", model="gemini-2.0-flash", tools=tools)

Next steps

Haystack

Pipeline components for Haystack.

Agno

InMemoryDb replacement for Agno agents.