SuperAPI AI Directory

llm-wiki-cli

Open-source proactive project-memory CLI for AI coding agents, with source-grounded durable knowledge, SQLite/FTS5 retrieval, atomic updates, optional document/code graphs, and MCP/Skill/Hook integration across supported tools.

Open website

About this tool

LWC (llm-wiki-cli) is an agent-driven proactive memory command-line tool for AI agents, enabling them to autonomously recall, maintain, and evolve persistent, traceable knowledge across sessions. It turns curated documents into a persistent Wiki: the agent handles reasoning and synthesis, while lwc handles preserving sources, pages, citations, links, indexes, and history, allowing knowledge to accumulate continuously rather than being rediscovered from raw fragments on every query.

Purpose and Positioning LWC is a machine interface for agents, not a note-taking app for humans. In normal use, humans select sources, state goals, ask questions, and review answers or projected Markdown; agents run the CLI, manage scope, consolidate sources, maintain citations and links, and decide what is worth recalling or writing back. Both LWC and RAG can help LLMs process external documents, but they differ in where state is preserved: typical RAG retrieves raw fragments at query time and constructs a one-off answer, whereas LWC preserves useful work between requests. Retrieval is merely one operation inside LWC, not its organizing principle; the persistent artifact is a traceable Wiki whose pages, citations, links, contradictions, and history are revised as knowledge changes. Therefore LWC does not require embeddings or a vector database, and it does not discard each synthesis result after answering. It can complement RAG, but it is not query-time RAG.

Main Capabilities

  • Persistent and traceable Wiki: turns curated documents into a persistent Wiki, preserving sources, pages, citations, links, indexes, and history.
  • Hierarchical recall and knowledge graph: indexes sources and Wiki pages at the document, paragraph, and sentence levels; agents can start from small answer-shaped context, expand to exact spans only when necessary, and detect stale locators after content changes. An optional document graph connects pages, sources, citations, links, and explicit semantic relationships; SQLite remains authoritative, while Grafeo or SurrealDB provides a rebuildable traversal layer. Explicit relationships retain their rationale, source, confidence, and source evidence.
  • Document conversion and Office reading: optional Anydoc or MarkItDown adapters convert supported local files into reviewable Markdown before ingestion; OfficeCLI provides a separate, consent-based read-only path for Word, Excel, and PowerPoint files. Neither is silently installed or enabled, and source Office files are never modified.
  • Optional learning suite: Tutor, Book, and Practice is an independent optional capability, disabled by default and backed by independent private storage. Tutor saves teaching rounds, learner evidence, goals, plans, and a private Soul/Wiki; Book imports supported books in verified source order for complete, grounded reading; Practice saves versioned question banks, exam papers, attempts, grading, flashcards, and FSRS review state. Each runtime is downloaded on demand, pinned to the LWC version, and verified via checksum. Disabling a capability preserves its canonical data.
  • Temporal memory: records compact events about what changed, why decisions were made, what was tried, the results, and what remains unresolved. It complements the Wiki: temporal recall explains history, while the Wiki represents current stable knowledge. It is kept bounded and protects pinned, unresolved, and open-contradiction records. Events are normalized rather than storing raw chat logs, and similar events are never silently merged.
  • Multi-machine sync: coordinates project memory, global memory, or both over SSH while keeping semantic Wiki state separate from Git publication. Merging preserves unique objects from both sides; conflicts are returned in bounded packets for explicit resolution. Sessions are persistent and resumable. LWC never copies live SQLite databases, WAL, or SHM files, never resets the working tree, and separates canonical publication from rebuildable search and graph projections.
  • Atomic multi-command changes: Changesets make multi-step knowledge updates invisible until reviewed and verified. Commit publishes only the touched canonical entities in a single transaction; unrelated active work is preserved, and same-entity revision conflicts fail closed. A successful commit records exact reverse patches for supported operations, enabling protected rollback without replacing the entire Wiki.
  • Portable memory archives: an agent can package a project Wiki or an explicitly selected global Wiki into a single portable archive and safely import or conservatively merge it into another LWC store. The archive contains the complete plaintext memory of the selected Wiki, so it should be shared only with trusted recipients, and received content should be treated as untrusted data rather than instructions. Existing memory is never implicitly replaced: imports stage a recoverable merge, while a full-store overwrite requires separate human confirmation.
  • Self-hosted team memory (v0.19.5): team spaces keep core memory in local SQLite and Wiki files and automatically sync through a self-hosted server. External agents resolve conflicts via CLI/MCP; LWC does not embed an LLM. The team console supports EnText and Simplified Chinese, explicit space permissions, device/agent access, and auditable memory recovery. Cloud-only readers can query without creating a local copy.

