Loreweave is a local temporal knowledge engine designed for Markdown note vaults. It points at a folder containing Markdown files (Obsidian or ordinary notes), builds a knowledge graph, bitemporal fact storage, and a memory model, and exposes them to users and AI agents through a command-line interface (CLI) and the MCP protocol.
Key capabilities:
- Hybrid retrieval: fuses BM25, dense vector similarity (with optional configuration of a local embedding model), and personalized PageRank over the vault's own graph (wiki links, shared entities, tags, co-occurrence). Results explain how they matched, and two-hop neighbors can surface even without lexical overlap with the query.
- Bitemporal facts: facts record the time they were true in the world (valid_from / valid_until) and the time the system learned them (recorded_at). Contradictory facts are handled by supersession rather than overwriting, and history is always queryable. Supports queries along both time axes with --as-of and --as-known-at.
- Agent memory: exposes 15 typed tools through an MCP server, so MCP clients such as Claude Code and Cursor can use the vault as persistent memory. Session continuity is achieved through deterministic diff queries (lore resume) rather than LLM summarization. Facts stored by agents are written as readable Markdown lines to lore/journal/YYYY-MM-DD.md, which can be opened, edited, and git diffed.
- Memory dynamics: each passage carries FSRS-style stability and retrievability (a power-law forgetting curve). Passages that are actually used decay more slowly, important but fading knowledge is prompted for review, and nothing is ever deleted.
- Idle consolidation (lore dream): reviews the vault and reports duplicate passages, contradictory facts, outdated knowledge, missing links, and orphan notes. With --apply, it writes summaries and a review queue under lore/, and never rewrites the user's original text.
- Deterministic SQL queries: count, group, and date-range queries are executed as SQL over the fact store rather than relying on fuzzy embedding matching.
- Fact extraction: mines existing conventions from notes (such as explicit field syntax) and automatically accepts only unambiguous field syntax; prose formats require explicit enablement or review by an agent through lore_propose_facts.
- Temporal filtering: --since and --until are based on content time (frontmatter date, filename date, or dates in the text), falling back to the file modification time only when the note has no date. lore watch keeps the index up to date.
Usage:
- No installation or trial needed: npx --allow-scripts=better-sqlite3 loreweave --vault ~/notes search "your query" (the first search indexes the folder into .lore/).
- After a global install, lore and loreweave are the same binary.
- Zero configuration, no network: uses BM25 + knowledge graph spreading activation by default. Optionally add local embeddings (such as mxbai-embed-large or nomic-embed-text), with the required task prefixes applied automatically.
- Supports non-English note vaults: Chinese, Japanese, and Korean are segmented by character for search, while other scripts are indexed as-is.
- Requires Node 22 or later; the only native dependency, better-sqlite3, ships prebuilt binaries for macOS, Linux, and Windows (except Node 23, which requires a C++ toolchain). npm 12 requires passing the --allow-scripts=better-sqlite3 argument.
Use cases:
- Providing AI agents with readable, version-controllable, reproducible long-term memory.
- Managing a personal or team Markdown knowledge base that needs temporal fact tracking and hybrid retrieval.
- Wanting retrieval that does not depend on an LLM and produces no token consumption or network calls.
Limitations:
- The core does not perform abstractive summarization, unlike the end-to-end QA capabilities of hosted memory services (such as Mem0 and Zep).
- Retrieval metrics (such as LongMemEval R@5) measure retrieval quality, not end-to-end question-answering accuracy.
- Prose-format fact extraction is off by default and requires explicit configuration or agent review.
- The graph channel is gated off for corpora with no links and no tags (such as SciFact and LoCoMo).
- The cross-encoder reranker is off by default and may only be beneficial when there are no embeddings and rank-1 matters.
- The project uses the MIT license.