lore-mcp
This MCP server lets you search and inspect locally indexed document collections.
Run semantic/hybrid search over indexed documents with
search_docs, returning relevant passages, similarity scores, and source files.Control search results with
query, optionaltop_k, and optionalcollection.List indexed files and their chunk counts with
list_indexed_sources, optionally filtered by collection.List available collections with chunk and file counts via
list_collectionsin multi-collection mode.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@lore-mcp search docs for 'machine learning setup'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
lorme
LORME — Local Offline Retrieval & MCP Engine
An MCP server for semantic search over your local
documents. Preprocesses, indexes, and serves any
format — PDF, HTML, DOCX, markdown, and more. No
cloud, no external database — just a single .db
file on your workstation.
What it does
Preprocesses source documents in any format (PDF, HTML, DOCX, PPTX, XLSX, EPUB, images, audio, video, CSV, JSON, XML, markdown) into clean markdown
Indexes with vector embeddings and full-text search (hybrid FTS5 + vector with RRF fusion)
Serves three MCP tools (
search_docs,list_indexed_sources,list_collections) for any MCP clientEvaluates retrieval quality with built-in RAG evaluation and parameter optimization
Runs locally with automatic GPU/API/CPU fallback for embedding generation
Related MCP server: Lexomni MCP
Quickstart
1. Install
From PyPI:
pip install lormeInstall extras by need:
pip install lorme— core (markdown only)pip install "lorme[html]"— add HTML support (trafilatura)pip install "lorme[pdf]"— add PDF/DOCX/PPTX support (Docling)pip install "lorme[video]"— add video/audio download from YouTube/platforms (yt-dlp)pip install "lorme[parse]"— all format supportpip install "lorme[eval]"— RAG evaluation (RAGAS)
From source:
git clone https://github.com/romainsc/lorme.git
cd lorme
pip install -e ".[parse]"2. Create a config file
# config.yaml
database:
path: ./lore.db
embedding:
model: nomic-ai/nomic-embed-text-v2-moe
mode: builtin # builtin, builtin:gpu, builtin:cpu, api
chunking:
chunk_size: 1024
chunk_overlap: 128See docs/configuration.md
for all options.
3. Create a manifest
# manifest.yaml
collection: my-docs
level: libre
sources:
- title: Architecture Guide
license: Apache-2.0
orig: architecture.pdf
- title: API Reference
orig: api-ref.html
- url: https://example.com/guide.mdThe manifest declares sources abstractly. orig
is the source file in its native format. path
(output filename) is generated automatically.
4. Preprocess and build
# Preprocess: convert + clean sources
lorme preprocess manifest.yaml \
--config config.yaml \
--docs-base-dir /path/to/corpus/ \
--orig-dir orig \
--prep-dir prep
# Build: index preprocessed sources
lorme build manifest-prep.yaml \
--config config.yaml \
--docs-dir /path/to/corpus/prep/ \
--output-dir /path/to/output/ \
--skip-optimizeOr combine both in one step:
lorme build manifest.yaml \
--config config.yaml \
--docs-dir /path/to/corpus/orig/ \
--output-dir /path/to/output/ \
--preprocess --skip-optimize5. Start the MCP server
Option A: HTTP server (recommended)
lorme --config config.yaml --transport sse{
"mcpServers": {
"lore": {
"url": "http://localhost:8000/sse"
}
}
}Option B: subprocess (stdio)
{
"mcpServers": {
"lore": {
"command": "/path/to/.venv/bin/lorme",
"args": ["--config", "/path/to/config.yaml"]
}
}
}6. Use from your MCP client
search_docs("how to configure authentication")
search_docs("deployment", top_k=10, collection="docs-libre")
list_indexed_sources()
list_collections()Search uses hybrid retrieval (vector + FTS5 full-text) with Reciprocal Rank Fusion for better keyword matching alongside semantic similarity.
CLI commands
Command | Purpose |
| Start MCP server |
| Convert and clean sources |
| Index sources into .db |
| Analyze source quality |
| Evaluate retrieval quality |
| Auto-optimize parameters |
| LLM enrichment (context, Q&A) |
| Manage pipeline state (--list, --purge) |
All commands accept --config config.yaml.
Architecture
Uses nomic-ai/nomic-embed-text-v2-moe for embeddings (768 dimensions, multilingual, Apache 2.0) and sqlite-vec for vector storage. Hybrid search combines vector KNN with FTS5 full-text via RRF fusion.
Preprocessing uses trafilatura (HTML, Apache 2.0), Docling (PDF/DOCX, MIT), and markitdown (CSV/JSON/XML, MIT).
See docs/architecture.md
for the full design.
Roadmap
Done
SQLite + sqlite-vec storage with model validation
Embedding with GPU/API/CPU fallback
MCP server (search_docs, list_indexed_sources, list_collections)
Multi-collection support with license classification
Preprocessing tool (multi-format parsing, clean, dedup, PII detection, quality gate)
LLM enrichment (contextual retrieval, Q&A mode)
Hybrid search (FTS5 + vector + RRF fusion)
RAG evaluation and parameter optimization
Build workflow (manifest + config → optimized .db + metadata)
Unified config.yaml (no env vars)
MarkdownTextSplitter (structure-aware chunking)
Reranking (cross-encoder, granite reranker)
Adjacent-chunk / parent-child retrieval
End-to-end parameter optimization
CI/CD with GitHub Actions
Docker image (Containerfile)
Audio ingestion (STT via API)
Video ingestion (STT + frame extraction, 4 strategies: scene/interval/hybrid/OCR)
Video download from YouTube/platforms (yt-dlp, caption download → skip STT)
Resumable pipeline with per-phase hash (config change → auto re-run)
Configurable enrichment prompts (prompts.yaml, custom overrides)
Smart frame captioning filter (OCR before VLM)
Graceful shutdown (Ctrl+C → cleanup)
554+ tests (TDD)
Next
pip install lorme (PyPI)
STT post-correction (LLM fix of transcription errors)
Detailed eval report (markdown)
AI-assisted development
This project is developed with AI assistance
(Claude, Anthropic). All AI-assisted content is
marked with Assisted-by and Co-Authored-By
trailers in commits. Every contribution is
reviewed, tested, and validated by a human.
License
AGPL-3.0-or-later — see
docs/adr/001-license-gpl-v3.md
for the rationale.
Copyright (C) 2026 Romain Chantereau
Available Tools
3 toolslist_collectionsA
List available collections with chunk and file counts.
Only available in multi-collection mode (LORE_DB_DIR set).
Inputs: no named parameters. Returns: result
list_indexed_sourcesA
List all indexed files with chunk counts.
In multi-collection mode, specify a collection name or leave empty to list sources across all collections.
Inputs: collection. Returns: result
search_docsA
Semantic search over indexed documents.
Returns the most relevant passages for the given query, with similarity scores and source files. In multi-collection mode, specify a collection name or leave empty to search across all collections.
Inputs: query (required), top_k, collection. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clear, distinct purpose: search_docs performs semantic search, list_indexed_sources lists indexed files, and list_collections lists collections. No functional overlap or ambiguity.
All tool names follow a consistent verb_noun pattern in snake_case: search_docs, list_indexed_sources, list_collections. The naming is uniform and predictable.
Three tools is well-scoped for a documentation retrieval server, covering search and listing operations without unnecessary bloat.
The core retrieval workflows are covered: searching documents, listing sources, and listing collections. Minor gaps exist, such as retrieving a full document by ID, but the surface is reasonably complete for a search-focused server.
Maintenance
Related MCP Connectors
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Linked markdown notes as memory for AI apps: search, read, save and link notes over MCP.
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
Token-efficient MCP memory for Markdown vaults. Tiered search, GraphRAG, AI memories.
Related MCP Servers
- AlicenseAqualityDmaintenanceLocal-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.315 npmMIT
- AlicenseAqualityBmaintenanceMCP server for local knowledge management with Markdown and PDF indexing using SQLite FTS5.515 npm2MIT
- AlicenseNot gradedqualityCmaintenanceProvides MCP tools for semantic search over personal knowledge sources using pluggable embeddings and local vector indexing.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables local semantic and full-text search over Markdown notes through MCP, returning relevant passages ranked by meaning and exact terms without requiring a GPU or hosted APIs.MIT