lcm-explorer
v1.2.0
Published
Web UI for browsing and searching OpenClaw LCM databases
Maintainers
Readme
🧠 LCM Explorer
A web UI for browsing and searching OpenClaw LCM (Lossless Context Management) databases.
Browse conversations, drill into messages and their parts, explore the summary DAG, search across everything with full-text search, and inspect the context window that your AI actually sees.
Quick Start
npx lcm-explorerOpens on http://localhost:3078. Auto-discovers your LCM database from your OpenClaw config, or falls back to ~/.openclaw/lcm.db.
If the database isn't found, you'll get specific guidance on what to do next (not just an error).
What is LCM?
lossless-claw is a context engine plugin for OpenClaw that replaces the default sliding window with lossless context management. It stores every message verbatim in a SQLite database and builds a DAG of summaries so your AI never truly forgets a conversation.
LCM Explorer gives you a window into that database.
Prerequisites
- Node.js 18+ (run
node --versionto check) - An LCM database from a running OpenClaw instance with the lossless-claw plugin
Don't have LCM set up yet? See Troubleshooting below.
Tip: Ask your OpenClaw bot to install and set up LCM Explorer for you. It already knows your config, whether LCM is enabled, and where the database lives. Just tell it: "Install LCM Explorer and set it up so I can browse my conversation history." It'll handle the rest, including enabling the LCM plugin if needed.
Install
npx (no install needed)
npx lcm-explorernpm global
npm install -g lcm-explorer
lcm-explorerDocker
docker run -v ~/.openclaw:/data -p 3078:3078 ghcr.io/sheevn/lcm-explorerFrom source
git clone https://github.com/Sheevn/LCM-Explorer.git
cd LCM-Explorer
npm install
npm startConfiguration
CLI flags
lcm-explorer [options]
--port, -p <port> Server port (default: 3078)
--db <path> Path to lcm.db (overrides auto-discovery)
--help, -h Show help
--version, -v Show versionEnvironment variables
| Variable | Default | Description |
|----------|---------|-------------|
| PORT | 3078 | Server port |
| LCM_DB_PATH | (auto-discover) | Explicit path to LCM SQLite database |
| OPENCLAW_HOME | ~/.openclaw | OpenClaw home directory (for config discovery) |
| AUTH_TOKEN | (none) | Optional access token for authentication |
Database discovery
LCM Explorer finds your database automatically:
--dbflag orLCM_DB_PATHenv var: explicit path, used as-is- OpenClaw config: reads
openclaw.jsonto find the LCM plugin's configured DB path - Default:
~/.openclaw/lcm.db
For non-standard OpenClaw installs, set OPENCLAW_HOME:
OPENCLAW_HOME=/opt/openclaw npx lcm-explorerCustom database path
# Via flag
npx lcm-explorer --db /path/to/lcm.db
# Via env var
LCM_DB_PATH=/path/to/your/lcm.db npx lcm-explorerCustom port
npx lcm-explorer --port 9090
# or
PORT=9090 npx lcm-explorerAuthentication
By default there's no auth, which is fine for local use.
If you're exposing it on a network, set AUTH_TOKEN:
AUTH_TOKEN=my-secret-token npx lcm-explorerYou'll get a login page. Enter the token once and you're in for 7 days (cookie-based session).
API access works with Bearer tokens:
curl -H "Authorization: Bearer my-secret-token" http://localhost:3078/api/statsFeatures
- Conversations: Browse all conversations with message counts, token usage, and timestamps
- Messages: Paginated message list with role filtering, click through to full content and parts
- Summary Tree: Visualize the summary DAG with parents, children, and source messages
- Full-Text Search: Search across messages and summaries using SQLite FTS5
- Context Window: See exactly what items are in the current context window
- Statistics: Database overview with role distribution, compression ratios, part type breakdown
- Dark/Light Theme: Toggle between themes, preference saved locally
Screenshots

