GEMINI LABJP
API — The Interactions API reaches general availability as the primary API for Gemini models and agents, with a stable schemaAGENTS — With GA, the Interactions API formally supports Managed Agents and background execution, with Gemini Omni coming soonLIVE — The Live API and AI Studio add real-time speech-to-speech translation, auto-detecting 70+ languages while preserving intonationOMNI — Gemini Omni Flash, a natively multimodal model, enters API public preview for building custom video workflowsSPARK — Gemini Spark, Google's personal agent, arrives on macOS to work across local files and Google Workspace on your behalfPRO — Gemini 3.5 Pro is reported to be delayed to July 17, centered on a 2M-token context and a Deep Think Reasoning LayerAPI — The Interactions API reaches general availability as the primary API for Gemini models and agents, with a stable schemaAGENTS — With GA, the Interactions API formally supports Managed Agents and background execution, with Gemini Omni coming soonLIVE — The Live API and AI Studio add real-time speech-to-speech translation, auto-detecting 70+ languages while preserving intonationOMNI — Gemini Omni Flash, a natively multimodal model, enters API public preview for building custom video workflowsSPARK — Gemini Spark, Google's personal agent, arrives on macOS to work across local files and Google Workspace on your behalfPRO — Gemini 3.5 Pro is reported to be delayed to July 17, centered on a 2M-token context and a Deep Think Reasoning Layer
Articles/Advanced
Advanced/2026-07-10Advanced

My ADK Assistant Quietly Forgot a Deadline — Catching Compaction Memory Loss With a Recall Probe

Compacting conversation history in Google ADK with Gemini lowers cost, but it also erodes what your assistant remembers — silently. Here is how I built a recall probe to measure that loss, compared three compaction strategies against the same ledger, and stopped trading memory for tokens.

Google ADKSessionServiceConversation CompactionGemini72Long-Term MemoryPython37Eval Harness

Premium Article

The assistant answered a deadline question with a blank

One evening I was scrolling back through the logs of a small task assistant I run for myself. Nothing exotic — Gemini behind Google's Agent Development Kit, plain multi-turn conversation.

Three days earlier I had written: "I want the App Store screenshots ready by Friday 18:00."

Three days later I asked when that deadline was. The reply came back courteous and useless: "I'm afraid I don't have any information about a deadline. Could you tell me more?"

Nothing had crashed. No error, no alert. Latency held steady around 900ms. The month's API bill was down roughly 40% from the previous month. Every dashboard I owned was green.

The falling bill was the culprit. To keep long conversations from ballooning, I had added compaction: once a session passed ten turns, older turns were folded into a summary. That summary had thrown the deadline away.

I had instrumented cost. I had never instrumented memory.

Compaction is lossy compression that never reports its losses

JPEG artifacts you can see. Audio compression you can hear. Conversation compaction offers no equivalent sense.

The compacted assistant does not know what it forgot, because the fact of forgetting was itself discarded. That is where the polite, correct, worthless "I don't have that information" comes from.

StrategyWhat it discardsWhat tends to vanish quietly
Sliding window (keep last N turns)Whole older turnsPremises stated up front, user attributes
Summary compaction (fold history into one summary)Detail the summarizer omittedNumbers, proper nouns, dates, commitments
Hybrid (summary + last N verbatim)Detail from the middle of the conversationSpec changes agreed mid-conversation

Summary compaction does not drop what is semantically unimportant. It drops whatever the summarizer's prompt did not explicitly tell it to preserve. Across sixty turns, "Friday 18:00" is one line. The summarizer rounds it into "the user is preparing a store submission," and in that moment the hour is gone.

I stopped guessing at this. I started measuring it.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A working recall probe in Python that mechanically decides which facts a compacted session has lost
A side-by-side run of summary compaction, sliding window, and hybrid against one fact ledger — reading the recall-vs-token tradeoff honestly
The refactor that moves extracted facts outside the summarizer, so raising compression stops costing you names, deadlines, and decisions
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Advanced2026-06-27
Don't Ingest Gemini Deep Research Reports Blindly — A Citation-Verification Acceptance Gate for MCP-Grounded Research
Now that Deep Research connects to MCP servers and File Search, you can ground research on your own data. This builds an acceptance gate that verifies, before any automated ingest, whether each citation resolves to a trusted source — with an allowlist, a grounding-coverage ratio, and categorized reject reasons, all in working code.
Advanced2026-06-14
Switching Image Models Quietly Degrades Quality — A Gate That Catches It Without Manual Review
When you move image generation from preview to GA models, the API keeps returning 200 and quality slips silently. This is the three-layer gate I built to detect that drift without staring at every image: deterministic property checks, multimodal embedding similarity, and a Gemini judge, wired together in Python with thresholds and a cutover procedure.
Advanced2026-06-04
Pre-Screening Wallpaper App Submissions with Gemini Vision: A Two-Week Field Memo
Before submitting a new batch of wallpapers, I spent two weeks running Gemini's image understanding as a first-pass filter for store review risk. What it caught, what it missed, and where a human still has to decide.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →