Mnesis is a Python framework designed to provide lossless context management for long-horizon large language model (LLM) agents. It addresses the problem of context rot, where the accuracy of LLMs degrades as their context window fills with stale or redundant information, even before reaching token limits. Unlike traditional approaches that rely on the model itself to summarize and manage context, mnesis shifts this responsibility to a deterministic engine layer, ensuring that memory management is handled outside the model for greater reliability.
The framework implements the Lossless Context Management (LCM) architecture, offering several distinct features. It uses a configurable token threshold to trigger context management actions, rather than relying on the model's probabilistic judgment. Mnesis employs a three-level fallback system for summarization, with the final level being always deterministic to prevent silent data loss. To manage tool output growth, it includes a backward-scan pruner that marks stale outputs, and for handling large files, it utilizes content-addressed file references combined with structural summaries instead of inlining files directly. The tool also supports parallel workloads through its LLMMap and AgenticMap operators, enabling true parallelism in agent operations. All session history is stored in an append-only SQLite log, ensuring that nothing is ever deleted.
Mnesis is delivered as a Python package, installable via pip or uv, and can be integrated into Python applications. It does not require an API key for initial experimentation with mock LLMs, but supports a variety of LLM providers through litellm, including Anthropic, OpenAI, Google Gemini, and OpenRouter, by specifying the appropriate model string and API key environment variable. The tool is intended for developers and researchers building advanced LLM agent workflows that require reliable, persistent context management across long interactions.
In the Frameworks & SDKs space, mnesis takes a focused approach. It provides reliable, lossless memory management for LLM agent sessions, ensuring context is preserved across interactions. It is built as an open-source project for developers building LLM agents requiring persistent context. mnesis is open source under the Apache-2.0 license. mnesis is available on the web and the command line, and it can be self-hosted.
It is developed by Lucenor, and the product first shipped in 2026. Development happens publicly on GitHub with 18 stars and 19 commits in the last 90 days. Key capabilities include persistent memory, context compaction, and agent session support.
Latest indexed changes and source events
Other apps tracked under the same category.