Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/context/compaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ agent, it summarizes data from older events once it reaches a threshold of a
specific number of workflow events, or invocations, with the current Session.

```python
from google.adk.apps.app import EventsCompactionConfig

# (Optional) Event-based, sliding window as supplementary setting
compaction_config = EventsCompactionConfig(
compaction_interval=10, # Number of turns between standard compactions
overlap_size=2, # Number of events to retain as overlapping context
)
```

## Configure context compaction
Expand Down