lossless-claw  by Martian-Engineering

Lossless context management for AI agents

Created 3 weeks ago

New!

506 stars

Top 61.8% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Lossless Claw (LCM) is an OpenClaw plugin that replaces traditional message truncation with a DAG-based summarization system to overcome LLM context window limitations. It targets OpenClaw users seeking complete conversational history and agent recall without data loss, effectively creating an agent that "never forgets," while managing context within token limits.

How It Works

LCM persists all messages in SQLite, then summarizes older chunks using an LLM. These summaries are condensed into a directed acyclic graph (DAG). Context is assembled each turn from recent messages and DAG summaries. This ensures no information is lost, as raw messages remain accessible and summaries link back to source data, enabling deep detail retrieval via specialized tools.

Quick Start & Requirements

  • Prerequisites: OpenClaw with plugin context engine support, Node.js 22+, configured LLM provider.
  • Installation: openclaw plugins install @martian-engineering/lossless-claw. Local development uses --link flags.
  • Configuration: Primarily via installer; manual JSON edits for contextEngine slot. LCM settings use environment variables or plugins.entries.lossless-claw.
  • Recommended Settings: LCM_FRESH_TAIL_COUNT=32, LCM_INCREMENTAL_MAX_DEPTH=-1, LCM_CONTEXT_THRESHOLD=0.75.
  • Session Management: LCM preserves history but relies on OpenClaw's session.reset.idleMinutes for session duration.

Highlighted Details

  • Agent Tools: lcm_grep, lcm_describe, lcm_expand for searching and recalling history.
  • Data Persistence: SQLite database stores raw messages and summary DAGs.
  • Large File Handling: Intercepts and stores large files separately.
  • Interactive TUI: Optional terminal UI for data exploration and repair.

Maintenance & Community

No specific details on contributors, sponsorships, or community channels are provided.

Licensing & Compatibility

Released under the MIT license, permissive for commercial use and closed-source integration.

Limitations & Caveats

Dependent on OpenClaw framework and LLM provider performance for summarization. Summarization and DAG management introduce computational overhead. Does not override OpenClaw's session reset policies.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
29
Issues (30d)
26
Star History
518 stars in the last 23 days

Explore Similar Projects

Starred by Eric Zhu Eric Zhu(Coauthor of AutoGen; Research Scientist at Microsoft Research) and Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems").

ReMe by agentscope-ai

10.0%
2k
LLM chatbot framework for long-term memory
Created 1 year ago
Updated 2 days ago
Feedback? Help us improve.