◉GEMINI LABJP
●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●DEEP RES — deep-research-pro-preview-12-2025 shuts down 10/23, 6 days left. Move to deep-research-preview-04-2026●NANO — gemini-nano-banana-2.1 is GA (10/06). gemini-3.1-flash-image is deprecated with no shutdown date yet●MCP — One write-up cut an 85,000-token tool result to 310 tokens by wrapping it in an ADK FunctionTool●FLASH — gemini-3.7-flash and 3.5-flash now route automatically to newer Flash models (10/08)●NEW — Stop Re-Reading Every Crash Report: Gre…●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●DEEP RES — deep-research-pro-preview-12-2025 shuts down 10/23, 6 days left. Move to deep-research-preview-04-2026●NANO — gemini-nano-banana-2.1 is GA (10/06). gemini-3.1-flash-image is deprecated with no shutdown date yet●MCP — One write-up cut an 85,000-token tool result to 310 tokens by wrapping it in an ADK FunctionTool●FLASH — gemini-3.7-flash and 3.5-flash now route automatically to newer Flash models (10/08)●NEW — Stop Re-Reading Every Crash Report: Gre…
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 CompactionGemini91Long-Term MemoryPython51Eval 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-09-17
The color label Gemini returned for the same wallpaper changed — and the model was not the reason
I counted color-label agreement across five ways of exporting the same wallpaper. Stripping the ICC profile was the worst of them. Here is how I pin the color space down before asking, and how I check the answers against a number I compute myself.
⬡ Advanced2026-09-24
I Stopped Asking Gemini 'Is This Right?' and Started Hiding My Answer Instead
Ask Gemini to confirm a label you already chose and it tends to agree. Here is why I compared three ways of asking, chose blind re-classification, how my answer still leaked in, and the routing code that sends only disagreements to a human.
⬡ Advanced2026-10-14
Fine on Desktop, Blank on Safari: Four Things to Gather Before You Ask an AI to Diagnose It
After a shuffle, my lazy-loaded images never loaded again, but only in Safari on iPhone. Here is what to collect by hand before asking Gemini or any other model to diagnose a bug that does not reproduce on desktop, plus a request template you can paste.