adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

Provide an option to remove events from the session

Open monojack opened this issue 1 year ago • 5 comments

Currently, there is a way to append_event with the session service. It would be useful to also have a way to remove or replace one or more events (splice).

This could help with removing function calls and results or other types of events that are no longer relevant for the session as it grows. e.g.:

  1. remove retrieval results as they become irrelevant, because they would just increase the input token count up to the point where the session may be blocked because of rate limits.
  2. replace the first n events with a summary of the conversation so we can efficiently manage the input tokens.

monojack avatar May 29 '25 11:05 monojack

I have a very similar problem I know i we use the same session there's a chain of events within the session, and its somehow important to give some context to agent, but how can we limit this, I have over 200 events and the input context blows to over 30000 input tokens and hence inducing latency. Any suggestions?

Raun96 avatar May 30 '25 07:05 Raun96

Similar issue as well - in our case we are running into rate limit issue as our events hold relatively big context , not only this issue causes big latency but also causes unnecessary cost - would be glad seeing the priority of this feature bumping up as this is a blocker for us working with ADK as our agentic framework

haimco50 avatar May 30 '25 07:05 haimco50

I’ve proposed a comprehensive, backward-compatible solution design to address this in [#1723 ]https://github.com/google/adk-python/issues/1723), including pruning, summarisation, and audit integrity.

Would love your feedback 🙏 /cc @wyf7107 @Jacksunwei

Pajamajoker avatar Jul 01 '25 00:07 Pajamajoker

To reset the events to some point in history is a must (or even mutate the event/s)! Without it, adk is useless for features that users have become accustomed to, such as edit, regenerate, or remove… In all these cases, we need to reset the session to a specific point.

I really don’t understand what’s going on. What’s the purpose of this framework if anyone who wants to ship a production-ready product to users can’t do it? Also, the adk web and other modes look like a sandbox for children. Why don’t the docs show how to build a real app, where the user has their own frontend and uses adk on the backend?

I spent several weeks creating an app using adk (tried to transit from LangChain). I’m in shock, and I feel like there’s someone on the team whose goal is to make this framework the most complicated (and useless) in the world—and they’re doing a great job!

What can I say? Even Gemini (and any other not google model) doesn’t understand how it works, even if you give it all the docs, and it uses web, and so on.

This framework has the potential to bring Google billions of dollars, thanks to its use of the Gemini API in conjunction with ADK for creating agents. However, it seems that the ADK development team is more focused on satisfying their own need to feel like super-cool coders and system designers, rather than caring about the developers who will actually be working with it.

vadympetryshyn avatar Jul 19 '25 14:07 vadympetryshyn

Hi @monojack and thanks to everyone who participated in this thread.

We're currently doing some housekeeping on our issue tracker. Given the rapid pace of development and the number of updates since this was last active, there's a good chance this issue has been resolved in a newer version. To help us keep our backlog focused on current issues, we are closing this as stale.

If you're still facing this problem, could you please update to the very latest version of the library and confirm the issue still exists? If it does, please comment here, and we will be happy to reopen this issue and investigate further.

Thanks for your contribution and understanding!

surajksharma07 avatar Oct 07 '25 11:10 surajksharma07