Use Lossless Claw with QMD in OpenClaw the Right Way
Operators running long-lived OpenClaw instances often hit the same question: how do I keep conversation history without losing the ability to search across old memories? Lossless Claw and QMD solve different parts of this problem, and using them together requires understanding what each actually does.
Evidence from the field: hosted support shipped March 16, 2026
Managed OpenClaw hosting added first-class support for Lossless Claw on March 16, 2026, including runtime dependency installation, configuration generation, and UI controls. The shipped implementation provides concrete evidence of how the two systems interact in production.
- Runtime install behavior: When you first enable Lossless Context from Instance Settings, the platform execs into the running pod and installs
@martian-engineering/lossless-clawautomatically. QMD follows the same pattern for@tobilu/qmd. - Hosted defaults: The platform ships with tested defaults —
freshTailCount=32,contextThreshold=0.75,incrementalMaxDepth=-1— avoiding the need for manual tuning in most cases. - Import detection: If you import an OpenClaw config that already specifies
lossless-claw, the preview parsing detects it and the hosted setup preserves your configuration. - Enablement constraint: Both features can only be toggled while the instance is running. This design avoids extra image bootstrap complexity and allows safe runtime dependency injection.
- Non-exclusive behavior: The product explicitly treats Lossless Claw and QMD as compatible. QMD sets
memory.backend="qmd"while Lossless Claw occupies theplugins.slots.contextEngineslot — different layers that do not conflict.
Problem: two different memory layers
OpenClaw has distinct memory mechanisms that are easy to conflate. When you enable both Lossless Claw and QMD without understanding their boundaries, you can end up with unexpected behavior: memories that feel lost, search that seems broken, or compaction that does not work the way you expected.
The root cause is usually not a bug in either system. It is a misunderstanding of which layer handles which responsibility.
What Lossless Claw actually does
Lossless Claw is a context compaction engine. When a conversation grows beyond the model's token limit, OpenClaw must reduce what gets sent to the model. The default approach is a sliding window that drops older messages. Lossless Claw replaces this with a smarter system:
- Summarizes older messages into a DAG — instead of dropping history, it compresses it into structured summaries.
- Reassembles context from recent + summaries — each new turn combines fresh messages with the most relevant condensed history.
- Exposes retrieval tools over compacted history — the agent can search or expand older material instead of treating it as gone.
- Preserves continuity — the assistant behaves as if it remembers the full thread, not just the last N messages.
In managed OpenClaw hosting, you enable Lossless Claw from Instance Settings with a single toggle. The platform installs the @martian-engineering/lossless-claw plugin, wires it into the context engine slot, and restarts with sane defaults.
What QMD actually does
QMD (Query-Memory-Document) is a long-term memory search backend. It solves a different problem: finding relevant information from your workspace memory files when the context window does not hold everything anymore. QMD provides:
- Hybrid BM25 + vector search — keyword matching combined with semantic embeddings for better recall.
- Automatic indexing — re-scans your memory files every 5 minutes with a 15-second debounce.
- Scoped retrieval — indexes direct chats by default, keeping group noise out of your personal memory.
- Source citations — when QMD retrieves a memory, it can tell you which document it came from.
QMD operates on your workspace memory files — MEMORY.md, daily notes, and other Markdown in your OpenClaw workspace. It does not directly touch the in-memory conversation context that Lossless Claw manages.
How the two systems interact
The key insight is that Lossless Claw and QMD operate at different layers:
| Layer | Lossless Claw | QMD Memory |
|---|---|---|
| Primary function | Context compaction during conversation | Long-term memory search |
| Operates on | Conversation messages in memory | Workspace Markdown files |
| Triggered by | Token limit exceeded | Queries and 5-minute intervals |
| Persistence | Session-scoped, in-memory DAG | Disk-based index and documents |
| User-facing effect | Older turns feel remembered | Old facts become searchable |
When both are enabled, a query can pull from three sources: recent raw messages, Lossless Claw summaries, and QMD-retrieved workspace documents. The trick is ensuring each source is configured for its intended use case.
When to use each system
Use QMD when:
- You need to recall facts from days or weeks ago.
- Your assistant should remember decisions, project context, or reference material.
- You want semantic search that finds relevant memories even when wording differs.
- You run multiple conversations and want shared knowledge across them.
Use Lossless Claw when:
- Individual conversations grow long and hit token limits repeatedly.
- You need continuity within a single thread rather than across threads.
- The assistant should refer back to earlier points in the same conversation.
- You want compaction without losing older message content.
Use both when:
- You run long threads AND need cross-thread memory recall.
- You want the assistant to remember both the current conversation (Lossless Claw) and historical context (QMD).
- You operate research, planning, or operations workloads with multi-week continuity.
Common misunderstandings
Misunderstanding 1: Lossless Claw replaces QMD
Lossless Claw preserves conversation context during compaction. It does not index your workspace files or provide semantic search across days of history. If you need long-term memory recall, QMD is still required.
Misunderstanding 2: QMD handles compaction
QMD retrieves relevant memories from your workspace. It does not change how OpenClaw compacts the conversation context when tokens run out. Lossless Claw is what modifies compaction behavior.
Misunderstanding 3: Both systems conflict
Because they operate at different layers, Lossless Claw and QMD do not interfere when configured correctly. QMD indexes workspace files; Lossless Claw manages in-memory context summaries.
Step-by-step setup pattern
Step 1: Enable QMD for long-term memory
- Open your instance dashboard.
- Find the QMD Memory card.
- Check Enable QMD memory backend.
- Confirm the instance restarts with the new configuration.
This gives your assistant searchable access to MEMORY.md and daily notes. Test by asking a question about something you documented days ago.
Step 2: Add Lossless Claw for context compaction
- Open Instance Settings.
- Enable Lossless Context.
- Wait for the plugin install and instance restart.
After this, long conversations will use the lossless compaction engine instead of a sliding window. You will notice the assistant referring back to earlier points in the same thread more naturally.
Step 3: Verify both are working
Test with a long conversation that references something in your workspace:
- Start a new thread and ask a question that should be answered from
MEMORY.mdor a daily note. - Continue the conversation for many turns until you would expect compaction to trigger.
- Ask about something from earlier in the thread — Lossless Claw should maintain continuity.
- Ask about something from days ago — QMD should retrieve the relevant memory.
Edge cases to watch
Edge case 1: Compaction before QMD indexing
QMD runs on a 5-minute interval. If you write something to memory and immediately start a long conversation, recent writes may not be indexed yet. The 15-second debounce helps, but very rapid workflows can still miss the latest changes.
Edge case 2: Group chat scope
QMD defaults to indexing direct chats only. If you primarily use group channels, your memories may not be indexed without changing the scope rules. Lossless Claw works the same way regardless of chat type.
Edge case 3: Session resets
Both systems are subject to OpenClaw's session reset behavior. If your channel or workflow triggers frequent resets, neither Lossless Claw summaries nor QMD indexing will prevent context loss from a full session reset.
Diagnostic checklist
If something feels wrong with your memory setup:
- QMD not finding memories: Check that the memory file exists, is indexed, and matches your chat scope (direct vs group).
- Lossless Claw not preserving context: Verify the plugin is enabled in your config and the instance restarted after enabling it.
- Both enabled but memories feel lost: Check whether session resets are clearing context before either system can help.
- Search works but context still drops: Confirm Lossless Claw is actually installed and active in the context engine slot.
Result verification
A healthy setup with both systems should show:
- Old facts become retrievable via QMD search.
- Long threads maintain continuity through Lossless Claw summaries.
- No manual config editing required on managed hosting.
- Citations appear when QMD retrieves a memory document.
- The assistant refers back to earlier thread context naturally.
Typical mistakes
Mistake 1: Enabling Lossless Claw first
Start with QMD. It provides immediate value across all conversations. Lossless Claw only matters when you hit compaction, which may not happen immediately in all workflows.
Mistake 2: Expecting QMD to handle conversation context
QMD searches workspace files. It does not prevent conversation context from being dropped during compaction. That is what Lossless Claw is for.
Mistake 3: Ignoring session reset settings
Neither system prevents session resets. If your workflow resets context frequently, adjust session reset settings before expecting continuous memory.
Get both features running in minutes
Managed OpenClaw hosting supports both Lossless Claw and QMD with one-click setup. Enable QMD for long-term memory search, add Lossless Claw for conversation compaction, and run with confidence that both layers work together.
Related reading
What QMD is, how it combines BM25 and vector search, and how to enable it in one click.
OpenClaw internal memory files explainedA practical guide to AGENTS.md, IDENTITY.md, MEMORY.md, and the rest of the workspace files that QMD indexes.
OpenClaw Setup vs self-hostedCompare managed hosting with manual setup, including how features like Lossless Claw and QMD are handled.
OpenClaw cloud hostingManaged hosting with one-click Lossless Claw and QMD setup, runtime dependency installation, and tested defaults.
OpenClaw setup guideComplete configuration guide for deploying OpenClaw, including memory backends and plugin setup.