AI Agent Real Delivery: Two-Window Context and Prompt Experiment

A minimal Agent with two history windows and a single bash tool, observing the model's spontaneous memory and long-task capabilities under constraints.
The article introduces a minimal Agent experiment by Bilibili creator "码士集团 AI 大模型": a while loop, two-message sliding window, restricted bash tool, and fixed system prompt drive the model to complete a real delivery task. Logs show the model spontaneously creating directories, writing files, implementing memory, and advancing an eight-chapter manuscript. The author argues excessive prompt guidance constrains exploration, and Agent projects truly lack behavioral observation, trial-and-error space, and call logging rather than frameworks; acceptance should judge externalized storage and long-task progress under a tiny window. The method suits research; production needs engineering additions.
Why Start with the "Crudest" Agent
Most Agent courses jump straight into context compression, memory layering, and vector recall. The system is complete but easily traps students into a "standard answer." The Bilibili creator "码士集团 AI 大模型" takes the opposite approach: using a Python loop with only two history messages, a single tool (bash), and a fixed system prompt to run a real delivery experiment.
This Agent is extremely minimal — a while loop, a bash tool restricted to the queue_name directory, and a rolling window. Each model call and tool execution adds one message to history; beyond two, the earliest is pushed out. No summaries, no compression, no layered recall. The creator openly calls it "an Agent that can't be any smaller, very low," but it's precisely this minimalism that exposes the model's raw behavior.

The Cost of Two-Window Context and Log Observations
With only two slots in the sliding window, each model call sees just the last two execution results. The creator added logging inside the loop: on every request to DeepSeekAd, the hit token info and buffer rate are written to a log file.
From the log you can see a clear evolution path: the first call is just startup; the second triggers the ls tool, and after the tool returns, a third call occurs where the model starts creating directories (mkdir), writing cognition via echo, and then writing small scripts. As rounds progress, it implements a memory directory on its own, then begins designing a long task — writing a book titled Autonomous Agent Cognitive Architecture with eight chapters. After that task ends, it pivots to compressing the essence and enriching itself.

The insight here: when context is compressed to the extreme, the model is forced to externalize information to the filesystem. Before the experiment, the creator accidentally wrote in the prompt "earlier information that isn't written to the filesystem will be permanently forgotten," then realized this was cheating — the sentence directly told the model what to do, constraining the space it might have explored for other solutions.
Sliding Window is the simplest strategy for handling long context: keep only the most recent N messages and discard everything earlier, effectively giving the model's "short-term memory" a fixed capacity. Other common approaches include summary compression (condensing old dialogue into a paragraph), hierarchical memory (storing and recalling information by importance tiers), and vector retrieval (storing history in a vector store and fetching by similarity). The sliding window's advantages are minimal implementation, controllable token cost, and no extra model calls; its drawback is that once information slides out it's unrecoverable, so the model must decide for itself what's worth "persisting to disk." This is exactly the experiment's design intent — use the most extreme window to force the model to externalize state to the filesystem, thereby observing its spontaneous persistence and planning behavior.
The "Cheating" Risk of Prompts: Constraint or Activation?
The creator mentions a curious phenomenon: reports say the Claude Code team compressed system context by about eighty percent with no drop in effectiveness. There are many explanations online, but the creator believes this masks a fact — when early models were weak, we got used to writing lots of guidance words, and those words may constrain the model's capabilities.
For example, if you write "use the filesystem for persistence" in the prompt, the model may only use the filesystem; but if you don't say it, the model may try virtual memory, databases, or other connection methods. The creator deliberately added a line in the experiment prompt: "You can use this idea, but that also counts as cheating" — because the outer loop only feeds two history messages to the model each time, yet demands it "autonomously implement context memory and compression and other Agent capabilities."

