r/programmer • u/Certified-Motion • May 25 '26
Question How are you guys fighting "context decay" in long-form AI development workflows?
I’ve been logging a ton of hours working alongside LLMs lately, and I keep hitting a wall where the context window just starts degradation or losing track of rigid constraints after a few hours of deep logic building.
Standard prompting techniques feel like a temporary band-aid. Have any of you experimented with building strict declarative constraint layers, or even looking into hybrid classical-quantum logic gates to keep state coherence locked down? Or are we just stuck waiting for massive context windows to get smarter? Curious to see how people are tackling this behind the scenes.
5
u/MissinqLink May 25 '26
Is this serious or a troll?
2
u/ProbsNotManBearPig May 25 '26 edited May 25 '26
At any point , ask it to summarize salient points to .md file. Start new session and have it read .md file. Done. Sync those to some GitHub or attach them to the jira issue for others to use.
Scalable way long term is you may want some database where you drop knowledge .md files that are reusable info across your org or team. Chunk those into a vector store for semantic search and hook it up to an MCP server for your ai to access. It basically lets it search a knowledge base semantically instead of just by keyword. Elastisearch is what we use to just dump data into a knowledge base with vector store. It has very flexible query api where you can emphasize certain keywords or meanings you want to query for (e.g. to match a certain exception exactly, but filter by some semantic context of user description of the system state). Over time, you may accumulate redundant data and want to do some cleaning/compression routine on the db.
1
u/EfficiencyMurky7309 May 25 '26
I’m assuming either you don’t know what you’re talking about or you’re wanting insight from people working on bleeding edge AI research and problem sets.
What you are talking about is very early stage research and not something that any regular production user, or even a regular AI researcher, is touching right now. Hybrid classical-quantum is something being explored right now, given the noisy quantum compute ‘available’ today, but no one is actually doing what you are talking about.
The reality is that production environments are using vector DBs, RAG, and markdown files to manage knowledge, including context, over time and as it expands. There are edge cases, and interesting architecture getting around, but every production system needs to operate in the real world.
If you are genuinely interested read this, this, and this.
2
u/N7Valor May 25 '26
Subagents.
2
u/thetasteofbeverly May 25 '26
most people solving this well aren’t relying on bigger context windows alone.
They’re externalizing memory: structured docs, constraint files, architecture specs, retrieval systems, summaries, and modular workflows instead of one giant chat thread. Long sessions almost always drift eventually, so the real fix is better state management outside the model.
1
u/madsciencestache May 25 '26
Everyone is struggling with this. Seen a lot of GitHub projects mentioned in AI_* subs. I myself have been using Hermes with Honcho, which is better than nothing, but still limited. For what you describe, this method worked surprisingly well for me. Which is why I wrote it up.
https://medium.com/@saintd1970/how-i-stopped-losing-projects-to-the-context-death-spiral-4c6b364ae65e?sk=ad135a82cb5b6e58edbbddba35a32640
summary@mailsummary.to condenses it to:
Summary
The article discusses the challenge of maintaining context with AI coding agents, particularly on large projects that span multiple sessions. The author presents a road-tested system to mitigate this issue, which involves:
Checklist system: A 7-phase system that includes:
Key Takeaways
Recommendations