Hello All,
Here is proposal based on 4+ months of intensive use of Codex on a substantial, long-running software project involving application porting, new feature development, a complex GUI with multiple contexts and operating modes, client/server communication, multi-camera image acquisition, automated large-scale image processing, and export to multiple formats. The experience has provided many opportunities to observe not only where AI coding agents work remarkably well, but also where the lack of durable project memory becomes a practical limitation in long-running, complex projects.
Proposal: “Reflection” — Durable Project Memory for AI Coding Agents
When developers work on a project for months or years, we learn from experience. We try something, discover problems, find the root cause, arrive at a better solution—and remember that experience when a similar situation appears later.
Can AI coding agents do something similar?
I am not talking about model training or fine-tuning. I mean learning acquired while actually working on a project and making that experience available to future tasks.
This is becoming a practical problem with AI-assisted development.
An AI agent may implement something, encounter problems, spend considerable time debugging them with the developer, discover the architectural cause, and finally arrive at a good solution.
Weeks later, it may encounter a similar situation and make essentially the same mistake again.
AGENTS.md, architecture documents, conversation history, tests, etc. certainly help, but they are primarily stored context. They don’t seem to provide the equivalent of a developer remembering: “We tried something like this before. It caused problems. Here is what we learned.”
A real example
We recently implemented a substantial UI feature consisting of multiple panels used only occasionally.
The AI initially kept these panels permanently instantiated and switched between them using hide/show. This resulted in refresh and lifecycle problems. Several rounds of patches attempted to fix the symptoms, making the implementation increasingly complicated.
Eventually we removed that integration and used a much simpler lifecycle:
Create the panels when the feature is entered. Remove them when it is exited. Recreate them when needed again.
The glitches disappeared, the design became simpler, unused UI objects no longer occupied memory, and there was no noticeable delay when recreating them.
There is valuable experience here beyond this particular feature:
If mutually exclusive, occasionally used UI components develop repeated synchronization/lifecycle problems, reconsider their ownership and lifecycle instead of repeatedly patching the symptoms.
A human developer naturally carries that experience forward.
How can the AI carry it forward?
Could AI agents have a “Reflection” stage?
After significant work, the agent could briefly Reflect:
- What failed, and why?
- What finally worked?
- Did the developer correct an important assumption?
- Did we discover a reusable architectural lesson?
- Under what future circumstances would this experience be relevant?
Useful conclusions could become compact durable project memory.
Then:
Experience → Reflection → Project Memory → Future Inference
When a related problem appears months later, only relevant memories need to be recalled. There is no need to retrain the model or inject years of project history into every prompt.
Tests and guardrails remain essential, but there is an important difference:
Bad solution → implement → test fails → investigate → fix
versus:
Candidate solution → recall previous experience → recognize known problem → avoid it
The first detects a repeated mistake. The second helps prevent repeating it.
This matters increasingly as developers trust AI with larger and longer-running projects. Repeating previously solved mistakes causes multiple failures, wastes developer time, creates frustration, and eventually damages confidence in using AI for complex projects.
Today’s models can be remarkably capable. But if project experience repeatedly disappears, part of the team’s accumulated engineering knowledge disappears with it.
A Reflection mechanism could help turn individual AI interactions into accumulated project experience.
Would love to hear if others in the community would also find this helpful — especially for long-term complex projects.
Best Regards,
-Darshan Maharana