This leads to a core question: what should an Agent actually look like? We assume by default it should have context, memory, compression — but to break through existing cognition, maybe it doesn't need these at all, or has other forms. The creator stresses that such a breakthrough won't appear in one run; it may take dozens or hundreds of experiments before one suddenly transcends current consensus.
System Prompt is an instruction injected before the conversation begins that globally constrains model behavior, usually with higher priority than user messages. A common engineering mistake is stuffing lots of "best practices" into the system prompt — e.g., specifying a particular tool or storage method. Such instructions can raise the floor when the model is weak, but on stronger models they create an "anchoring effect": the model tends to follow the named solution and stops exploring potentially better paths. Thus prompt design has a tension between "constraint" and "activation" — a good prompt should activate the model's reasoning and exploration, not make decisions for it. One test: does model behavior degrade significantly if you remove a given instruction? If not, or if it becomes richer, that instruction was over-constraining.
From Requirements to Launch: What Real Delivery Lacks
Back to the title's question — what does an Agent project lack from requirements to launch? This experiment's answer isn't some framework or tool, but observation of model behavior and room for trial and error.
The creator's program is just a single loop plus a context prompt; everything else the model produced. It has no complex engineering architecture, yet it completes the full chain of "read prompt → call tool → write files → design long task → self-compress." What's really missing in the delivery process may be the patience to let the model find its own way in a constrained environment, and a logging system that records each call's hit rate and buffer rate to judge whether the model is genuinely growing or being led by the prompt.

Acceptance criteria shouldn't be "did it use a particular memory module," but whether the model, under the two-history-window constraint, can maintain long-task state via externalized storage and drive the eight-chapter manuscript forward. This standard looks loose but is actually strict — it tests the model's planning and persistence under minimal information conditions.
Agent Loop refers to the execution paradigm where the model and tools alternate: model outputs tool call → runtime executes tool → result is fed back as a new message → model is called again, repeating until the model gives a termination signal. The loop itself contains no intelligence; the real differences come from three places: toolset design, how history is organized into context, and the loop's termination and error-handling strategy. The article's experiment minimizes all three — single tool, two-message window, no retries — so the model's raw behavior is exposed almost free of framework interference. Understanding this helps distinguish "capabilities provided by the framework" from "capabilities of the model itself": the former can be gained by switching frameworks, while the latter determines the Agent's real ceiling under constrained conditions.
Practical Advice and Boundaries
If you want to reproduce this experiment, the creator gives several implicit boundaries: bash is restricted to the current directory and cannot access parent or external directories; each model call executes at most one bash command; the history window rolls, trimming beyond two messages. These limits aren't meant to stump the model, but to observe its behavior within boundaries.
A reminder: this approach is better suited as a research experiment or course case than a production solution to copy directly. Production environments still need error retries, permission isolation, audit logs, and other engineering concerns. But the experiment's value is to remind developers: before piling on context-management solutions, first see how far the model can go under minimal conditions.
One-line Summary
A minimal Agent with a two-history window and a single bash tool, observing how the model spontaneously builds memory and long-task capabilities under constrained conditions.
Paragraph Summary
The article introduces a minimal Agent experiment by Bilibili creator "码士集团 AI 大模型": just a while loop, a two-message sliding window, a restricted bash tool, and a fixed system prompt, driving the model to complete a real delivery task. By logging each call's token hits and buffer rate, the experiment observes the model spontaneously creating directories, writing files, implementing a memory mechanism, and advancing an eight-chapter manuscript long task. The author draws a core point: excessive guidance in prompts may constrain the model's space to explore alternatives, and what Agent projects really lack from requirements to launch isn't a framework but observation of model behavior, room for trial and error, and a call-logging system; acceptance should judge whether the model can externalize storage and advance long tasks under a tiny window, not whether it used a specific memory module. The method suits research scenarios; production still needs engineering additions.
Related articles

Building a Face Recognition Check-in System from Scratch with Baidu AI Platform
Based on the Bilibili Baidu AI hands-on course introduction, this article outlines the positioning of Baidu's machine learning, deep learning, and AI platforms, explains the learning path for image, speech, and NLP APIs, and how to build a face recognition check-in system from scratch.

Clipjack: Turn GTA VI Livestreams into Viral Vertical Clips in One Click
Clipjack is a Product Hunt-topping AI tool that automatically edits GTA VI livestreams or recordings into subtitled vertical short videos for TikTok, Shorts, and Reels, serving game streamers and clippers.

Cursor Renamed to Grok Build? Understanding the Real Shift Behind It
Cursor rumored to be renamed Grok Build: what's the truth? This article analyzes key details like the December 7 collaboration tool tag change, threefold faster agent window, and model list shifts to help dev teams assess the real impact.