Open-source project
ssrajadh/sentrysearch avatar
ssrajadh/sentrysearch

SentrySearch: a text query over video, with a 0.41 confidence gate

Semantic search over videos using Gemini Embedding 2 or Qwen3-VL.

4,594 stars441 forksPythonApache-2.0

At a glance

What is it?
SentrySearch chunks video into overlapping segments, embeds each chunk as video with Gemini, Alibaba DashScope or a local Qwen3-VL model, stores the vectors in a local ChromaDB database, and trims the top match into a clip. Five backends, several optional extras, a Python ceiling of 3.12, and a release history of one asset.
Who is it for?
Use SentrySearch when you have hours of footage and a specific thing to find in it, and when a chunk-and-embed index you can hold locally is better than tagging by hand. Do not use it as a general video player, as a real-time system, or as evidence of anything: the README names limitations and future work sections and the package is at version 0.1.0.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • ssrajadh/sentrysearch4,594 ★ · +72
Star history
Repository2026-09-272026-11-23
ssrajadh/sentrysearch4.5k4.6k

72 Stars in the last 57 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Chunks go in as video, the query goes in as text

The pipeline has five steps and no surprises in it.

SentrySearch splits your videos into overlapping chunks. Each chunk is embedded as video, through Google's Gemini Embedding API, Alibaba DashScope under the name `qwen-cloud`, or a local Qwen3-VL model. The vectors go into a local ChromaDB database.

When you search, your text query, or an image if you use search by image, is embedded into the same vector space and matched against the stored video embeddings. The top match is then trimmed from the original file and saved as a clip.

Two properties follow from that design. The database is local, so the index lives on your disk rather than in a hosted index, while the embedding step may not be local at all, because the default backend is a cloud API. And the unit of retrieval is a chunk, not a frame, which is why the chunk duration and overlap are the two options that matter most.

The saved artefact is a real clip cut from the source file, not a thumbnail or a timestamp, which is what makes the tool useful for pulling evidence out of long recordings.

init writes the key to .env and validates it with a real embedding

Setup starts with one command, and it does more than store a string.

bash
sentrysearch init

It prompts for your Gemini API key, writes it to `.env`, and validates it by running a test embedding. The sample session shows the sequence:

