# LoreDocs [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/labyrinth-analytics/loredocs  
**GitHub Stars:** 4  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/loredocs

## Description
Local-first knowledge vaults for project docs and specs. Tagged, versioned, full-text searchable.

## Tools
Capabilities this server exposes over MCP:

- **vault_create** — Create a new knowledge vault for organizing project documents.

    A vault is a container for related documents -- like a project folder with
    superpowers (search, tags, versioning). You can link a vault to one or more
    Claude Projects, but vaults are independent and can serve multiple projects.

    Returns the new vault's ID and metadata.
    
- **vault_list** — List all knowledge vaults with summary stats (document count, total size, last modified).

    Use this to see what vaults exist and find the one you need.
    
- **vault_info** — Get detailed information about a vault, including its full document manifest.

    Accepts either a vault ID or vault name.
    
- **vault_archive** — Archive a vault (soft delete). Archived vaults are hidden from vault_list by default but can be restored.
- **vault_delete** — Permanently delete a vault and ALL its documents. This cannot be undone.

    You must set confirm=true to proceed. Consider using vault_archive instead.
    
- **loredocs_onboard** — Set up or update your LoreDocs workspace configuration.

    Call once after installing LoreDocs to get a recommended vault structure.
    Call again to add new domains or agents -- existing data is never modified.

    Creates:
    - A Config vault with a 'My LoreDocs Setup' reference doc (tagged authoritative)
    - One vault per domain in domains
    - One '[Name] Reports' vault per agent in agents
    - The reference doc is queryable: vault_search('my setup')

    Args:
        name: Workspace or team name
        domains: Work areas, each becomes a vault (e.g. ['finance', 'research'])
        agents: Agent names, each gets a '[Name] Reports' vault
        tag_style: 'simple' (default) or 'detailed'

    Vault tags: freeform strings on documents for cross-vault retrieval.
    Categories: reference, report, template, config, archive, general.
    Priority: authoritative, normal, draft, outdated.
    
- **vault_link_project** — Associate a Claude Project name with a vault.

    This is metadata for your organization -- it records which Claude Projects
    use knowledge from this vault. A vault can be linked to multiple projects.
    
- **vault_open_workspace** — Open (or create) a vault scoped to a workspace directory.

    If a vault is already linked to this directory path, returns it.
    Otherwise, creates a new vault named after the directory and records
    the workspace_path so future calls return the same vault.

    This mirrors how MemClaw scopes memory to workspaces -- lower friction
    than naming vaults manually. Named vaults remain available for users
    who prefer explicit management.
    
- **vault_add_doc** — Add a text document to a vault with metadata (tags, category, priority, notes).

    The document will be full-text indexed for search and stored with version tracking.
    Content can be provided inline (content parameter) or from a file path (path parameter).
    For binary files (PDF, DOCX, etc.), use vault_import_dir to import from a directory.
    
- **vault_update_doc** — Update a document's content or metadata.

    If content changes, the previous version is saved automatically in the
    version history. You can restore old versions with vault_doc_restore.
    The author, session_id, and note params are stored in the version's
    metadata sidecar for provenance tracking.

    Unknown parameters are rejected at the MCP dispatch layer (see
    _forbid_unknown_tool_params below): FastMCP's generated arg model for
    this tool has extra="forbid", so a client-supplied unknown param never
    reaches this function body.
    
- **vault_remove_doc** — Soft-delete a document. The document is hidden but can be recovered.

    For permanent deletion, use vault_delete to remove the entire vault.
    
- **vault_get_doc** — Retrieve a document's metadata and optionally its text content.

    Use include_content=false to get just the metadata without loading the full text.
    
- **vault_list_docs** — List documents in a vault with sorting and filtering options.

    Supports sorting by name, date, size, or category.
    Filter by category or tag to narrow results.
    
- **vault_search** — Full-text or semantic search across document contents.

    Default (semantic=False): SQLite FTS5 keyword search. Supports FTS5 syntax:
    - Simple words: depreciation schedule
    - Phrases: "rental income"
    - Boolean: depreciation AND schedule
    - Negation: rental NOT commercial
    - Prefix: deprec*

    Semantic (semantic=True, Pro only): hybrid vector + BM25 search via LanceDB.
    Finds documents by meaning even when exact keywords differ. Requires
    LoreDocs Pro and `pip install loredocs[pro]`. Falls back to FTS5 if the
    semantic index has not been built yet (run vault_rebuild_index first).
    
- **vault_rebuild_index** — Rebuild the LanceDB semantic search index from all stored documents. Pro only.

    Run this after first installing the Pro deps (pip install loredocs[pro]) or
    after restoring from backup. The index is kept in sync automatically for
    new documents added after install, but existing documents require a one-time
    rebuild to become searchable semantically.
    
