Module 4: Memory & Context
Session, State, Event, Caching, Compression, Rewind
6 posts
Module 4: Memory & Context
ADK’s most core differentiator — understand how Agent “remembers” conversations, manages state, and optimizes context. From Session lifecycle to session rewind.
Articles
| # | Article | Case | Status |
|---|---|---|---|
| 1 | Session Management: Creation, Persistence and Recovery | adk-go-memory-session | 🔄 In Progress |
| 2 | State Read/Write: Agent Internal State | adk-go-memory-state | 🔄 In Progress |
| 3 | Event System: Understanding Agent Event Flow | adk-go-memory-event | 🔄 In Progress |
| 4 | Context Caching: Large Context Optimization | adk-go-memory-context-caching | 🔄 In Progress |
| 5 | Context Compression: Keep Context Lean | adk-go-memory-context-compression | 🔄 In Progress |
| 6 | Rewind Sessions: Session Rewind | adk-go-memory-rewind | 🔄 In Progress |
Prerequisites
- Completed Module 3: Tool Usage
- Understand Agent and Tool basics
Learning Objectives
After completing this module, you will:
- Master Session creation, persistence and recovery
- Understand State read/write API and cross-turn sharing
- Listen and handle various Agent events
- Optimize with context caching and compression
- Know when to use session rewind
Learning Path
Complete these six articles in order before proceeding to the “Multi-Agent Collaboration” module.
← Module 3: Tool Usage | Module 5: Multi-Agent Collaboration →
详解 ADK Go 的 Rewind 机制——如何将 Agent 回溯到历史状态重新执行,适用于 Agent 走错路、需要重新来的场景。
详解 ADK Go 的 Context Compression 机制——如何压缩历史消息,保持上下文精简,控制 token 消耗。
详解 ADK Go 的 Context Caching 机制——如何缓存上下文减少 token 消耗,以及适用场景和限制。
详解 ADK Go 中 Event 的类型、EventHandler 的使用,以及如何监听和处理 Agent 运行过程中的各种事件。
State 读写:Agent 内部状态管理
详解 ADK Go 中 State 的概念、读写 API,以及如何在多轮对话中保持和共享自定义状态数据。
Session Management: Creation, Persistence and Recovery
Detailed explanation of Session concept, creation, persistence and recovery mechanism in ADK Go, understanding how to maintain Agent context in multi-turn conversations.
