Intent Continuity: A New Solution to Coding Agents' Long-History Problem
Coding agents in long-running projects often forget early rules, leading to issues like leaking internal database IDs. Conventional solutions rely on larger context windows or RAG retrieval, but even if the model can 'remember' all text, it cannot automatically judge whether an old rule is relevant to the current task. This article introduces the concept of 'Intent Continuity' and provides a lightweight pure-Python implementation: by adding a verification layer to basic search, the requirement coverage increases from 57% to 100%, with all 8 test tasks correct. The design uses zero vector databases, zero embeddings, and zero LLM calls, making it extremely easy to deploy. The author also honestly acknowledges a bug in the original experiment, demonstrating rigorous engineering.
Background & Problem
Long-running coding agent projects suffer from a pernicious form of institutional amnesia. Early, hard-won rules silently lose their influence as the conversation depth grows. The rules are not deleted; they remain in the chat log, yet the agent fails to consult them when a new request arrives. Consider a concrete scenario: on day one, a developer explicitly instructs the agent to "never expose internal database IDs in API responses." After sixty rounds of iteration, the agent is asked to build a new authentication flow. Because the new request does not mention IDs, the agent skips the old rule entirely and returns an endpoint that leaks primary keys. This is not a synthetic stress test—it is the exact benchmark the authors used to validate their system.
Existing solutions do not address the root cause. Larger context windows (e.g., GPT-4-32k, Claude 100k) only allow a model to *hold* more text. But Liu et al. (2023) demonstrated that models ignore details located in the middle of long prompts, regardless of total capacity. Retrieval-Augmented Generation (RAG) attempts to surface relevant history by asking "what information might be related to the current query?" It stops there. It never asks whether that information is still valid, nor does it determine which historical *intent* should influence the present task. The agent can recall every rule yet still fail to apply the correct ones. The problem is not memory failure—it is the inability to decide what matters *now*.
Architecture & Mechanism
The authors introduce the concept of **Intent Continuity** and formalize it as a three-layer pyramid. At the base lies **Retrieval**, which answers "what historical information might be relevant." Above it sits **Verification**, which answers "is that information still valid?" At the apex is Intent Continuity proper: "which historical intents should influence the current task, and remain in force until a newer rule supersedes them?" Most current agent memory systems operate only at the retrieval layer. Intent Continuity adds the two critical layers that convert recall into correct action.
The implementation is a pure Python (3.12) pipeline that consumes **zero vector databases, zero embedding models, and zero LLM calls**. Instead of semantic similarity, the system maintains a lightweight *requirement registry*. When a new task arrives, it first performs a basic search—matching keywords or directly related statements—to obtain a candidate set of requirements. This naive retrieval alone achieves approximately 57% coverage across test tasks. The key innovation is a separate verification layer that inspects each candidate requirement for continued validity in the current context. For example, if a newer rule explicitly overrides an older one, the verification layer discards the outdated constraint. With verification, coverage jumps from 57% to 100%.
The authors transparently document an early bug in their experimental design: the verification layer was initially coupled too tightly with the search layer, causing some expired rules to be incorrectly retained. The corrected results are more realistic, but the bug accidentally highlighted the importance of verification—without it, the system *over-complies* with rules, introducing unnecessary constraints. The fix produced cleaner behavior and confirmed that a decoupled verification pass is essential.
Benchmarks & Practical Impact
The authors evaluated their system on eight representative tasks that span rule-dependency scenarios common in long-lived coding projects. Each task requires the agent to respect an earlier rule that is not explicitly mentioned in the new request. The results are stark: a baseline with no historical retrieval scores **0/8** correct. Adding the basic search layer yields **4/8** correct. The full intent-aware pipeline (search + verification) achieves **8/8** correct. All numbers come from real runs under Python 3.12 with no external dependencies. The code is open-source on GitHub (Emmimal/intent-continuity) and fully reproducible via `run_experiment.py`.
The engineering value lies in the minimal infrastructure required. No vector database setup, no expensive embedding API calls, no index maintenance. A pure-Python library, on the order of a few hundred lines, can provide rule-continuity guarantees for long-horizon coding agents. For use cases such as multi-week refactors, tracing historical constraints in large codebases, or handling prompts from multiple team members in succession, this approach dramatically improves stability and safety with negligible operational cost. The verification layer, in particular, is lightweight enough to run synchronously before every agent action, effectively serving as a "rule guardrail" without adding latency.
Outlook & Industry Implications
The current industry discourse around agent memory is almost entirely focused on two axes: *how to store more history* and *how to retrieve it faster*. This work suggests a different direction. Instead of expanding memory capacity without bound, we should teach agents to determine which memories still matter. Intent Continuity is a form of metacognition—not passive "remember everything," but active "decide what to forget or inherit." It shifts the problem from storage to judgment.
Future work can extend this paradigm along several paths. Rule dependency graphs could model explicit relationships between intents, enabling automatic versioning and expiration. Lightweight verification models—perhaps small classifiers or decision trees—could resolve conflicts when two rules apply to the same action, negotiating priority without invoking a full LLM. For coding agents that must operate over months or years, Intent Continuity may prove far more practical than any larger context window. It forces us to reconsider what an agent truly needs: not a longer history, but a smarter mechanism for inheriting intent.
Sources
FAQ
What is the core problem for coding agents in long-cycle projects?
Coding agents frequently forget early rules in long-cycle projects, causing serious issues like database ID leaks, undermining consistency and security.
Why can't traditional solutions (large context windows, RAG) fully solve the forgetting problem?
Even if the model remembers all text, it cannot automatically determine whether old rules are important for the current task; traditional approaches only expand memory capacity without active validation or priority judgment.
What is the core idea and implementation feature of the 'Intent Continuity' approach?
It uses basic search plus a validation layer, zero vector databases, zero embeddings, zero LLM calls, boosting requirement coverage from 57% to 100% with all 8 test tasks passed, while honestly disclosing bugs in original experiments.