How do you handle context rot and belief revision in long-running LLM agents? (Building Corollary) #209446
Replies: 2 comments
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Managing State & Natural Language Contradictions with TMS in LLM AgentsHi @gabe-santana! Bringing Jon Doyle’s 1979 Truth Maintenance System (TMS / JTMS) into modern LLM agent runtimes is a brilliant approach to solving context rot and the lost-in-the-middle hallucination problem. Here are a few practical architectural strategies for handling natural language contradiction detection and belief revision when mapping graph dependencies: 1. Converting Unstructured Text to Atomic Assertions (SPO Triples)Mapping raw natural language directly into a TMS dependency graph is tricky due to ambiguity. A reliable pattern is decomposing conversation turns into Atomic Assertions / Semantic Triples with timestamps before feeding them to the belief graph: 2. Handling Contradictions: Small NLI Models vs. Structured Predicates3. Non-Monotonic Invalidation & Selective Context Hydration4. Useful Hybrid Frameworks for Comparison |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Product Feedback
Body
Hey everyone!
So I've been building long running AI agents lately and kept bumping into context rot. Basically when past inputs or contradicted facts get stuck in the chat history, the LLM starts hallucinating because of stale context.
To try and fix this, I started working on Corollary. It's an open source python agent runtime based on Jon Doyle's 1979 paper on Truth Maintenance Systems (TMS).
Instead of appending messages line by line in a log, it treats agent state as a dependency graph of beliefs. So when a base fact changes, downstream data gets automatically invalidated and re-derived.
Heres a quick demo GIF:
Its written in Python.
Repo is here: https://github.com/gabe-santana/corollary
Would love ❤️ to hear how you guys manage state in complex agent workflows! Especially curious how people handle natural language contradictions when mapping graph dependencies.
Also, if anyone wants to jump in and contribute, I will tag a couple
good first issuetickets on github for simple stuff.Let me know what you think or if you have any feedback!
Guidelines
All reactions