- **vault_search_by_tag** — Find all documents with a specific tag, across one vault or all vaults.
- **vault_tag_doc** — Add or remove tags on a document.

    You can add and remove tags in a single operation.
    Tags are case-sensitive strings. Duplicates are automatically removed.
    
- **vault_bulk_tag** — Apply tag changes to multiple documents at once.

    Useful for organizing a batch of documents after import or reclassification.
    
- **vault_categorize** — Set a document's category (general, reference, config, report, template, archive, imported).
- **vault_set_priority** — Mark a document's priority/status: authoritative, normal, draft, or outdated.

    'authoritative' means this document is the source of truth.
    'outdated' flags the document as no longer current.
    
- **vault_add_note** — Attach a contextual note to a document.

    Notes help you and your AI assistant understand when/how to use this document.
    
- **vault_doc_history** — View the version history for a document.

    Every time a document's content is updated, the previous version is saved
    automatically. Use vault_doc_restore to revert to an earlier version.
    
- **vault_doc_restore** — Restore a document to a previous version.

    The current version is saved to history first, then the specified version
    becomes the new current version.
    
- **vault_verify** — Verify version-storage integrity for a vault or specific document.

    By default, runs a read-only check that reports:
    - Stale intent journals (crash recovery left incomplete)
    - Recovery orphan files
    - Missing, invalid, or too-new version sidecars
    - Missing versions (no content file and no rotation record)
    - Version count disagreement between DB and filesystem
    - History divergence (loss, jump, rollback, or holes)
    - Unrecognized files under history/
    - Conflict files from hash-guarded replay
    - Per-vault history bytes vs the hard cap
    - Permissions advisory on the vault root

    With repair=True, performs additive-only repairs:
    - Replays stale intent journals
    - Moves invalid/too-new sidecars aside (renames, never deletes)
    - Realigns documents.version_count with the filesystem

    The confirm parameter gates divergence recovery operations.
    Each confirm value writes one marker file and removes nothing.

    With pre_upgrade=True, runs a read-only pre-upgrade scan that
    records .upgrade_scan.json. Safe to run before upgrading LoreDocs.
    
- **vault_copy_doc** — Copy a document from one vault to another, including all metadata.
- **vault_move_doc** — Move a document to a different vault. Removes it from the source vault.
- **vault_inject** — Load ranked vault documents into conversation context with token-budget enforcement.

    Documents are ranked by FTS5 relevance (when query is provided) and priority weight,
    then packed greedily until the effective token cap is reached.

    Args:
        vault_name: Vault name or ID.
        query: Optional FTS5 search query to rank documents by relevance.
        max_tokens: Hard token budget. Overrides vault DB cap. Effective cap = max_tokens * safety_factor.
        cap_behavior: 'best_effort' (inject as many docs as fit) or 'strict' (error if any doc exceeds cap).
        session_token: Optional opaque string used as per-session cache key.
        max_single_doc_tokens: Truncate individual documents to this many tokens. 0 = no per-doc limit.
        safety_factor: Fraction of max_tokens to use as effective cap (default 0.60 = 60%).
    
- **vault_prime** — Pre-load all vault documents into the current session by priority order.

    Equivalent to vault_inject with no query: loads all documents ordered by
    priority weight (authoritative first), then by recency. Use at session start
    to orient yourself on all knowledge available in a vault.

    Args:
        vault_name: Vault name or ID.
        max_tokens: Hard token budget. Effective cap = max_tokens * safety_factor.
        cap_behavior: 'best_effort' (inject as many docs as fit) or 'strict' (error if cap exceeded).
        session_token: Optional opaque string used as per-session cache key.
        max_single_doc_tokens: Truncate individual documents to this many tokens.
        safety_factor: Fraction of max_tokens to use as effective cap (default 0.60 = 60%).
    
- **vault_inject_by_tag** — Load all documents matching any of the given tags into the current conversation context.

    Documents matching any of the provided tags are fetched, ranked by priority weight
    and recency, then packed greedily within the token cap.

    Args:
        vault_name: Vault name or ID.
        tags: List of tags to match (OR semantics: any matching tag includes the doc).
        max_tokens: Hard token budget. Effective cap = max_tokens * safety_factor.
        cap_behavior: 'best_effort' (inject as many docs as fit) or 'strict'.
        session_token: Optional opaque string used as per-session cache key.
        max_single_doc_tokens: Truncate individual documents to this many tokens.
        safety_factor: Fraction of max_tokens to use as effective cap (default 0.60 = 60%).
    
- **vault_inject_summary** — Generate a summary overview of a vault's contents for conversation orientation.

    Lists all documents with their categories, tags, priorities, and notes.
    Useful at the start of a conversation to understand what knowledge is available.
    
