Every developer who has tried using neural networks to build something more complex than a simple helper function—say, a multi-page web app, an intricate Three.js 3D scene, or a multi-step marketing funnel—has run into the model "tunnel vision" phenomenon.
On the first few iterations, everything looks great. But as the context window fills up with edit history, comments, and intermediate versions, the model begins to suffer from cognitive overload. It starts ignoring its own architectural constraints, breaks previously written styles, and responds to user feedback with superficial band-aids. The model "falls in love" with its own generated code and becomes completely blind to glaring visual or logical flaws.
To overcome this trap, Google researchers designed an elegant architectural pattern—the Elephant-Goldfish Model (EGM), built on dual separation of contextual memory and independent cross-review.
Dual-Memory Mechanics: The Elephant and the Goldfish
The architecture's name is metaphorical and captures the division of roles accurately:
- The Elephant Agent: Possesses massive memory. It holds the project's technical brief, architectural requirements, version history, and component dependencies in context. The Elephant's job is to synthesize a cohesive artifact (code, markup, shaders) and apply fixes based on review notes.
- The Goldfish Agents: Have an ultra-short memory ("memory like a goldfish"). They have zero access to conversation history or drafts. They receive only the freshly compiled artifact (for example, a screenshot of a rendered web page or the final binary) and evaluate it from scratch.
When a "goldfish" looks at the output, it has no idea how many hours the Elephant agonized over laying out that button. It sees that the text overflows the badge or font contrast fails WCAG accessibility standards, and immediately issues an objective penalty.
Earlier, we explored approaches to shared memory in the Hermes ecosystem, whereas the EGM concept takes a diametrically opposite yet remarkably effective move: intentional memory wiping for crystal-clear reviewing.
Orchestration Pipeline: From Generation to Independent Critique
Let's look at how this loop works in working Python code. The Elephant agent creates an artifact, after which the dispatcher launches pools of independent critics in parallel:
import asyncio
from dataclasses import dataclass
from typing import List, Dict
@dataclass
class ProjectArtifact:
version: int
html_markup: str
css_styles: str
threejs_script: str
rendered_screenshot_base64: str
async def run_elephant_architect(brief: str, feedback_history: List[Dict]) -> ProjectArtifact:
# Elephant agent: holds global context and generates an updated artifact
print("Elephant: synthesizing a new project version based on prior feedback...")
await asyncio.sleep(0.5)
return ProjectArtifact(
version=len(feedback_history) + 1,
html_markup="<canvas id='webgl-scene'></canvas>",
css_styles="body { margin: 0; overflow: hidden; background: #0a0a0c; }",
threejs_script="// Initialize Three.js scene and camera animation...",
rendered_screenshot_base64="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
)
async def goldfish_art_director(screenshot: str) -> Dict:
# Goldfish 1: visual balance evaluation with strictly zero memory
return {
"critic": "ArtDirector",
"score": 8.5,
"critique": "Headline contrast is insufficient against the particle backdrop. Recommend shifting the light source to (2, 5, 3)."
}
And here is the structure of the returned reviewer report passed back to the Elephant for the next iteration:
{
"iterationReview": {
"artifactVersion": 2,
"status": "NEEDS_REVISION",
"compositeScore": 7.8,
"critiques": [
{
"domain": "visual_design",
"issue": "Badge text overlaps the camera control widget at 1920x1080 resolution",
"severity": "HIGH"
},
{
"domain": "code_performance",
"issue": "Geometry initialization runs inside the render loop instead of the init phase",
"severity": "CRITICAL"
}
]
}
}
The Elephant receives structured feedback, makes targeted fixes in the code, and sends version 3 for the next round. The loop repeats until the composite score from the "goldfish" crosses a set quality threshold (for instance, 9.0 out of 10).
Practical Value for Real-World Projects
The EGM architecture clearly demonstrates that AI generation quality scales not just with context window size, but also with smart critique topology.
Key advantages of the approach:
- Eliminating sycophancy hallucinations: In a long conversation, a general-purpose model tends to agree with the user and miss obvious bugs. A "goldfish" lacks empathy and evaluates strictly on the facts.
- Multi-angle auditing: You can spin up five specialized "goldfish" simultaneously—for usability, code security, accessibility, responsiveness, and load speed.
- Capping endless edits: A clear numerical stopping criterion (
compositeScore >= 9.0) prevents infinite loops of pointless code rewriting.

