Skip to main content Switch to mobile version reelith 0.0.3 Local MCP film recommender for your Letterboxd history
pip install reelith Copy PIP instructions
A local, offline-capable film recommender for your Letterboxd history.
Your client LLM acts as a semantic router: it turns "something cynical and slick" into anchor films like Fight Club and Nightcrawler, and a local vector engine does the actual search. Nothing about your taste leaves your machine, and the recommendations come from arithmetic over your own ratings rather than from a model's memory.
your mood │ ▼ client LLM (BYO: Claude Desktop, ...) ← semantic router, no recommendations of its own │ MCP over stdio, five tools ▼ Python MCP server ──────────────┐ │ │ ▼ ▼ Rust/PyO3 vector engine SQLite local state (cosine + Hilbert + Lehmer) (history, policy, cache) Anchors → vector. Your positive anchors become a centroid; the policy blends it with a learned vector s_t (state S₀ is a flat, unweighted centroid of your rated history — the MDP starting state).
Search. Cosine scores over the whole catalog, then a top-m region ordered by Hilbert rank and sampled by weighted Lehmer unranking. Sampling without replacement, no duplicates, tunable temperature. As temperature approaches zero, the output converges exactly to greedy.
Feedback. accept / reject_dislike move s_t; reject_seen_it only masks.
That is all a user needs. The Rust extension ships as a prebuilt abi3 wheel (one wheel covers every Python 3.11+), and the recommendation index builds itself on first run, so there is no compiler and no setup step.
The server entry is always the same — uvx reelith, stdio transport. No compiler, no config file, nothing to build.
uvx reelith doctor # check this machine, then prints your client entry Then add it to any MCP client:
{ "mcpServers": { "reelith": { "command": "uvx", "args": ["reelith"] } } } Claude Code:
claude mcp add reelith -- uvx reelith reelith doctor is worth running first: the first recommendation downloads the index, and in most MCP clients that progress goes to a stderr stream the host never shows. Running it in a terminal once means the download happens where you can see it.
The download (what it is and why)
reelith needs a vector index to rank films: one vector per film, learned from 10.2 million Letterboxd ratings. That is the model. It is not a cache of the site, and it is not your data — it is what makes recommendations arithmetic instead of an LLM guessing.
It comes as three files totalling ~40 MB, fetched once into ~/.reelith/artifact/:
Why not ship them inside the package? A wheel is downloaded per virtualenv, per platform. The index is fetched once per machine and shared by every client that uses reelith.
Why not fetch live from Letterboxd? Rediscovering 138k films on every query would be slow, rate-limited, and robots.txt forbids the browse pages. Live Letterboxd is used only to bridge a film the index has never seen.
After the first run there is no network requirement. Queries are answered from the mmap'd vectors on disk.
If the bundle is unreachable, reelith falls back to rebuilding from the public Letterboxd 10M ratings dataset: /prep/fetch-letterboxd (~107 MB) then letterboxd, ~30 s of CPU. Same index, more bytes. A self-hoster is never stuck.
Override the location with REELITH_HOME, point at a bundle or mirror with REELITH_BUNDLE_URL, use a prebuilt index with REELITH_ARTIFACT_DIR, or set REELITH_NO_BOOTSTRAP=1 to get the old loud failure instead (useful in CI and offline runs).
The entry is identical everywhere — uvx reelith, stdio transport — because uvx resolves the package without you choosing a Python or a venv. Copy the row for your client.
claude mcp add reelith -- uvx reelith Claude Desktop — claude_desktop_config.json (Windows: %APPDATA%\Claude\, macOS: ~/Library/Application Support/Claude/, Linux: ~/.config/Claude/):
Cursor — ~/.cursor/mcp.json:
{ "servers": { "reelith": { "type": "stdio", "command": "uvx", "args": ["reelith"] } } } Codex CLI
codex mcp add reelith -- uvx reelith Gemini CLI — ~/.gemini/settings.json:
- id: reelith command: 'uvx' args: ['reelith'] Anything else that speaks MCP over stdio: the command is uvx, the args are ["reelith"]. That is the whole interface.
Do not have uv? Install it first: powershell -c "irm https://astral.sh/uv/install.ps1 | iex" (Windows) or curl -LsSf https://astral.sh/uv/install.sh | sh (macOS/Linux).
pip install reelith # compiles Rust; needs a toolchain reelith doctor Then use "command": "reelith" with no args. Prefer uvx: it needs no compiler and no venv.
uv sync # builds the Rust extension from source uv run pytest # 238 tests, no network needed The prep dependency group (dataset build only) is not installed by default: it is large and the server never imports it. Add it with uv sync --group prep when you build an artifact.
Try it against the committed synthetic fixture before building a real artifact:
uv run python examples/quickstart.py That drives all three tools over a real MCP client session — ingest a sample export, query, record feedback — and prints what comes back. No client to configure, no network, no API key. To use a real artifact instead:
The committed fixture is 200 synthetic films — enough to exercise every code path, not enough to recommend anything. For real use, build from a ratings dataset:
uv run --group prep python -m reelith.prep build \ --dataset \ --outdir data/artifacts/dev This produces three files, which travel together:
Expected scale: ~159k films × 64 dims ≈ 41 MB. See docs/FULL-BUILD.md for the full-size build and docs/OFFLINE-BUILD.md for a no-network build.
See docs/client-config.md. Short version: register reelith as a stdio MCP server, point REELITH_ARTIFACT_DIR at your artifact, and paste docs/SYSTEM-PROMPT.md into the client's custom instructions.
Anchors are film titles, not moods — the client LLM supplies the semantics. Titles outside the local index come back in missing_anchors with a reason (no_api_key, no_tmdb_result, no_proxy, network) so the client can say so honestly instead of guessing.
get_watch_history and get_index_info are read-only tools rather than resources: MCP clients that surface only tools cannot read a resource, and a client that had to open the SQLite file to answer "what did I watch last week?" was doing archaeology instead of asking.
Two more MCP surfaces, both read-only, for jobs that are not tool calls:
Resources are what a person can attach to a conversation; tools are what the model calls. Inspect engine state without burning a turn on a tool call.
Caveat on reelith://films/{slug}: the artifact carries year for only 22,289 of 138,016 films, and no genres, director or runtime at all. Those fields are null, not zero — the ratings dump does not include them.
src/reelith/ server.py MCP server, five tools context.py startup wiring: artifact, engine, state, policy, resolver prompts.py the system prompt (canonical copy) artifact.py artifact loading state.py SQLite: history, policy, trajectories, TMDB cache rl.py policy: S0, query blending, feedback updates, temperature oov.py out-of-vocabulary resolution + TMDB proxy imputation ingest/ zip parsing, scraping, pagination prep/ artifact build: ALS, dimensionality reduction, Hilbert keys crates/reelith-engine/ Rust: mmap vectors, Fenwick sampling, Hilbert ordering spec/ per-module specs tasks/ plan, task list, checkpoints Testing
uv run pytest # everything uv run pytest tests/server -q # MCP tools through a real client session cargo test --offline # Rust: sampling, Fenwick, Hilbert The test suite needs no network. Scraper tests use synthetic HTML fixtures that reproduce Letterboxd's documented markup conventions — they pin our parsers' behavior, but they were not recorded from the live site, so a future DOM change would not be caught by them. The parsers fail loudly rather than silently dropping rows.
Coverage is the artifact's vocabulary. Films outside it are resolved through TMDB proxies or reported missing; they are never invented.
Scraping is best-effort. Letterboxd has no public API and may change its markup. The zip export path is the stable fallback.
Embeddings are trained geometry, not semantics. A random-projection fallback replaces UMAP when umap-learn is unavailable; recommendations remain coherent but less sharp.
Single user, single process. stdio transport, one state database, no auth.
All 4 files in this release have provenance metadata.
mcp letterboxd recommendations model-context-protocol
Programming Language Python :: 3
Release files for reelith 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distributions (wheels)
Total release size: 1.2 MB
Release files / reelith-0.0.3.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Release files / reelith-0.0.3-cp311-abi3-win_amd64.whl
Security for reelith 0.0.3
All 4 files in this release have been uploaded with provenance metadata.
With provenance reelith-0.0.3.tar.gz Dec 1, 2026
With provenance reelith-0.0.3-cp311-abi3-win_amd64.whl Dec 1, 2026
Attestation for reelith-0.0.3.tar.gz
Attestation for reelith-0.0.3-cp311-abi3-win_amd64.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Dec 1, 2026 4 release files Full provenance
Dec 1, 2026 5 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