- **vault_get_injection_cap** — Return the stored per-vault injection token cap (or 'not set' if none).

    If not set, the server falls back to LOREDOCS_INJECTION_CAP_TOKENS env var,
    then LOREDOCS_INJECTION_DEFAULT_CAP_TOKENS (default 100000).
    
- **vault_get_session_token** — Generate a fresh session token (UUID4) for use with vault_inject / vault_prime.

    Pass the returned token as session_token in subsequent injection calls so the
    per-session cache can scope cached results to this conversation.
    Cache hits are valid until any document in the vault is updated.
    
- **vault_estimate_tokens** — Preview the token count of a vault injection without injecting documents.

    Returns estimated token counts for each document (up to 500) so you can
    choose an appropriate max_tokens value before calling vault_inject.
    Uses tiktoken if available; falls back to char-based estimation.
    
- **vault_get_server_capabilities** — Return a summary of this LoreDocs server's injection capabilities and token estimation settings.

    Useful for diagnosing injection behavior or verifying which features are active.
    
- **vault_import_dir** — Bulk import all supported files from a directory into a vault.

    Imports text files, PDFs, Word docs, Excel files, PowerPoints, and more.
    Each file becomes a separate document with text extracted for search indexing.
    Files over 30MB are skipped. Hidden files (starting with .) are skipped.

    Supports Obsidian vaults: subdirectories are traversed recursively by default
    (set recursive=False for single-level import). Markdown files with YAML frontmatter
    tags (tags: [a, b] or block-list style) have those tags merged into the document.
    
- **vault_export** — Export all documents from a vault to a local directory.

    Copies the original files (not extracted text) to the specified directory.
    Useful for backing up or sharing vault contents.
    
- **vault_link_doc** — Create a link between two documents across any vault.

    Links are bidirectional and labelled (e.g. 'related', 'references',
    'supersedes', 'part-of').  If the link already exists, reports it.
    Use vault_find_related to discover all docs linked to a given document.
    
- **vault_unlink_doc** — Remove a link between two documents (both directions).

    If no link exists between the two documents, reports that cleanly.
    
- **vault_find_related** — Find all documents linked to a given document. Pro only.

    Returns each related document with its vault, category, tags, and link label.
    Use vault_link_doc to create new links.
    
- **vault_suggest** — Get suggestions for documents that may need attention.

    Surfaces documents that are undocumented (no notes), unorganized (no tags),
    or isolated (no links to other documents).  Use to guide housekeeping work
    or to discover documents that haven't been connected to the broader graph.

    Optionally scope to a single vault.
    
- **vault_export_manifest** — Export a complete manifest of a vault's contents.

    Returns vault metadata, document list with tags and categories,
    tag frequency index, category counts, and link count.
    Use the json format for machine-readable output.
    Use the markdown format for human-readable summaries.
    
- **vault_tier_status** — Show current tier (Free or Pro) and usage vs. limits.

    Displays how many vaults and how much storage are in use, with percentages
    against Free tier limits. Useful before hitting a limit to know how close
    you are, or to confirm Pro tier is active after upgrading.
    
- **vault_set_tier** — Activate a tier (free or pro) for LoreDocs.

    Pro tier removes all vault, document, storage, and version limits.
    After purchasing a Pro license, set LOREDOCS_PRO=<your-license-key> in
    your environment and restart the server, then call this tool with tier='pro'
    to persist the Pro tier. Reverting to tier='free' re-enables limits (but
    does not delete any existing data that exceeds the limits -- it only blocks
    new writes).
    
- **get_license_tier** — Return the current LoreDocs license tier and status.

    Use this to confirm whether the Pro license key is loaded and valid.

    Returns a dict with keys:
        is_pro      -- bool, True if Pro tier is active
        mode        -- "licensed" | "dev_bypass" | "free" | "invalid_key"
        product     -- product name from the license payload (if licensed)
        exp         -- expiry date or "never" (if licensed)
        email       -- customer email (if licensed and present)
        error       -- error message (if mode is "invalid_key")
        upgrade_url -- Stripe checkout link (present when not already Pro)
    
- **vault_link_session** — Create a manual cross-product link from a LoreConvo session to a LoreDocs doc.

    Both LoreConvo and LoreDocs must be installed. Manual links are accessible
    on all tiers. The linked doc must not be in an opt-out vault.

    Args:
        session_id  -- LoreConvo session UUID
        doc_id      -- LoreDocs document ID
        vault_id    -- LoreDocs vault containing the document

    Returns dict with:
        ok          -- bool
        session_id, doc_id on success
        reason      -- failure description (generic; details in debug log)
    
