⚡ Early Access OpenHiveOS Enterprise — Meet Bea (Business Execution Assistant): Watch the 30s Demo & Claim Priority Sandboxgethiveos.com →
Back to Production Traps
AI & Automation5 min read1 Nov 2026

Google Elephant-Goldfish Model (EGM): Prompts & Python Code

Copy-pasteable system prompts, SKILL.md plugins, and Python code for Google's Elephant-Goldfish Model (EGM)—cutting AI agent defects by 90%.

Author: Logic42 Sovereign Engineering Practice

Google’s open-source Elephant-Goldfish Model (google/elephant-goldfish-model, Apache-2.0) eliminates self-review bias in AI engineering by separating full-history plan drafting (the Elephant) from zero-history cold verification (the Goldfish). Instead of letting one AI chat session write and review its own work, EGM deletes the chat history before spawning fresh reviewer subagents, catching 90% of unstated assumptions before a single line of code is written.

Google's Elephant-Goldfish Model (EGM) Visual Breakdown

Why Proofreading Your Own AI Chat Always Fails

Have you ever written a long email or contract, read it over three times, and still missed an obvious mistake, only for a coworker to spot it in 10 seconds? Your brain remembers what you meant to write, so it mentally fills in what's missing on the page.

AI agents suffer from the exact same blind spot. When you chat with an AI for 30 turns to plan a feature and then ask that same AI chat to review the plan or write the code, the AI already shares your unspoken shortcuts. It agrees with you, skips missing rules, and writes broken code.

Google open-sourced the fix used by 1,000+ of its own engineers: the Elephant-Goldfish Model (google/elephant-goldfish-model). Instead of using one AI to do everything, Google splits the job between two AIs with opposite memories:

  1. The Elephant AI (Remembers Everything): Sits with you for the whole conversation, learns your project history, and writes down the Design Blueprint (design_draft.md). Strict rule: It isn't allowed to write a single line of code.
  2. The Goldfish AI (Remembers Nothing From Your Chat): A brand-new AI subagent is spawned with 0% memory of your conversation. The chat history is wiped across a hard context wall. It reads only the written Blueprint cold—like an outside inspector walking into the room with fresh eyes—to point out what's confusing, missing, or likely to break.

Old Way vs Google's Elephant-Goldfish Way

Single-Chat AI vs. Google's Elephant-Goldfish Architecture

For the last 2 years, the AI industry tried to fix mistakes by giving models bigger memory (128K to 2M token context windows). Google’s repository proves that selective forgetting is just as important as remembering.

Stage / DimensionThe Old Way (1 AI Chat Window)Google’s Elephant-Goldfish Way (EGM)
1. Who Writes the PlanThe same AI session that immediately writes codeThe Elephant AI (100% project history, 0 lines of code allowed)
2. Who Reviews the PlanThe same AI (biased by 30+ turns of chat history)5 Goldfish Subagents (0 chat history, read-only cold audit)
3. Flattery & Sycophancy"Great idea! Here is the code..."Repo rule: "No Glazing"—Goldfish must list risks and blockers first
4. The Comprehension TestNone (assumes the AI understood your intent)Paraphrase Check (agents/comprehension.md summarizes the spec cold)
5. When Bugs Are CaughtAfter 1,500 lines of code break in productionBefore coding starts—when a Goldfish flags an unclear rule

Inside agents/comprehension.md, Google included a clever rule called the Paraphrase Test: before critiquing anything, a zero-memory Goldfish must read your written plan cold and summarize in 3 sentences what it thinks your system does. If the Goldfish's summary doesn't match what you intended, your plan isn't clear enough to code yet.

[!TIP] Related Architecture Deep Dive: When scaling beyond an Elephant and Goldfish pair into autonomous enterprise swarms, how do independent agents coordinate task handoffs without blowing up context windows or poisoning each other's prompts? Explore our protocol autopsy: ACP vs. MCP: The Multi-Agent Protocol Divide & Architecture Traps.

How Engineers and AI Practitioners Can Use EGM Today

1. Install Google's Free Plugin in 30 Seconds (For Coding Agents)

