๊ฐ€์ž… ํ›„ ์ดˆ๋Œ€ ๋งํฌ๋ฅผ ๊ณต์œ ํ•˜๋ฉด ๋™์˜์ƒ ์žฌ์ƒ ๋ฐ ์ดˆ๋Œ€ ๋ณด์ƒ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

cv usk
@cv_usk
AI / Software Research Notes AI Agent, LLMOps, MLOps, Software Architecture ๆŠ•็จฟใฏๅ€‹ไบบใฎๆ„่ฆ‹ใงใ™ใ€‚
๊ฐ€์ž… May 2026
258 ํŒ”๋กœ์ž‰ ์ค‘    225 ํŒฌ
# Useful but Little-Known Features of ADK 2.0 ๐ŸŒ What if your agent could remember conversations from last week and use that context to give better answers today? ADK 2.0's Memory feature provides agents with long-term knowledge that persists across sessions. It stores past conversations and learned information, retrieving them when needed. ๐Ÿ“Œ Title: Memory ๐Ÿ”— URL: ๐Ÿงฉ Overview Unlike State, Memory manages long-term knowledge that spans across sessions. Three memory service implementations are available: InMemoryMemoryService for development and testing, VertexAiMemoryBankService for production with semantic search, and VertexAiRagMemoryService for vector-based RAG. Two built-in tools handle retrieval: PreloadMemory (auto-loads at session start) and LoadMemory (loads on demand). For programmatic access, use tool_context.search_memory(). You can also combine multiple memory services through custom tools. ๐Ÿ›  How to use it Set up a memory service and add memory tools to your agent. ```python from google.adk.memory import InMemoryMemoryService from import PreloadMemory, LoadMemory # Development: in-memory implementation memory_service = InMemoryMemoryService() # Add memory tools to the agent agent = Agent( name="assistant", tools=[PreloadMemory(), LoadMemory()], ... ) # Configure the runner with the memory service runner = Runner( agent=agent, memory_service=memory_service, ... ) ``` To search memory programmatically from within a tool: ```python def my_tool(query: str, tool_context: ToolContext) -> str: results = tool_context.search_memory(query="past conversations") return str(results) ``` For multiple memory sources, create custom tools that integrate them together. ๐Ÿ— Building it into production ใƒปPrototype quickly with InMemoryMemoryService, then switch to VertexAI services for production ใƒปUse PreloadMemory to auto-load frequently needed context and improve response quality ใƒปDesign appropriate boundaries for what gets stored in memory to prevent data bloat ใƒปBuild custom tools to integrate multiple memory sources into a comprehensive knowledge base ๐Ÿ’ก Use cases ๐Ÿง  Generate personalized responses based on past conversation history ๐Ÿ“š Retain long-term memory of project discussions and decisions ๐Ÿ” Automatically retrieve relevant past interactions via semantic search ๐Ÿค Share a knowledge base across multiple agents using memory as a common layer โš ๏ธ Watch out InMemoryMemoryService loses all data when the process terminates โ€” do not use it in production. VertexAI-based services require GCP setup and configuration. As stored data grows, search latency can be affected, so plan a data management strategy for your memory stores. โœจ Memory gives your agents the ability to carry context across sessions. It's a game-changer for building agents that deliver consistently better long-term user experiences. #ADK# #AIAgent#
๋” ๋ณด๊ธฐ