Martian-Engineering/lossless-claw

Lossless Claw — LCM (Lossless Context Management) plugin for OpenClaw

What it solves

Lossless-claw is a context management plugin for OpenClaw that prevents the loss of conversation history. While most AI agents truncate older messages when they hit the model's token limit, this plugin ensures that every message is preserved and remains accessible to the agent.

How it works

Instead of sliding-window truncation, the plugin uses a DAG-based (Directed Acyclic Graph) summarization system:

  1. Persistence: Every message is stored in a SQLite database.
  2. Hierarchical Summarization: Older messages are grouped into chunks and summarized. These summaries are then condensed into higher-level nodes as they accumulate, creating a graph of information.
  3. Dynamic Assembly: For each turn, the agent's context is assembled by combining recent raw messages with relevant summaries.
  4. Recall Tools: The agent is provided with specific tools (lcm_grep, lcm_describe, lcm_expand) to search and drill down into the compacted history to recover original details.

Who it’s for

Users of OpenClaw who need their AI agents to maintain long-term memory across extensive conversations without losing specific details to truncation.

Highlights

  • Zero-loss memory: Raw messages are never deleted; they are stored in SQLite and linked to summaries.
  • Agent-driven recall: Agents can actively search and expand summaries to retrieve original message content.
  • Management CLI: Includes a shell CLI for inspecting conversations, summaries, and database status.
  • Maintenance tools: Built-in /lossless commands for backups, rotating transcripts, and repairing broken summaries.

相关

  • 项目
  • 项目
  • 项目