ADK Community Call Tech Deep Dive (Part 2): Context Management #3371
Shubhamsaboo
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello ADK community 👋
We're back with Part 2 of our ADK Community Call FAQ series. In case you missed it, here's the previous post for Part 1 with links to a group, recording, and slides.
This one is for our power users: a 5-question deep dive on Context Management: Caching and Compaction.
Q: How does ADK's LLM invocation consider compacted events? Does get_contents prioritize them?
A: Yes. get_contents decides the context passed to models. When there is compaction, there will be a compaction event action. Then we will use that event action’s summary to replace its raw content.
Q: Is context compaction a blocking process when it occurs?
A: It’s non-blocking. It’s triggered when the turn ends and processed in a background non-blocking task. Supported in run_async for now.
Q: Can context compaction be achieved for each sub-agent in a multi-agent system?
A: Context compaction works on sessions which are shared by sub-agents and root-agent. So it will work for both.
Q: Are there plans for 'smart' context compaction, like prioritizing user messages over tool calls?
A: It’s in our design. If we see more user requests from the community and a strong improvements, we will prioritize this.
Q: Is there any context caching for LiteLLM-based models?
A: We currently only have context caching implementation for Gemini models. Community contribution is welcome to add context caching for other models.
To learn more, we definitely recommend checking out this code sample of a Cache Analysis Research Assistant that demonstrates ADK's context caching features.
Our next post on Tuesday, Nov 10th will cover Practical Agent Design & Patterns.
Beta Was this translation helpful? Give feedback.
All reactions