Skip to main content
Glama

Lydite

CI License: MIT

中文文档 · User Guide · Overview · Privacy

Lydite (Lydian stone, the siliceous black touchstone used by goldsmiths to separate real gold from counterfeits) is a local-first, anchor-verified memory kernel and MCP server for AI coding agents (claude, codex, and any MCP-compatible host).

Instead of letting agents silently consolidate unverified guesses or external prompt injections into long-term memory ("memory laundering"), Lydite binds 6 structured memory kinds (state, decision, fact, preference, todo, procedure) to 4 epistemic origins (user_stated, tool_verified, agent_inferred, external_doc), enforces repository file anchors and bi-temporal validity, and injects only confirmed, non-drifted context.

Lydite touchstone memory loop

Why Lydite?

Long-horizon multi-agent coding breaks down when a new session treats stale or unvetted notes as current truth:

  • Memory laundering: unreviewed web/RAG snippets (external_doc) or speculative model summaries get saved and later recalled as authoritative user decisions.

  • Silent code drift: refactored files invalidate earlier architecture facts and runbooks, yet flat memory stores keep serving obsolete instructions.

  • Startup context bloat: dumping raw transcripts or verbose procedures into every prompt wastes tokens and degrades reasoning.

Lydite runs on zero third-party Python dependencies (Python >= 3.11 stdlib + SQLite >= 3.34 FTS5 trigram). All databases live locally under $LYDITE_HOME (~/.local/share/lydite on macOS/Linux, %LOCALAPPDATA%\Lydite on Windows).

Related MCP server: Mandrel

Core capabilities

Capability

Mechanism & Surface

Touchstone anti-laundering gate

Pre-hash secret/PII redaction, mandatory draft staging on MCP propose_entries, derived_from origin clamping, 4-gate deterministic --auto-verify for anchored tool_verified claims, and permanent rejected tombstones.

Tri-axis grounded invalidation

Bi-temporal windows (valid_from / valid_until / event_time + --as-of), LF-normalized repository file-blob & path anchors, AGM explicit retraction (retracts), and cycle-safe depends_on cascade (lydite/invalidation.py).

Two-tier lock-free recall

Prompt-cache-friendly ?mode=ro Tier-1 startup briefing (lyd brief / SessionStart, <= 6,000 chars) + Tier-2 stdio MCP (lyd mcp: intent-routed hybrid RRF search, recall_procedures, get_entry, propose_entries, record_outcome).

Skills bridge & clean exit

Export verified procedure entries into validated SKILL.md files (lyd export-skill), import browser chat archives (lyd import-chat), and run lossless JSONL export/import or guarded .jsonl.gz cold archival (lyd gc).

30-second quick start

Install with uv (or pip install -e . inside a Python >= 3.11 virtual environment):

uv tool install .
# Or inside a local virtualenv:
python3 -m venv .venv && ./.venv/bin/pip install -e .

Initialize your repository and wire Claude Code / Codex hooks & MCP in one step:

# Preview host config diffs first (dry-run), then apply with automatic *.bak backups:
lyd setup all
lyd init --setup all
lyd doctor

Daily workflow

  1. Work normally in claude or codex — SessionStart injects a lock-free confirmed Tier-1 briefing; agents recall procedures and propose anchored draft memories over MCP.

  2. lyd review -i — single-keypress interactive triage (y confirm, n reject, v revalidate drifted anchors, s skip, q quit), or run lyd review --project <id> --auto-verify --run for deterministic anchor verification.

  3. lyd maintain — drain queued SessionEnd transcripts into redacted transcripts.db, scan code anchors for drift, and sync optional local embeddings.

lyd CLI overview

Group

Commands

Onboarding & health

lyd init, lyd setup, lyd doctor, lyd config embed

Daily workflow

lyd status, lyd review (-i / --auto-verify), lyd maintain

Search & recall

lyd search, lyd show, lyd brief

Transcripts & web chat

lyd import-chat, lyd capture, lyd sessions

Skills, views & archival

lyd export-skill, lyd render-note, lyd gc, lyd export, lyd import, lyd mcp

Optional browser exporter (browser-capture/)

When an architectural discussion happens in ChatGPT or Claude on the web, the standalone Manifest V3 extension under browser-capture/ (Lydite Capture) exports selected conversations to a local .zip with zero third-party JS libraries. Import it straight into Lydite's redacted fallback transcript store with:

lyd import-chat ~/Downloads/lydite-chatgpt-20261205T000000Z.zip --project my-repo

Verification & evaluation

python -m unittest discover -s tests -v
python eval/continuity_eval.py
python eval/ablation_runner.py --include-m4-plus
python -B browser-capture/tests/test_extension.py
python tools/check_public_tree.py

License

MIT. See LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides coding agents with governed semantic memory and code-graph context via MCP, enabling code-linked recall, blast-radius impact analysis, and lifecycle-aware memory management.
      528 PyPI
      3
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding agents to maintain structured, persistent memory as a typed-edge knowledge graph over contexts, decisions, and tasks, with deterministic auto-threading, trust signals, and replayable story recall. It also exposes a token-lean MCP gateway for on-demand tool discovery, helping agents preserve causal project context across sessions.
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP-compatible coding agents to store, search, and manage persistent local project memories across sessions, with context injection, feedback-driven reinforcement, analytics, and archiving.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI coding agents to store, retrieve, update, and delete structured, project-scoped memories through a minimal MCP toolset, replacing scattered markdown files with traceable long-term codebase context.
      MIT