Troubleshooting
"LCM database not found"
LCM Explorer gives you specific guidance based on your setup:
- No OpenClaw installed: Install OpenClaw first, then the LCM plugin
- OpenClaw installed, no LCM plugin: Run
openclaw plugins install @martian-engineering/lossless-claw - LCM plugin installed, not configured: Add it as a
contextEngineslot inopenclaw.json - LCM configured, no data yet: Run some conversations with OpenClaw to generate data
You can always point directly to a database:
npx lcm-explorer --db /path/to/lcm.db"Port 3078 is already in use"
Another process is using that port. Try a different one:
npx lcm-explorer --port 3079Database on a remote server
Copy the database locally (it's a single SQLite file):
scp server:~/.openclaw/lcm.db ./lcm.db
npx lcm-explorer --db ./lcm.dbThe database is opened read-only, so it's safe to copy while OpenClaw is running.
LCM Compatibility
| LCM Version | Explorer Support | Notes | |-------------|-----------------|-------| | 0.3.x | Full | Core tables only | | 0.4.x | Full | Plugin config support, session scoping | | 0.5.0+ | Full | Large file externalization, bootstrap checkpoints, model on summaries |
LCM Explorer auto-detects which tables exist and degrades gracefully. Tables added in newer versions (like large_files and conversation_bootstrap_state) are queried only if present. Running against an older LCM database works fine; you just won't see the newer stats.
API Routes
All routes return JSON. Authenticated if AUTH_TOKEN is set.
| Route | Description |
|-------|-------------|
| GET /health | Always public. Returns status, uptime, DB connection state |
| GET /api/stats | Aggregate stats: messages, summaries, conversations, role distribution, large files, bootstrap checkpoints, DB size |
| GET /api/conversations | List all conversations with message/summary counts and token totals |
| GET /api/conversations/:id | Single conversation detail with role breakdown |
| GET /api/conversations/:id/messages | Paginated messages. Params: limit, offset, role |
| GET /api/conversations/:id/messages/:msgId | Full message with all parts |
| GET /api/conversations/:id/summaries | Summaries with parent IDs and source message IDs |
| GET /api/summaries/:id/tree | Summary DAG: parents, children, source messages |
| GET /api/context/:convId | Current context window items with resolved content |
| GET /api/search | Full-text search. Params: q, scope, conversation_id, limit |
| GET /api/large-files | List externalized large files (v0.5.0+). Params: conversation_id, limit, offset |
| GET /api/large-files/:id | Single file detail (v0.5.0+) |
LCM Database Schema Reference
Tables created and managed by lossless-claw. LCM Explorer reads these in read-only mode.
Core Tables (all versions)
| Table | Purpose | Key Columns |
|-------|---------|-------------|
| conversations | Session groupings | conversation_id, session_id, session_key, title, bootstrapped_at, created_at, updated_at |
| messages | Raw message content | message_id, conversation_id, seq, role, content, token_count, created_at |
| message_parts | Structured message components | part_id, message_id, session_id, part_type, ordinal, text_content, tool_name, tool_input, tool_output, tool_error, tool_call_id, tool_status, tool_title, patch_hash, patch_files, file_mime, file_name, file_url, subtask_prompt, subtask_desc, subtask_agent, step_reason, step_cost, step_tokens_in, step_tokens_out, snapshot_hash, compaction_auto, metadata, is_ignored, is_synthetic |
| summaries | Compressed context (DAG nodes) | summary_id, conversation_id, kind (leaf/condensed), depth, content, token_count, earliest_at, latest_at, descendant_count, descendant_token_count, source_message_token_count, file_ids, model, created_at |
| summary_messages | Summary-to-message links | summary_id, message_id, ordinal |
| summary_parents | DAG edges | summary_id, parent_summary_id, ordinal |
| context_items | Current context window | conversation_id, ordinal, item_type (message/summary), message_id, summary_id, created_at |
v0.5.0+ Tables
| Table | Purpose | Key Columns |
|-------|---------|-------------|
| large_files | Externalized tool outputs | file_id, conversation_id, file_name, mime_type, byte_size, storage_uri, exploration_summary, created_at |
| conversation_bootstrap_state | Incremental bootstrap checkpoints | conversation_id, session_file_path, last_seen_size, last_seen_mtime_ms, last_processed_offset, last_processed_entry_hash, updated_at |
FTS Tables
| Table | Tokenizer | Indexed Columns |
|-------|-----------|-----------------|
| messages_fts | porter unicode61 | content |
| summaries_fts | porter unicode61 | summary_id (UNINDEXED), content |
Message Part Types
text, reasoning, tool, patch, file, subtask, compaction, step_start, step_finish, snapshot, agent, retry
Tech
- Express + better-sqlite3 (read-only)
- Vanilla JS SPA (no build step, no framework)
- CSS custom properties for theming
- Zero external API calls
License
MIT
