[KongchangAI]
· 2 min read· 1,388 words

Agent Project in Practice: Real Delivery and Pitfalls from Requirements to Launch

Agent Project in Practice: Real Delivery and Pitfalls from Requirements to Launch

Build an autonomous Agent with one loop and one prompt — restrain guidance and observe multi-round experiment behavior.

Based on a complete Agent project in practice, this article breaks down the entire process from a minimal viable loop to autonomous task delivery. The author uses a single Python loop connected to the DeepSeek model, with a context window fixed at 20 messages to form a rolling window, controlled only by a minimal system prompt. The article focuses on reflecting on the core contradiction in prompt design: guiding statements may become constraints that deprive the model of space to explore other memory solutions. Run logs show that under window pressure, the Agent autonomously built a memory directory system and set an eight-chapter book as a long-task goal, validating the autonomous evolution path. From this, the author distills four acceptance dimensions — context management effectiveness, tool call convergence, long-task decomposability, and prompt constraint level — and emphasizes that autonomous capability requires dozens or hundreds of experiments to observe, not a single demonstration.

Building an Agent that can autonomously handle long tasks — the real difficulty often lies not in model capability, but in engineering details and prompt boundaries. Based on a complete Agent project in practice, this article breaks down the entire process from a minimal viable loop to autonomous task delivery, and records key pitfalls and acceptance criteria.

Minimal Viable Agent: One Loop Plus One Prompt

The starting point of this Agent is very modest: a single Python loop program connected to the DeepSeekAd model, with a context window fixed at 20 messages. After each tool call, the execution result is appended to the context as a new record, forming a rolling window — new messages squeeze in, old messages get pushed out. No summarization, no compression, no hierarchical retrieval — just an Agent prototype that is "as small as it can be."

Then the old records get pushed out

Only two things control the loop: the program body and a system prompt file. The prompt is placed in the queue directory, with minimal content: it tells the model that only one bash tool is available, that the context history is rolling, that the working directory is locked, and encourages the model to "grow itself into an Agent capable of handling long tasks." All complex behaviors are produced by the model running within this framework, rather than being pre-programmed code logic.

Rolling Window is the simplest strategy in context management: maintain a fixed-length message queue; each time a new message enters, the oldest message is removed. Its advantage is extremely low implementation cost and no additional model calls; its disadvantage is irreversible information loss — once a message is pushed out, the model can never access it again. In long-task scenarios, this means the Agent must rely on external storage (such as the file system) to fill the memory gap, otherwise it will repeatedly lose critical state. Understanding this characteristic of the rolling window is the prerequisite for judging whether the subsequent "Agent autonomously persists to disk" behavior is reasonable.

The Core Contradiction in Prompt Design: Guide or Constrain?

The author deliberately left a sentence in the prompt: "If not written to the file system, it is permanently forgotten." Then reflected that this was actually "cheating" — it implied the only correct memory path and limited the model's possibility of exploring other solutions. For example, the model could well choose virtual memory, database connections, or other workaround strategies to cope with context trimming, but this sentence blocked the way.

I use virtual memory

This raises a question that all Agent developers should be wary of: when early models were weak, we were used to writing lots of guiding words; but the guiding words themselves may become constraints. Some views point out that certain models compress most of the system context without performance degradation, which precisely shows that some prompts are masking facts rather than enhancing capability. When writing prompts, every sentence you add about "the right thing" may be depriving the model of space for autonomous decision-making.

System Prompt is the global instruction that the model reads first at each inference; it sets the role, available tools, behavioral boundaries, and output specifications. Unlike user messages, the system prompt remains in effect throughout the session, so every sentence in it has a continuous impact on the model's decision space. In Agent scenarios, the system prompt actually plays the role of an "operating system kernel": it defines what the Agent can perceive, what it can do, and how it understands its own situation. Precisely because of this, suggestive statements in the prompt (such as "write to the file system") will be treated by the model as high-priority behavioral guidelines, thereby compressing its space for autonomous exploration.

Real Run Log: How the Agent Grew Its Own Memory

After startup, the program log recorded the token hits for each round of calls. The first round was just a simple call; the second round called the ls tool; the third round began creating the directory make memory; then used echo to output cognitive content and wrote small scripts. After multiple rounds of looping, the Agent built its own memory directory system, then moved into long-task design — it set itself a goal: to write a book about the cognitive architecture of autonomous Agents, with eight chapters in total.

And this is the rolling one

After the task state ended, the Agent began performing the "compress the essence" operation and continued enriching its own content. Throughout the process, there was no manual intervention in the memory structure; instead, under the constraint of the rolling window, the model actively persisted key information to the file system to compensate for the context loss defect. This is exactly the experimental goal of "autonomously implementing context memory and compression capability": not presupposing that the Agent must have a memory module internally, but letting the model explore feasible architectures on its own through experiments.

Just as simple as this

It should be noted that this kind of autonomous evolution is hard to produce in a single round of experiments. The author mentions that it may take dozens or even hundreds of experiments before one result surpasses the current level of understanding. Therefore, delivery acceptance for an Agent project cannot rely on a single run; it must observe behavioral stability and goal achievement rate across multiple rounds of experiments.

Token Hit in the context of this article refers to the number of context tokens actually consumed at each model call; recording this value in the log can be used to observe the fill level of the context window and the rhythm of rolling eviction. When the hit count approaches the window limit, it means old messages are being squeezed out frequently, and if the Agent does not actively externalize important information to the file system, it will face the risk of memory rupture. By analyzing the token hit curve, developers can judge whether the Agent has made reasonable memory management decisions under "window pressure," which is also the quantitative basis for "whether context management is effective" in the subsequent acceptance dimensions.

Acceptance Criteria from Requirements to Launch

Based on this practice, several actionable acceptance dimensions can be distilled. First, whether context management is effective: under the rolling window, whether the Agent actively writes key state to the file system rather than relying on short-term memory. Second, whether tool calls converge: whether bash commands complete the goal within the restricted directory, without out-of-bounds behavior or infinite loops. Third, whether long tasks can be decomposed: whether the Agent can autonomously set stage goals (such as an eight-chapter book) and advance section by section. Fourth, whether the prompt is over-constrained: check whether the system prompt contains statements implying a unique solution, to avoid suppressing other feasible paths for the model.

For the delivery process, it is recommended to retain complete call logs and token hit records as the basis for behavior auditing. Before launch, run through at least one complete long-task closed loop, and manually review whether the file system artifacts meet expectations. If the Agent shows memory loss or task drift across multiple experiments, adjust the window size or prompt boundaries rather than directly attributing it to model capability.

Behavior Auditing in Agent delivery refers to tracing every decision step of the Agent based on complete call logs: what tool was called, what parameters were passed in, what result was returned, and how the context changed. Unlike traditional code auditing, Agent behavior is stochastic and path-dependent; a single success does not mean stable deliverability. The value of retaining logs and token records is that when task drift or memory loss occurs, you can locate whether it is caused by insufficient window size, too-narrow prompt boundaries, or fluctuations in the model's own capability, thereby transforming vague attributions like "the model is not good enough" into adjustable engineering parameters.

Key Conclusions

The real difficulty of an Agent project lies in designing a sufficiently concise loop framework while restraining excessive guidance in the prompt. Letting the model autonomously explore memory and compression strategies in a constrained environment often exposes problems better and gets closer to a deliverable state than presupposing a complete architecture. Acceptance should be based on behavioral data from multiple rounds of experiments, not on a single demonstration effect.

#Agent project#prompt engineering#context management#rolling window#long task#acceptance criteria
Share:

Related articles