Metadata-Version: 2.5
Name: streamembed
Version: 0.3.0
Summary: Search your own screen history by describing what you saw, from screenshots, on your machine
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: embeddings,on-device,retrieval,screen-history,screenshots
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.12
Requires-Dist: huggingface-hub>=0.30
Requires-Dist: mss<11,>=9
Requires-Dist: numpy>=2.2
Requires-Dist: pillow>=11
Requires-Dist: pyobjc-framework-quartz>=10; sys_platform == 'darwin'
Requires-Dist: qwen-vl-utils==0.0.14
Requires-Dist: safetensors>=0.4
Requires-Dist: torch==2.8.0
Requires-Dist: torchvision==0.23.0
Requires-Dist: transformers==5.17.0
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == 'dev'
Provides-Extra: hnsw
Requires-Dist: chroma-hnswlib==0.7.6; extra == 'hnsw'
Description-Content-Type: text/markdown

# StreamEmbed

Search your own screen history by describing what you saw. StreamEmbed indexes the screenshots you already have and keeps capturing your screen as you work, then finds a past screen from a sentence such as "the flight search page to Denver". Everything runs on your machine.

## Installation

```bash
uv venv && source .venv/bin/activate
uv pip install streamembed

# or only the `streamembed` command, in an environment of its own
uv tool install streamembed

# with the "hnsw" index type (Python 3.12)
uv pip install "streamembed[hnsw]"
```

Python 3.12 or later. Tested on macOS (Apple silicon), Ubuntu 24.04 (X11; Wayland is not supported) and Windows Server 2025 (x86-64, CPU). The first run downloads the model (about 4 GB). On macOS, allow Screen Recording for your terminal or Python when asked, then run `streamembed start` again. On Windows, the `hnsw` extra needs the Microsoft C++ Build Tools: it has no prebuilt wheel there.

## Quick Start

From a terminal:

```bash
streamembed start --folder ~/Desktop                   # index the screenshots there, then capture every 5 s, now and after every login
streamembed search "the flight search page to Denver"  # prints the matches and opens a results page
streamembed status                                     # also: pause, resume, stop
streamembed config set interval 10                     # change a default
```

`--folder` is the folder your screenshots are saved in: `~/Desktop` on macOS (unless you changed it in the Screenshot app), `~/Pictures/Screenshots` on Windows and Ubuntu. Every image in it and in its subfolders is indexed. macOS protects `~/Desktop`: if the terminal (or, for `start`, the service's Python) has no access to it, indexing stops with a permission error; allow it in System Settings > Privacy & Security > Files and Folders.

Or, instead of `streamembed start`, from Python. It cannot write to an index that `streamembed start` is capturing into (stop that first, or use another `index_dir`); `query_index` and `visualize_results` work alongside it.

```python
import streamembed as se

se.build_index_from_directory("~/Desktop")                # screenshots you already have
capture = se.build_index_from_now()                       # capture the screen every 5 s, in the background

results = se.query_index("the flight search page to Denver")
se.visualize_results(results)                             # an HTML page with each match and the screens before and after it
capture.stop()
```

`streamembed config` lists every setting, its value and where the value comes from. `streamembed COMMAND --help` lists every option of a command.

The index type (`flat`, `binary`, `hnsw`, `ivf` or `pq`) is a setting, not an install choice: `streamembed config set index_type pq` switches an existing index without indexing again. Only `hnsw` needs the extra above.

Vectors and metadata stay in the index folder (owner-only, unencrypted). Live captures are written to `capture_dir`, by default `captures/` in the index folder; screenshots indexed from a folder are not copied. On macOS, nothing is captured while the screen is locked or a password manager or private browsing window is in front; on Linux and Windows these checks are not implemented, and everything on screen is captured.

The full reference (every command and function, the settings, the index folder, the index types and the privacy notes) is `README.md` in the source distribution: under Download files on this page (https://pypi.org/project/streamembed/#files), download `streamembed-VERSION.tar.gz`; after `tar xzf streamembed-VERSION.tar.gz` it is `streamembed-VERSION/README.md`.

## License

Apache-2.0. The model weights are downloaded from Hugging Face under their own licenses.
