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.

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:
- 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. - 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.
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 / Dimension | The Old Way (1 AI Chat Window) | Google’s Elephant-Goldfish Way (EGM) |
|---|---|---|
| 1. Who Writes the Plan | The same AI session that immediately writes code | The Elephant AI (100% project history, 0 lines of code allowed) |
| 2. Who Reviews the Plan | The 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 Test | None (assumes the AI understood your intent) | Paraphrase Check (agents/comprehension.md summarizes the spec cold) |
| 5. When Bugs Are Caught | After 1,500 lines of code break in production | Before 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:
/egm-brainstorm: Talk through the idea with the Elephant (savesconcepts_brief.mdwith 0 code)./egm-draft: The Elephant turns your brief into a full Blueprint (design_draft.md)./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./egm-resolve: You approve the fixes, lock the spec indocs/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
-
ACP vs. MCP: The Multi-Agent Protocol Divide & Architecture Traps: Why Anthropic's Model Context Protocol (MCP) tool drivers cannot solve agent-to-agent delegation, and how ACP peer meshes introduce cascade prompt injection risks.
-
The MCP STDIO Master Key Trap: Local Agent RCE & IAM Bypass: Why local MCP subprocesses inherit your host UID, SSH sockets, and Cloud IAM keys—and how to sandbox them with Bubblewrap (
bwrap). -
The Remote MCP Gateway Trap: Why Static Keys Fail OAuth 2.1 Agents: Why giving distributed agents static API keys creates ambient authorization hazards, and how to enforce ephemeral token claims.
-
Benchmark Your Agent Governance: ISO/IEC 42001 Readiness Diagnostic: Evaluate your organization's AI testing boundaries, autonomous agent oversight, and model risk lifecycle in 3.5 minutes.
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.
Further Reading
vLLM Speculative Decoding Stalls: The High-Batch GPU Wall
Why 5-token speculative decoding speeds up low-batch LLM queries by 2.6x but spikes P99 latency by 183% once GPU batch concurrency crosses 16.
ACP vs. MCP: The Multi-Agent Protocol Divide & Architecture Traps
Why Anthropic's MCP tool drivers cannot solve agent-to-agent delegation, and how ACP peer meshes introduce cascade prompt injection risks.
RAG PII Egress & Policy Drift: Edge Token Vaults & 3-Model Consensus
Standard RAG pipelines leak raw PII to cloud LLM logs and misread 18.4% of multi-clause policies. Edge token vaults and 3-model consensus stop both.
Constrained Decoding Grammar Stalls in vLLM and TensorRT-LLM
Dynamic JSON schemas with deep $ref unions add 1,180ms CPU grammar stalls in vLLM. Pre-warmed flat FSM bitmasks restore 165ms TTFT at 100% batch throughput.
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.
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.
Debugging this pattern in your own stack? Ask a Principal Architect directly or request a free 48-hour architecture sanity check: