Quick Start
1
Install Dependencies
2
Initialize Ryumem
Need to set up a Ryumem server? See the Setup Guide.
3
Add Memory to Agent
search_memory()- Find relevant information from past conversationssave_memory()- Store new information for later retrievalget_entity_context()- Get comprehensive context about specific entities (when entity extraction is enabled)
All tool executions are automatically logged when
track_tools=True, creating a complete history of what your agent has done.Automatic Query Tracking & Augmentation
Wrap your runner to automatically track user queries and augment them with relevant historical context:What This Does
Whenaugment_queries=True (configured in Ryumem instance):
- Tracks user queries as episodes automatically
- Finds similar past queries using semantic search
- Augments new queries with context from similar past conversations
- Links queries to tool executions hierarchically
Configuration Options
All configuration is done when initializing the Ryumem instance:- Which tools were called
- What parameters were used
- What results were returned
- When they were executed
Complete Example
See a full working example in the repository:Password Guessing Game
Advanced demo showing how query augmentation helps agents learn
Basic Usage
Basic example with memory and search
API Reference
add_memory_to_agent()
Adds memory tools to a Google ADK agent.
Parameters:
agent- The Google ADK Agent instanceryumem_instance- Initialized Ryumem instance (all configuration comes from this)
- The same agent instance (modified in-place with memory tools)
track_tools, extract_entities, etc. are set when initializing the Ryumem instance, not when calling this function.
wrap_runner_with_tracking()
Wraps a Google ADK Runner to track queries and optionally augment them with history.
Parameters:
original_runner- Google ADK Runner instanceagent_with_memory- Agent that has been enhanced withadd_memory_to_agent()
- The same runner instance (modified in-place with tracking)
augment_queries, similarity_threshold, top_k_similar are set when initializing the Ryumem instance.