Repository navigation
Smart Search
Smart Search lets people find things in Moonfin by describing them instead of typing the exact title. Things like:
- "jim carey movie about a mask"
- "90s movie about a kid pulled into a board game"
- "matt damon movies from the 2000s"
- "electronic music duo from the 90s"
- "the guy who played iron man"
The apps show two extra rows above the normal search results. Smart Search has what matched in your library, and Smart Search on Seerr has titles you don't have yet, ready to request. It's off by default and works on Jellyfin, Emby and Moonbase for Plex.
- It all runs on your server. Moonbase runs a small AI model on the server's CPU. There's no GPU to set up, no extra software to install, and what people type never leaves your server.
- What it searches: movies, shows, the actors and directors credited on them, music artists and albums, and books. It matches on plot, genres, keywords and cast. Simple rules pick out years ("90s", "after 2010"), how recent ("new", "latest", "upcoming"), what kind of thing someone wants ("movies", "band", "actor") and the names of people, typos included.
- Seerr suggestions: with the server-wide TMDB key on the Integrations tab, Moonbase also indexes the 10,000 most popular movies and 5,000 most popular shows on TMDB, plus the most popular from the past year and the year ahead, so new releases and upcoming titles show up before they've had time to collect votes. Titles you already have are left out of that row, and it only shows when Seerr is set up.
- Permissions: each person only sees library items their account can access, and parental limits apply to both rows.
- Searches of one word use the normal search only, so typing a title works the same as before.
The Search model setting on the Smart Search tab has two choices.
| English | Multilingual | |
|---|---|---|
| Model | all-MiniLM-L6-v2 | multilingual-e5-small |
| Understands | English | About 100 languages, English included |
| Download | 91 MB | 488 MB |
| Memory while on | About 120 MB | About 175 MB |
| First build | The faster one | About two and a half times as long |
| Nightly updates | Under a minute | Under a minute |
| Each search | Under 0.1 seconds | Under 0.1 seconds |
English is the default. Multilingual matched English searches just as well in testing, and found the right title for German, Spanish and French descriptions far more often. Pick it if your users search in other languages and your server can spare the longer first build. Only the first build, and the rebuild after switching models, takes longer. The nightly update only indexes what changed, so it stays quick with either model. Only the picked model is kept on disk. Changing it rebuilds the index, and until that finishes searches show the normal results.
- Open the Moonbase page, go to the Smart Search tab, tick Enable smart search, pick a Search model and click Save.
- For Seerr suggestions, paste a Server-wide TMDB API Key on the Integrations tab and set up Seerr. See Seerr Setup.
- The first build starts on its own with the first smart search, or you can start Moonfin Smart Search Index under Dashboard > Scheduled Tasks yourself. It downloads the model from huggingface.co once, checks it against a fixed hash, then indexes your library and the TMDB catalog.
- Restart the apps so they see the feature is on.
Until the library part of the first build is done, searches only show the normal results. The Seerr row fills in once the TMDB catalog is done, which takes longer.
After that the index task runs at every server start and every night at 3:00, and only indexes what's new or changed.
These are for a server with about 800 movies and shows, plus their cast, music and books, using the English model.
| Memory | About 120 MB while it's on. The model is 47 MB and the Seerr catalog 60 MB, whatever the size of your library. The library index adds about 2 MB per 1,000 titles and people. Multilingual adds about 55 MB |
| Disk | About 135 MB in the smart-search folder, or about 535 MB with Multilingual (see Data Locations) |
| First build | 15 to 30 minutes on a desktop CPU, about half of it downloading from TMDB |
| Later builds | Under a minute, since only new or changed items are indexed |
| Each search | Under 0.1 seconds on the server |
| While it's off | Nothing. Nothing is downloaded, nothing is loaded, and the task stops straight away |
Building uses half your CPU cores, so playback and transcoding keep the other half. Turning it off frees the memory at the next server restart.
Smart Search works on ARM boards like the Raspberry Pi with nothing extra to install. It's just slower to build. Roughly:
| Raspberry Pi 5 | Raspberry Pi 4 | |
|---|---|---|
| First build, English | About half an hour | About an hour |
| First build, Multilingual | About an hour | 2 to 3 hours |
| Each search | About 0.1 seconds | About 0.2 seconds |
Some tips:
- Memory: 4 GB or more is comfortable. On a 2 GB board it fits, but keep an eye on memory if the server also transcodes, and stay with English. On a 1 GB board, leave it off.
- Turn it on in the evening and let the first build run overnight. After that, the nightly run takes a few minutes at most.
- The Seerr catalog is most of the work. Without a server-wide TMDB key it's skipped, which cuts the first build to the library part and saves the 60 MB. That also turns off the other features that need the key, like TMDB ratings and the seasonal row on Emby.
- The English model only understands English. With Multilingual, the year and kind rules ("90s", "movies", "band") are still English, and the Seerr catalog's text is English, so other languages match a little less well than English does.
- "New" means out in the last 12 months and "upcoming" means not out yet, and everything else is left out. "New" only counts at the start of a search, like "new sci-fi movies", since titles like "A New Hope" use the word too. A show counts from its premiere, so long-running shows aren't new. Library items only have a year, so in the library row "new" means last year or this year, and an "upcoming" search only fills the Seerr row.
- Asking for "the director of" a movie lists the director along with the cast, not always first.
- On Emby, library items have no TMDB keywords, so library matches lean on plot, genres and cast. The Seerr row is the same on both servers.
- The server needs to reach huggingface.co for the model download, and api.themoviedb.org for the Seerr catalog.
If the rows don't show up, see Common Problems.
For server admins
- Installation
- Admin Guide
- Seerr Setup
- Calendar
- Smart Search
- Watch Parties
- Common Problems
- Retro Games
- Themes
Reference
For developers