How to use LWC is an agent-driven tool; humans usually describe goals and review results, while agents operate the CLI. The recommended approach is to let the agent complete setup: paste a prompt into the agent you are using, and it will install the global CLI, delegate all supported host configuration to LWC's idempotent AgentTarget installer, and use native self-configuration only for unregistered agents.

Typical workflow:

  1. Initialize the project Wiki: the agent creates a project-local Wiki and defines its purpose and maintenance rules. Project state is excluded from Git locally by default, unless you explicitly choose to version it.
  2. Add source material: curated files become immutable, deduplicated snapshots. LWC tracks their live paths and can report whether the current file is unchanged, modified, missing, or superseded.
  3. Analyze and integrate one source: the agent reads the complete bounded source, writes a source summary with citations, updates shared knowledge, and completes ingestion only after both layers are consistent.
  4. Query the accumulated Wiki: search is page-first and source-based. The agent first retrieves maintained answers, then opens the precise source evidence when a claim needs verification.

The regular loop is short: recall relevant maintained knowledge; check the current source or code when freshness matters; make the smallest verified update; verify retrieval, links, and applicable graph projections. Broad revisions use atomic changesets.

Installation Most users only need one package command. Homebrew, crates.io, checksum-verified GitHub releases, and local Cargo builds are also supported.

Companion Agent Skill The bundled using-lwc Skill turns LWC into a proactive memory layer. It recalls bounded context, keeps project and global knowledge separate, integrates sources, preserves citations, and writes back only verified knowledge worth reusing. It can be installed from skills.sh. The canonical trigger is $using-lwc. The Skill is runtime-agnostic and includes focused guidance for memory, documentation graphs, Word Graph, CodeGraph, strong tags, transformation, onboarding, recovery, and maintenance.

Native agent setup LWC detects supported agents and installs its available MCP, Skill, Hook, and Instructio through an idempotent AgentTarget adapter.ns interface. A unified read-only MCP exposes bounded Wiki memory and optional code context without expanding the active workspace. The 12 registered targets include Claude Code, Cursor, Codex, OpenCode, Hermes, Gemini CLI, Antigravity, Kiro, GitHub Copilot in VS Code, Copilot CLI, Copilot for JetBrains, and pi.

Applicable scenarios LWC is suitable for scenarios that require maintaining project memory across sessions, maintaining traceable knowledge, sharing context among multiple AI coding agents, performing team self-hosted memory synchronization, managing documentation and code graphs, and requiring temporal memory and atomic change review. It can also be used complementarily with RAG.

Limitations and cautions

  • LWC does not embed an LLM; the agent is responsible for reasoning and synthesis.
  • It does not rely on embeddings or a vector database, but it is not query-time RAG.
  • Portable memory archives contain complete plaintext memory and should only be shared with trusted recipients, and the received content should be treated as untrusted data.
  • Existing memory is not implicitly replaced; full-library overwrite requires separate manual confirmation.
  • Capabilities such as document conversion, Office reading, document graphs, and CodeGraph all require explicit consent and are not enabled merely because they exist at runtime.
  • Narrow shell consent is enforced as ask only for Claude Code, Cursor, global Hermes, and Antigravity; Codex receives advisory additional context and cannot enforce ask. Unsupported consent events are not installed and return an exact no-op.
  • Only Claude Code and Codex can continue an actionable active Plan after Stop, once per native loop guard; other Stop interfaces are not simulated.
  • Sparse commit currently has exact patches for Source add/ingest, Page put/remove, schema, purpose, and recorded search operations; retrieval weights and explicit semantic relationship changes fail with changeset_sparse_unsupported and need to be applied as direct single-entity operations.
  • Project and global changesets are independent of each other, --scope all is invalid, and init, maintenance, checkpoint, and embeddedchangeset commands reject --changeset.
  • Full snapshots still have a cost, and propagation depends on storage and workload.
  • Email, Feishu, and GitHub login use provider configuration supplied by the deployer.
  • Information not explicitly provided in the materials, such as fees, pricing, and platform support details, is not yet provided.