- **vault_get_session_links** — Return cross-product LoreConvo sessions linked to a LoreDocs document.

    Both LoreConvo and LoreDocs must be installed. Requires Pro tier for
    auto-links. Manual links are always returned.

    Args:
        doc_id  -- LoreDocs document ID
        limit   -- max results (default 5)

    Returns dict with:
        schema_version          -- CROSS_LINK_SCHEMA_VERSION for version negotiation
        cross_product_available -- bool
        tier_gate               -- "satisfied" | "pro_required"
        links                   -- list of {target_product, target_id, similarity_score,
                                   link_type, created_at, is_stale}
    
- **vault_get_linked_sessions** — Return LoreDocs documents linked to a given LoreConvo session.

    Queries the LoreDocs cross_product_links table for links where the session
    is the source or target. Returns both auto and manual links. Requires Pro
    tier for auto-links.

    Args:
        session_id  -- LoreConvo session UUID
        limit       -- max results (default 5)

    Returns same structure as vault_get_session_links.
    
- **get_server_info** — Return MCP compatibility status for this LoreDocs server.

    Returns product version, installed mcp SDK version, tested version, and
    compatibility status. Useful for diagnosing version mismatches on running
    servers without requiring a restart.

    Returns dict with: product_name, product_version, install_kind (wheel|editable),
    version_from_source (if editable), mcp_installed, mcp_tested, mcp_accepted,
    status (ok|mismatch|undetermined|disabled|internal_error), note,
    error_detail (set only on internal_error).
    
- **vault_import_notion_setup** — 
    Report Notion import readiness and how to enable it. Read-only.
    Does not install or modify any packages.
    

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "loredocs": {
    "command": "uvx",
    "args": ["loredocs"]
  }
}
```

## Documentation

## What LoreDocs does

LoreDocs provides a local knowledge base for project documentation and specifications. Documents live inside named vaults, which can represent projects, work areas, teams, or shared agent knowledge. Each document can carry tags, a category, a priority, and an explanatory note. Vaults can also be associated with Claude Project names or workspace directories.

The system is designed for persistent context across sessions. Agents can store canonical documents once, then retrieve or inject them later instead of maintaining separate copies in agent-specific folders. The `loredocs_onboard` tool can create an initial configuration vault, domain vaults, and report vaults for named agents.

## How it works

Vault metadata and search indexes are stored in a local SQLite database under `~/.loredocs/`, while document files are kept beneath the local vault directory. Standard search uses SQLite FTS5 and supports phrases, Boolean operators, negation, and prefix queries. Documents can be added from inline text or file paths; binary-file imports are handled through directory import functionality.

Changes to document content create version-history entries automatically. Older versions can be inspected and restored, and integrity checks can report problems involving sidecars, missing versions, journals, history divergence, and storage limits. Documents can be copied or moved between vaults while retaining their metadata.

## Setup and configuration

The package can be run with `uvx loredocs`, or installed from a cloned repository with `uv sync`. Claude Code can load the repository as a plugin using `--plugin-dir` or the `/plugin add` command. The repository also includes MCP configuration for local-directory plugin loading. Hermes Agent can register LoreDocs under its `mcp_servers` configuration.

Vault data remains local. LoreDocs does not collect or transmit telemetry. Pro semantic search may download the `BAAI/bge-small-en-v1.5` embedding model from Hugging Face on first use. The optional Notion import uses a token supplied by the user. A background license-revocation-list request can be disabled with `LORE_REVOCATION_REFRESH=0`.

## Tools and capabilities

- Create, list, inspect, archive, delete, and workspace-scope vaults.
- Add, update, retrieve, list, soft-delete, copy, and move documents.
- Search full text with FTS5, or use Pro hybrid vector and BM25 search after rebuilding the semantic index.
- Find documents by tag and apply tag changes to one document or a batch.
- Set document categories and priorities, attach notes, inspect history, and restore earlier versions.
- Inject documents by query, tag, or priority, with token caps, truncation controls, and strict or best-effort packing.
- Generate vault summaries and run read-only or additive-repair integrity checks.

## Limitations and notes

Free usage limits the number of vaults, documents per vault, storage, and retained versions; Pro removes those limits and enables semantic search. Existing documents require `vault_rebuild_index` before they become available to the Pro semantic index, although new documents are synchronized automatically afterward. Semantic search falls back to FTS5 when its index is unavailable.

Permanent vault deletion removes all documents and cannot be undone, while archiving is reversible. Removing an individual document is a soft delete. Token injection uses an effective cap derived from the requested budget and safety factor, so it may load only part of a vault in best-effort mode. Tags are case-sensitive, and tag searches across vaults depend on consistent tag spelling.

_Full upstream README: https://allmcps.com/mcp/loredocs/readme_

