reelith
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.
How it works
your mood
│
▼
client LLM (BYO: Claude Desktop, ...) ← semantic router, no recommendations of its own
│ MCP over stdio, three 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(stateS₀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_dislikemoves_t;reject_seen_itonly masks.
Requirements
- Python 3.11+
- uv
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.
Install (users)
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/:
| File | Size | What it is |
|---|---|---|
embeddings.bin |
34 MB | 138,016 films × 64 floats. The actual vectors. |
films.sidecar.parquet |
6.1 MB | Per-film metadata: slug, title, and year for the subset that has one. |
meta.json |
300 B | Dimensions and build provenance, used for integrity checks. |
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).
Install (per client)
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 Code
claude mcp add reelith -- uvx reelith
Claude Desktop — claude_desktop_config.json (Windows:
%APPDATA%\Claude\, macOS: ~/Library/Application Support/Claude/, Linux:
~/.config/Claude/):
{ "mcpServers": { "reelith": { "command": "uvx", "args": ["reelith"] } } }
Restart Claude Desktop afterwards.
Cursor — ~/.cursor/mcp.json:
{ "mcpServers": { "reelith": { "command": "uvx", "args": ["reelith"] } } }
VS Code — .vscode/mcp.json:
{ "servers": { "reelith": { "type": "stdio", "command": "uvx", "args": ["reelith"] } } }
Codex CLI
codex mcp add reelith -- uvx reelith
Gemini CLI — ~/.gemini/settings.json:
{ "mcpServers": { "reelith": { "command": "uvx", "args": ["reelith"] } } }
DeepSeek Harness — ~/.dsh/profiles/<profile>/cordis.patch.yml:
- 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).
Without uvx
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.
Develop
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:
uv run python examples/quickstart.py --artifact data/artifacts/dev --state data/demo.db
To run the actual server (what a client launches), use uv run reelith with the
environment variables from docs/client-config.md.
Build a real artifact
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 <huggingface-dataset> \
--outdir data/artifacts/dev
This produces three files, which travel together:
| File | Contents |
|---|---|
embeddings.bin |
LREC magic, version, N, dim, then N×dim float32 unit vectors |
films.sidecar.parquet |
slug, title, year, runtime, director, genres, hilbert_rank (several are empty: see below) |
meta.json |
build parameters, dim, row count, checksums |
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.
Connect a client
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.
The three tools
| Tool | Purpose |
|---|---|
ingest_letterboxd_data(username | local_zip_path) |
Load history from a public profile or export zip. Exactly one argument. |
query_embedding_space(positive_anchor_movies, ...) |
Recommend films near the anchors. Supports k, negatives, director/year/runtime filters, include_watched. |
record_rl_feedback(movie_id, feedback_type) |
accept / reject_dislike / reject_seen_it. |
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.
Prompts and resources
Two more MCP surfaces, both read-only, for jobs that are not tool calls:
| Surface | Name | What it does |
|---|---|---|
| prompt | recommend |
Takes a mood, expands it into the "find anchors, then query" instruction. |
| prompt | onboard |
The setup flow: ask for a username or export zip, then ingest. |
| resource | reelith://index |
Films, dimensions, ratings and history size — the index's provenance. |
| resource | reelith://history |
Your films with the rating that counts, newest first. |
| resource | reelith://films/{slug} |
One film record. |
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.
Layout
src/reelith/
server.py MCP server, three 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.
Known limits
- 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-learnis unavailable; recommendations remain coherent but less sharp. - Single user, single process. stdio transport, one state database, no auth.
License
Not yet chosen.
Metadata
Release files for reelith 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| reelith-0.0.2.tar.gz | 56.8 kB | With provenance | Details for reelith-0.0.2.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| reelith-0.0.2-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details for reelith-0.0.2-cp311-abi3-win_amd64.whl |
| reelith-0.0.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ x86-64 | Details for reelith-0.0.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| reelith-0.0.2-cp311-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 10.12+ x86-64, macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64) | Details for reelith-0.0.2-cp311-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
Total release size: 1.2 MB
Release files / reelith-0.0.2.tar.gz
| Download URL | reelith-0.0.2.tar.gz |
|---|---|
| Size | 56.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d86b9e62d48a373dae15101d8bff8575d4d236f09d8474105dcdafc1078dd65
|
|
BLAKE2b-256 checksum How to use checksums |
d778088f02b809770689a539d30b6f2680056729e1147671e311ad0b47ee30f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
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 Publish Attestation
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.
Transparency logRelease files / reelith-0.0.2-cp311-abi3-win_amd64.whl
| Download URL | reelith-0.0.2-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 220.8 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
bb5573c47eadcfc91f7d6fd9337f2d6fef1b99128595b3dc1343bbf04bce41e2
|
|
BLAKE2b-256 checksum How to use checksums |
c668d085849ded0662fdac0a3e8b38a837da03419e8e3108b7e894ee268f3257
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
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 Publish Attestation
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.
Transparency logRelease files / reelith-0.0.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | reelith-0.0.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 354.9 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
76bdb01a8163bdd74c7ab01a917160d4133436da3ed2137a49460a262518fa73
|
|
BLAKE2b-256 checksum How to use checksums |
6e57e9dc90c77899b963a8245f9c41b90a5d2b251a4286b2f910651a4ab08da2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
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 Publish Attestation
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.
Transparency logRelease files / reelith-0.0.2-cp311-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
| Download URL | reelith-0.0.2-cp311-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
|---|---|
| Size | 567.8 kB |
| Tags | CPython 3.11 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a6989cc2aaaf27715908688a9561ec201aac97d2194602421bf618fcdf9a9af5
|
|
BLAKE2b-256 checksum How to use checksums |
b4559f743a142b06876ffba89af97503a542f8d64e8d8475c04b9a3eabc42c41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
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 Publish Attestation
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.
Transparency logSecurity for reelith 0.0.2
Provenance
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.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for reelith-0.0.2.tar.gz
PyPI Publish Attestation
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.
Transparency logA 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.