bash
$ sentrysearch init
Enter your Gemini API key (get one at https://aistudio.google.com/apikey): ****
Validating API key...
Setup complete. You're ready to go — run `sentrysearch index <directory>` to get started.

If a key is already configured, you are asked whether to overwrite it rather than being silently replaced.

The validation step is the part worth keeping. A key that is wrong, revoked or from the wrong project fails at setup instead of failing halfway through indexing a directory of footage.

The README also adds a tip that is really a warning: set a spending limit at aistudio.google.com/billing to prevent accidental overspending. The cost model is per chunk, and a large library multiplied by default settings is not a small number.

If you would rather not use the prompt, the manual route is copying `.env.example` to `.env` and adding the key yourself. That template contains one line, `GEMINI_API_KEY=your-api-key-here`.

Python 3.11 or 3.12, because PyTorch wheels lag

Installation runs through uv, and the version constraint is enforced rather than suggested.

Installing uv on macOS or Linux is a curl pipe:

bash
curl -LsSf https://astral.sh/uv/install.sh | sh

On Windows it is the PowerShell equivalent:

powershell
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Then the tool install:

bash
git clone https://github.com/ssrajadh/sentrysearch.git
cd sentrysearch
uv tool install .

The constraint is that the project requires Python 3.11 or 3.12, and the reason given is that PyTorch wheels do not yet support 3.13 and later. The manifest agrees, declaring `requires-python = ">=3.11,<3.13"`.

If your default Python is newer, the README gives the fix rather than leaving you to guess: install a managed 3.12 and pin the tool install to it.

bash
uv python install 3.12
uv tool install --python 3.12 .

ffmpeg is the other external requirement, needed for both chunking and trimming. If it is not on the system, the bundled `imageio-ffmpeg` is used automatically, which is a convenience and also a reason the install pulls that dependency.

Indexing downscales to 480 pixels and 5 frames per second

Indexing a directory is one command:

bash
sentrysearch index /path/to/footage

The output shows the granularity it works at, one line per chunk:

bash
$ sentrysearch index /path/to/video/footage
Indexing file 1/3: front_2024-01-15_14-30.mp4 [chunk 1/4]
Indexed 12 new chunks from 3 files. Total: 12 chunks from 3 files.

The options are where the design shows. `--chunk-duration 30` sets seconds per chunk and `--overlap 5` sets the overlap between them, which together decide whether an event that straddles a boundary is findable. `--target-resolution 480` sets a target height in pixels and `--target-fps 5` a target frame rate, so by default the frames sent for embedding are much smaller than the source. `--no-preprocess` sends raw chunks instead.

Two options change what gets indexed rather than how. `--no-skip-still` embeds chunks with no visual change, which matters for a static camera feed where the skip heuristic would otherwise discard everything. And `--rpm 10` caps requests per minute against the cloud API, which is the setting that decides how long indexing a large library takes.

The top result is scored, and below 0.41 it asks before trimming

Search returns ranked matches with a similarity score and a time range, then trims the best one:

bash
$ sentrysearch search "red truck running a stop sign"
  #1 [0.87] front_2024-01-15_14-30.mp4 @ 02:15-02:45
  #2 [0.74] left_2024-01-15_14-30.mp4 @ 02:10-02:40

Saved clip: ./match_front_2024-01-15_14-30_02m15s-02m45s.mp4

The confidence gate is the part that makes this safe to use. The default threshold is 0.41, or 0.35 on the MLX backend, and below it you are asked before anything is cut:

code
No confident match found (best score: 0.28). Show results anyway? [y/N]:

With `--no-trim` the prompt is replaced by a note next to the low-confidence results, which is the non-interactive path.

The other options widen or reshape the result set. `--results N` sets how many are shown, `--save-top N` saves that many clips instead of only the best, `--threshold 0.5` moves the cutoff, `--output-dir DIR` chooses where clips land, and `--rerank` asks a vision language model to re-rank the candidates before trimming, which is the option for when the embedding ranking is close.

`--dedupe` deserves its own mention. It sets how similar a result can be to a higher-ranked pick before it is dropped, on by default, so overlapping chunks of the same moment do not fill the list with near-identical clips.

Four backends, five extras, and a PyPI compromise in a comment

The manifest's optional dependencies are where the engineering decisions are written down, and the comments are unusually honest.

The base install is small: `click`, `python-dotenv`, `chromadb`, `google-genai`, `imageio-ffmpeg` and `protobuf`.

The `local` extra adds torch, torchvision, `transformers>=5.4`, accelerate, qwen-vl-utils and torchcodec. The transformers floor has a reason spelled out: 5.3.0 drops the per-frame video grid expansion in `get_rope_index`, so multi-frame chunks raise a StopIteration, and that is fixed in 5.4.0. `local-quantized` is the same set plus bitsandbytes.

The `litellm` extra is pinned at `litellm>=1.101.0`, and the comment says the floor is the release the backend was tested against and that it keeps installs clear of 1.82.7 and 1.82.8, described as the two releases compromised on PyPI. A dependency floor chosen to avoid known bad versions is worth noticing.

The `mlx` extra is Apple Silicon only, and its comment explains why it exists separately: MLX quantizes on Metal, which the PyTorch path cannot do because its only quantization route is bitsandbytes, which is CUDA-only. The result is that the 2B model runs at 4-bit in roughly 1.8 GB with no measured loss of retrieval accuracy.

Version 0.1.0, one asset release, and a warning about mirrors

The package is at version 0.1.0, and the release history is almost empty. The single release is `benchmark-clip-v1`, and its own title says it is an asset only, not a software release, published on 2026-05-17.

So there is no version history to consult and no release cadence to plan around. The last push to the repository was on 2026-09-29.

The README opens with an unusual notice for a project this size: github.com/ssrajadh/sentrysearch is the only official home of SentrySearch, other sites republishing or mirroring it are not affiliated with or endorsed by the maintainer, and you should always download from the repository. That is a warning about impersonation rather than about mirrors as such.

The rest of the tree is conventional: `sentrysearch/` for the package, `tests/` alongside it, `docs/` for the demo files, `pyproject.toml`, `uv.lock`, `CONTRIBUTING.md` and both `README.md` and `README.zh.md`.

The table of contents also lists sections including search by image, a Tesla metadata overlay, stitching with SentryMerge, redacting with SentryBlur, a cost section, a known-warnings section marked harmless, and a limitations and future work section.

Editorial conclusion

Use SentrySearch when you have hours of footage and a specific thing to find in it, and when a chunk-and-embed index you can hold locally is better than tagging by hand. Do not use it as a general video player, as a real-time system, or as evidence of anything: the README names limitations and future work sections and the package is at version 0.1.0. Before you index a large library, check four things: that your Python is 3.11 or 3.12, because the manifest declares `>=3.11,<3.13` and PyTorch wheels lag behind; which backend you will use, since the default Gemini path spends money per chunk; whether ffmpeg is present, because chunking and trimming need it and only falls back to the bundled `imageio-ffmpeg`; and that you have read the `--dedupe` default, because overlapping chunks of one moment otherwise fill the result list.

Frequently asked questions

How do I install SentrySearch?

Install uv, then clone and install the tool. On macOS or Linux uv is installed with `curl -LsSf https://astral.sh/uv/install.sh | sh`, then `git clone https://github.com/ssrajadh/sentrysearch.git`, `cd sentrysearch` and `uv tool install .`. On Windows the uv install uses `powershell -c "irm https://astral.sh/uv/install.ps1 | iex"`.

Why does SentrySearch require Python 3.11 or 3.12?

Because PyTorch wheels do not yet support 3.13 and later, and the local backends need PyTorch. The manifest declares `requires-python = ">=3.11,<3.13"`. If your default Python is newer, the README says to install a managed 3.12 with `uv python install 3.12` and pin the tool install with `uv tool install --python 3.12 .`.

Do I need a Gemini API key to use SentrySearch?

Only for the default Gemini backend. `sentrysearch init` prompts for the key, writes it to `.env` and validates it with a test embedding. You can skip it entirely with `--backend local`, `--backend mlx`, or `--backend qwen-cloud` with `DASHSCOPE_API_KEY` in `.env`, and you can also copy `.env.example` to `.env` and add the key by hand.

How does SentrySearch decide whether a match is good enough?

The best result's similarity score is compared to a confidence threshold, which defaults to 0.41 and to 0.35 on the MLX backend. Below it you are prompted before the clip is trimmed, with a message like `No confident match found (best score: 0.28). Show results anyway? [y/N]:`. `--no-trim` replaces the prompt with a note, and `--threshold` changes the cutoff.

Can SentrySearch run without sending footage to a cloud API?

Yes. The `local` extra adds torch, transformers, qwen-vl-utils and torchcodec for a local Qwen3-VL model, `local-quantized` adds bitsandbytes for CUDA quantization, and the `mlx` extra is Apple Silicon only and quantizes on Metal so the 2B model runs at 4-bit in roughly 1.8 GB. There are also `qwen-cloud` for Alibaba DashScope and `litellm` for AI gateways.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. Releases
  5. ssrajadh/sentrysearch on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/ssrajadh-sentrysearch.svg)](https://hysenlabs.com/projects/ssrajadh-sentrysearch)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/ssrajadh-sentrysearch.svg)](https://hysenlabs.com/projects/ssrajadh-sentrysearch)

Was this useful?