Google packaged google/elephant-goldfish-model as 7 portable Markdown skills (skills/egm-*) and 9 zero-context subagent personas (agents/*.md) that install directly into Google Antigravity, Claude Code, and OpenAI Codex:

# Google Antigravity CLI (agy)
agy plugin install https://github.com/google/elephant-goldfish-model

# Anthropic Claude Code
claude plugin marketplace add google/elephant-goldfish-model
claude plugin install egm@egm

# OpenAI Codex CLI
codex plugin marketplace add google/elephant-goldfish-model
codex plugin add egm@egm

Once installed, you run 4 commands on your next feature instead of jumping straight into code:

  1. /egm-brainstorm: Talk through the idea with the Elephant (saves concepts_brief.md with 0 code).
  2. /egm-draft: The Elephant turns your brief into a full Blueprint (design_draft.md).
  3. /egm-review: Spawns 5 stages of fresh Goldfish subagents (zoom_out, comprehension, design_critic, codebase_details, implementation_readiness) with zero chat memory to attack the Blueprint cold.
  4. /egm-resolve: You approve the fixes, lock the spec in docs/designs/, and let the coding agent build it cleanly on pass 1.

2. Wire the "Context Wall" Into Your Own AI Apps (For AI Builders)

Even if you're building a customer support bot, legal AI, or enterprise RAG workflow rather than a coding tool, you can use the Elephant-Goldfish pattern in 12 lines of Python. Never ask the AI that drafted an answer to check its own work in the same chat:

# 1. THE ELEPHANT CALL: Uses the full 20-turn conversation history to write a draft
draft_plan = ai.generate(
    history=full_chat_history,
    prompt="Write the customer response and action plan based on our chat."
)

# 2. THE GOLDFISH CALL: Notice `history=[]` (Chat history is completely deleted!)
# A fresh AI sees ONLY the written draft + raw policy doc with fresh eyes.
cold_review = ai.generate(
    history=[],  # <-- The "Goldfish" Context Wall (0% prior chat memory)
    prompt=(
        "No flattery. Read this draft cold against the policy doc. "
        "1. Summarize in 3 sentences what this draft promises. "
        "2. List any claim not backed by the policy:\n\n"
        f"DRAFT:\n{draft_plan}\n\nPOLICY:\n{policy_doc}"
    )
)

The Takeaway

One AI chat window shouldn't both write the plan and grade its own homework. Whether you install google/elephant-goldfish-model in your coding IDE or build enterprise multi-agent workflows, the rule is simple: design with an Elephant that remembers your whole project, and review with a Goldfish that only sees what's written on the page.


Related Sovereign AI & Multi-Agent Architecture

Share this note
THE MONDAY PRODUCTION TRAP DISPATCH · WEEKLY 09:00 MYT

Enjoyed this autopsy? Get next Monday's architecture teardown + SVG blueprints in your inbox.

1 email every Monday morning. Zero marketing fluff — just real VRAM math, MCP security traps, and sovereign lakehouse patterns.

⚡ HiveOS Enterprise · AI Chief of Staff1-Day Priority Sandbox SLA

See HiveOS Enterprise & Bea (Business Execution Assistant) in Action

HiveOS connects to 5,000+ workplace apps with client-side PII redaction, 3-model consensus verification, and 80%+ local SLM cost savings. Watch the 30-second Executive Overview and 3-minute Walkthrough on gethiveos.com, or download the 6-slide Product Brochure.

Sovereign Practice Diagnostic
4 Pillars · 20 Calibrated Checkpoints

Hardening Enterprise Multi-Agent Meshes?

From cascade poisoning prevention to zero-trust machine identity gates, we build, transfer, and operate production agentic workflows with cryptographically verified execution boundaries and Stage 1 ISO conformance.

DIRECT PRINCIPAL ARCHITECT PEER REVIEW · NO SALES PITCH

Debugging this pattern in your own stack? Ask a Principal Architect directly or request a free 48-hour architecture sanity check:

Free in Interactive Diagnostic:Boardroom PDF DossierExcel Working Papers (.CSV)Legal & Kernel Playbook (.MD)
Confidential & Zero Third-Party Telemetry · Encrypted Practice Intake