streamembed 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. streamembed-0.2.0/PKG-INFO +77 -0
  2. streamembed-0.2.0/PYPI.md +48 -0
  3. streamembed-0.2.0/README.md +180 -0
  4. {streamembed-0.1.0 → streamembed-0.2.0}/pyproject.toml +9 -3
  5. streamembed-0.2.0/src/streamembed/__init__.py +10 -0
  6. streamembed-0.2.0/src/streamembed/__main__.py +6 -0
  7. streamembed-0.2.0/src/streamembed/ann.py +347 -0
  8. streamembed-0.2.0/src/streamembed/api.py +333 -0
  9. streamembed-0.2.0/src/streamembed/capture.py +183 -0
  10. streamembed-0.2.0/src/streamembed/cli.py +154 -0
  11. streamembed-0.2.0/src/streamembed/config.py +135 -0
  12. streamembed-0.2.0/src/streamembed/defaults.toml +32 -0
  13. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/encoder.py +16 -10
  14. streamembed-0.2.0/src/streamembed/index.py +232 -0
  15. streamembed-0.2.0/src/streamembed/service.py +260 -0
  16. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/static/results.html +53 -6
  17. streamembed-0.2.0/src/streamembed/timeparse.py +164 -0
  18. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/visualize.py +5 -2
  19. streamembed-0.2.0/tests/conftest.py +9 -0
  20. streamembed-0.2.0/tests/test_api.py +609 -0
  21. streamembed-0.2.0/tests/test_config.py +66 -0
  22. streamembed-0.1.0/PKG-INFO +0 -122
  23. streamembed-0.1.0/README.md +0 -95
  24. streamembed-0.1.0/src/streamembed/__init__.py +0 -7
  25. streamembed-0.1.0/src/streamembed/api.py +0 -205
  26. streamembed-0.1.0/src/streamembed/capture.py +0 -88
  27. streamembed-0.1.0/src/streamembed/index.py +0 -138
  28. streamembed-0.1.0/tests/test_api.py +0 -145
  29. {streamembed-0.1.0 → streamembed-0.2.0}/.gitignore +0 -0
  30. {streamembed-0.1.0 → streamembed-0.2.0}/.hgignore +0 -0
  31. {streamembed-0.1.0 → streamembed-0.2.0}/LICENSE +0 -0
  32. {streamembed-0.1.0 → streamembed-0.2.0}/NOTICE +0 -0
  33. {streamembed-0.1.0 → streamembed-0.2.0}/examples/main.py +0 -0
  34. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/engine/__init__.py +0 -0
  35. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/engine/config.py +0 -0
  36. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/engine/engine.py +0 -0
  37. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/engine/llm.py +0 -0
  38. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/engine/macs.py +0 -0
  39. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/engine/model.py +0 -0
  40. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/engine/qwen_embedder.py +0 -0
  41. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/engine/spatial.py +0 -0
  42. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/engine/temporal.py +0 -0
  43. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/engine/vit.py +0 -0
  44. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/gate.py +0 -0
  45. {streamembed-0.1.0 → streamembed-0.2.0}/src/streamembed/models.py +0 -0
  46. {streamembed-0.1.0 → streamembed-0.2.0}/tests/test_models.py +0 -0
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.5
2
+ Name: streamembed
3
+ Version: 0.2.0
4
+ Summary: Search your own screen history by describing what you saw, from screenshots, on your machine
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ License-File: NOTICE
8
+ Keywords: embeddings,on-device,retrieval,screen-history,screenshots
9
+ Classifier: Operating System :: MacOS
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
13
+ Requires-Python: >=3.12
14
+ Requires-Dist: huggingface-hub>=0.30
15
+ Requires-Dist: mss>=9
16
+ Requires-Dist: numpy>=2.2
17
+ Requires-Dist: pillow>=11
18
+ Requires-Dist: pyobjc-framework-quartz>=10; sys_platform == 'darwin'
19
+ Requires-Dist: qwen-vl-utils==0.0.14
20
+ Requires-Dist: safetensors>=0.4
21
+ Requires-Dist: torch==2.8.0
22
+ Requires-Dist: torchvision==0.23.0
23
+ Requires-Dist: transformers==5.17.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest>=8; extra == 'dev'
26
+ Provides-Extra: hnsw
27
+ Requires-Dist: chroma-hnswlib==0.7.6; extra == 'hnsw'
28
+ Description-Content-Type: text/markdown
29
+
30
+ # StreamEmbed
31
+
32
+ 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 page I saw yesterday". Everything runs on your machine.
33
+
34
+ ## Installation
35
+
36
+ ```bash
37
+ uv venv && source .venv/bin/activate
38
+ uv pip install streamembed
39
+
40
+ # or only the `streamembed` command, in an environment of its own
41
+ uv tool install streamembed
42
+
43
+ # with the "hnsw" index type (Python 3.12)
44
+ uv pip install "streamembed[hnsw]"
45
+ ```
46
+
47
+ Python 3.12 or later. Tested on macOS with Apple silicon; Linux (X11) and Windows are supported but not yet tested on real machines. The first run downloads the model (about 4 GB). On macOS, allow Screen Recording for your terminal or Python when asked.
48
+
49
+ ## Quick Start
50
+
51
+ From a terminal:
52
+
53
+ ```bash
54
+ streamembed start --folder ~/Pictures/Screenshots # index your screenshots, then capture every 5 s, now and after every login
55
+ streamembed search "the flight page I saw yesterday" # prints the matches and opens a results page
56
+ streamembed status # also: pause, resume, stop
57
+ streamembed config set interval 10 # change a default
58
+ ```
59
+
60
+ From Python:
61
+
62
+ ```python
63
+ import streamembed as se
64
+
65
+ se.build_index_from_directory("~/Pictures/Screenshots") # screenshots you already have
66
+ capture = se.build_index_from_now() # capture the screen every 5 s, in the background
67
+
68
+ results = se.query_index("the flight page I saw yesterday")
69
+ se.visualize_results(results) # an HTML page with each match and the screens before and after it
70
+ capture.stop()
71
+ ```
72
+
73
+ Time words in a question ("yesterday", "this morning", "어제", "昨天") limit the search to that time. `streamembed config` lists every setting and its default.
74
+
75
+ ## License
76
+
77
+ Apache-2.0. The model weights are downloaded from Hugging Face under their own licenses.
@@ -0,0 +1,48 @@
1
+ # StreamEmbed
2
+
3
+ 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 page I saw yesterday". Everything runs on your machine.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ uv venv && source .venv/bin/activate
9
+ uv pip install streamembed
10
+
11
+ # or only the `streamembed` command, in an environment of its own
12
+ uv tool install streamembed
13
+
14
+ # with the "hnsw" index type (Python 3.12)
15
+ uv pip install "streamembed[hnsw]"
16
+ ```
17
+
18
+ Python 3.12 or later. Tested on macOS with Apple silicon; Linux (X11) and Windows are supported but not yet tested on real machines. The first run downloads the model (about 4 GB). On macOS, allow Screen Recording for your terminal or Python when asked.
19
+
20
+ ## Quick Start
21
+
22
+ From a terminal:
23
+
24
+ ```bash
25
+ streamembed start --folder ~/Pictures/Screenshots # index your screenshots, then capture every 5 s, now and after every login
26
+ streamembed search "the flight page I saw yesterday" # prints the matches and opens a results page
27
+ streamembed status # also: pause, resume, stop
28
+ streamembed config set interval 10 # change a default
29
+ ```
30
+
31
+ From Python:
32
+
33
+ ```python
34
+ import streamembed as se
35
+
36
+ se.build_index_from_directory("~/Pictures/Screenshots") # screenshots you already have
37
+ capture = se.build_index_from_now() # capture the screen every 5 s, in the background
38
+
39
+ results = se.query_index("the flight page I saw yesterday")
40
+ se.visualize_results(results) # an HTML page with each match and the screens before and after it
41
+ capture.stop()
42
+ ```
43
+
44
+ Time words in a question ("yesterday", "this morning", "어제", "昨天") limit the search to that time. `streamembed config` lists every setting and its default.
45
+
46
+ ## License
47
+
48
+ Apache-2.0. The model weights are downloaded from Hugging Face under their own licenses.
@@ -0,0 +1,180 @@
1
+ # StreamEmbed
2
+
3
+ Search your own screen history by describing what you saw. StreamEmbed indexes screenshots, from a folder or from your screen as you work, and finds a past screen from a sentence. Everything runs on your machine.
4
+
5
+ It embeds the pixels with Qwen3-VL-Embedding-2B, and encodes screenshots as a stream so that this keeps up on a laptop: blocks that repeat a neighbor are skipped, and the keys and values of blocks that did not change are reused from the previous frame.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ uv venv && source .venv/bin/activate
11
+ uv pip install streamembed
12
+
13
+ # or only the `streamembed` command, in an environment of its own
14
+ uv tool install streamembed
15
+
16
+ # with the "hnsw" index type (Python 3.12)
17
+ uv pip install "streamembed[hnsw]"
18
+ ```
19
+
20
+ Python 3.12 or later. Tested on macOS with Apple silicon; Linux (X11) and Windows are supported but not yet tested on real machines. The first run downloads the model (about 4 GB). On macOS, allow Screen Recording for your terminal or Python when asked.
21
+
22
+ ## Quick Start
23
+
24
+ From a terminal:
25
+
26
+ ```bash
27
+ streamembed start --folder ~/Pictures/Screenshots # index your screenshots, then capture every 5 s, now and after every login
28
+ streamembed search "the flight page I saw yesterday" # prints the matches and opens a results page
29
+ streamembed status # also: pause, resume, stop
30
+ streamembed config set interval 10 # change a default
31
+ ```
32
+
33
+ From Python:
34
+
35
+ ```python
36
+ import streamembed as se
37
+
38
+ se.build_index_from_directory("~/Pictures/Screenshots") # screenshots you already have
39
+ capture = se.build_index_from_now() # capture the screen every 5 s, in the background
40
+
41
+ results = se.query_index("the flight page I saw yesterday")
42
+ se.visualize_results(results) # an HTML page with each match and the screens before and after it
43
+ capture.stop()
44
+ ```
45
+
46
+ Time words in a question ("yesterday", "this morning", "어제", "昨天") limit the search to that time. `streamembed config` lists every setting and its default.
47
+
48
+ ## Reference
49
+
50
+ `examples/main.py` is a complete script.
51
+
52
+ | Function | What it does |
53
+ |---|---|
54
+ | `available_index_types()` | `["flat", "binary", "hnsw", "ivf", "pq"]` |
55
+ | `available_models()` | Model names: those in the model repo, then the built-in base models |
56
+ | `configure(index_dir, index_type, model, models_repo, device, width)` | Where the index lives (default `~/streamembed_index`, or `$STREAMEMBED_INDEX`), the index type and the model. `width` (default 1280): wider screenshots are shrunk to it, narrower ones are left as they are. Optional |
57
+ | `build_index_from_directory(directory, interval=5.0, skip_unchanged=True)` | Index screenshots you already have. Each one's time comes from its file name (macOS screenshot names, Unix times, dates), else EXIF, else the file time. Each display (the number after the time in the name, such as `_1` or ` (2)`, and the image size) is its own stream, with at most one screenshot every `interval` seconds (None: all). Unchanged screens are skipped unless `skip_unchanged=False`. Ctrl-C stops it; running it again continues after the last indexed screenshot |
58
+ | `build_index_from_now(interval, duration=None, block=False, monitors="primary", skip_unchanged=True)` | Capture the screen every `interval` seconds, in the background. `monitors`: `"primary"`, `"all"` or display numbers (1 = primary); each display is its own stream. Unchanged screens are skipped unless `skip_unchanged=False`. Returns a `Capture` with `stop()`, `pause()`, `resume()`, `wait()`, `stats` |
59
+ | `query_index(query, top_k, since=None, until=None)` | `Result`s with score, time, the stored image path and, for folder screenshots, the original file. A match within 30 s of a better one is dropped. A time phrase in the question ("yesterday", "this morning", "last week", "3 days ago", "Monday", "어제", "오늘 오후", "지난주", "11월 3일", "昨天", "上周", "三天前") is taken out of it and limits the search to that time; `since`/`until` set the window directly |
60
+ | `visualize_results(results)` | A self-contained HTML page. It shows the best 10 and lets you pick dates (or a from/to range) to see the best results from then; pass more results (`query_index(..., top_k=100)`, as `streamembed search` does) to have more to pick from. Each result opens full size with the frames before and after it; arrow keys step through time |
61
+ | `pause()`, `resume()`, `is_paused()` | Pause capturing into the index, in every process (the background service too) |
62
+
63
+ Screens that did not change are not stored again: a capture is encoded when more than 10 % of its kept blocks changed since the last stored one, or 30 s later if anything changed (the paper's change gate).
64
+
65
+ ### Settings
66
+
67
+ Every option has a default, set by us in `defaults.toml` in the package. Change one for good with `streamembed config set KEY VALUE` (or `se.set_config(KEY=VALUE)`); it is kept in your own file (`streamembed config path`), and `streamembed config reset KEY` goes back to the default. A value given to a function or a command applies to that call only and takes precedence; then `$STREAMEMBED_INDEX` / `$STREAMEMBED_MODELS`, then your file, then the defaults. `streamembed config` lists every setting and where its value comes from. The background capture reads them when it starts (`streamembed start` again to apply a change).
68
+
69
+ | Setting | Default | What it does |
70
+ |---|---|---|
71
+ | `index_dir` | `~/streamembed_index` | The index folder |
72
+ | `index_type` | `flat` | `flat` or `binary` |
73
+ | `model`, `models_repo`, `device` | `qwen3-vl-2b`, `dayoon/streamembed`, `auto` | The model, where its LoRAs come from, and the device |
74
+ | `width` | 1280 | Wider screenshots are shrunk to it |
75
+ | `interval` | 5 | Seconds between captures; for a folder, at most one screenshot per screen this often (0: all) |
76
+ | `monitors` | `all` | `all`, `primary`, or display numbers such as `[1, 2]` |
77
+ | `skip_unchanged` | true | Skip screens that did not change |
78
+ | `exclude_apps`, `exclude_titles` | password managers; private browsing windows | Nothing is captured while the frontmost app or window title contains one of these (macOS) |
79
+ | `parse_time` | true | Read time words in a question as a time filter |
80
+ | `top_k` | 10 | Results per question |
81
+ | `page_results`, `context` | 100, 15 | Results put on the results page (to pick dates among); frames shown before and after each |
82
+
83
+ ### Capturing in the background
84
+
85
+ `build_index_from_now` captures while its Python process runs: `examples/main.py` keeps capturing until Ctrl-C or until the terminal closes. To keep capturing with no terminal open and after every login, install it as a service. It uses the system's own service manager:
86
+
87
+ ```python
88
+ se.install_service(interval=5, monitors="all") # starts now and at every login; restarted if it stops with an error
89
+ se.service_status() # {"installed": True, "running": True, "pid": ..., "log": ".../service.log", ...}
90
+ se.uninstall_service() # stops it and removes it; the index stays
91
+ ```
92
+
93
+ | System | Service | Notes |
94
+ |---|---|---|
95
+ | macOS | launchd user agent `org.streamembed.capture` (`~/Library/LaunchAgents/`) | The first start asks for Screen Recording permission for this Python (System Settings > Privacy & Security > Screen Recording); allow it, then call `install_service()` again |
96
+ | Linux | systemd user service `streamembed-capture.service` (`~/.config/systemd/user/`) | X11 only. Install from a terminal in your desktop session: the service keeps that session's `DISPLAY` |
97
+ | Windows | Task Scheduler task `StreamEmbedCapture`, at logon, run with `pythonw` (no console window) | Stopping it ends the process at once; the index drops a half-written row when it is next opened |
98
+
99
+ | Function | What it does |
100
+ |---|---|
101
+ | `install_service(interval=5.0, monitors="primary", skip_unchanged=True, index_dir=None, ...)` | Run `build_index_from_now` with these settings as a service (`python -m streamembed ...`). Settings left out come from `configure()`. Installing again replaces it |
102
+ | `service_status()` | Whether it is installed and running, its pid, its log file (`service.log` in the index folder) and its command line |
103
+ | `uninstall_service()` | Stop it and remove it |
104
+
105
+ One process writes an index at a time. While the service runs, other processes open its index read-only: `query_index` and `visualize_results` work and see newly captured screens, and `build_index_*` on that folder raises until the service is stopped.
106
+
107
+ ### The index folder
108
+
109
+ | File | Content |
110
+ |---|---|
111
+ | `frames.jsonl` | One line per stored screen: time, image path, app, window title |
112
+ | `vectors.f16` | One fp16 vector (2048-d for 2B, 4096-d for 8B) per line of `frames.jsonl` |
113
+ | `images/` | The stored screenshots, 1280 px wide |
114
+ | `seen.jsonl` | When an unchanged screen was still on screen |
115
+ | `writer.lock` | Held by the process that writes; others read |
116
+ | `service.log` | The background service's log |
117
+ | `codes.bin`, `mu.npy` | `binary` only |
118
+ | `hnsw.bin`, `hnsw.json` | `hnsw` only: the graph with its 512-d float32 vectors, and its parameters |
119
+ | `ivf.json`, `ivf_centroids.npy`, `ivf_codes.bin` | `ivf` only: training size, list centroids, the list of each frame (4 B) |
120
+ | `pq.json`, `pq_centroids.npy`, `pq_codebooks.npy`, `pq_codes.bin` | `pq` only: training size, list centroids, PQ codebooks, the list and the 64 PQ codes of each frame (68 B) |
121
+ | `thumbs/`, `results.html` | Made by `visualize_results` |
122
+
123
+ ### Index types
124
+
125
+ | Type | Search |
126
+ |---|---|
127
+ | `flat` | Exact inner product over every stored vector (fp16, 4 KB per frame) |
128
+ | `binary` | Exact up to 1,000 frames. Beyond that, Hamming top 1,000 over 1-bit codes of the first 512 dimensions (64 B per frame, kept in memory), then exact re-rank. About 0.13 GB of memory per year of 5-s captures |
129
+ | `hnsw` | Exact up to 10,000 frames. Beyond that, an HNSW graph (hnswlib, M = 32, efConstruction = 500) over the first 512 dimensions; a query takes the graph's top 800 (efSearch) and re-ranks them exactly. About 2.3 KB per frame in memory and on disk. Needs `pip install "streamembed[hnsw]"` |
130
+ | `ivf` | Exact up to 10,000 frames. Beyond that, the frames are split into round(sqrt(n)) lists by spherical k-means (10 iterations, fixed seed, on up to 50,000 evenly spaced frames); a query scores every frame of its 32 nearest lists exactly. 4 B per frame plus the centroids |
131
+ | `pq` | IVF-PQ. Exact up to 10,000 frames. Beyond that, the same kind of lists, plus a product-quantized code of the first 512 dimensions per frame (64 sub-quantizers x 8 bits, trained on up to 20,000 frames); a query ranks the frames of its 64 nearest lists by their codes and re-ranks the top 2,000 exactly. 68 B per frame plus the centroids and codebooks |
132
+
133
+ Every type returns exact cosines: candidates are re-scored over `vectors.f16`. New frames are searchable as soon as they are added: `hnsw` inserts them into the graph, `ivf` and `pq` put them in their nearest list. `ivf` and `pq` train when the index passes 10,000 frames and train again from scratch (new lists and codebooks, every frame re-encoded, a few seconds) each time the index has grown 4x since the last training. The `hnsw` graph is never rebuilt; it is saved every 1,000 new frames and when the index is closed. If a structure lags the vectors (a crash, or frames added while the folder was open with another type), the missing frames are added when the index is opened. A process that opens the folder read-only uses these files but never writes them; if they are missing or behind, it builds or catches up in memory. Defaults are constants in `src/streamembed/ann.py`.
134
+
135
+ Measured on an M2 Pro (16 GB) with 200,000 2048-d frames (132,221 stored Qwen3-VL-Embedding-2B frame vectors plus noisy copies of them) and 200 stored text-query vectors, top 10 with the 30-s dedupe: recall@10 against `flat` is 0.93 for `binary`, 0.95 for `hnsw`, 0.97 for `ivf` and 0.96 for `pq`; median query time is 295 ms for `flat`, 8 ms for `binary`, 13 ms for `hnsw`, 53 ms for `ivf` and 22 ms for `pq`. Building from `vectors.f16` takes 1 s (`binary`), 61 s (`hnsw`), 5 s (`ivf`) and 19 s (`pq`). At 50,000 frames recall is 0.91, 0.99, 0.95 and 0.97.
136
+
137
+ An index folder can be reopened with any other type. It also records the encoder, and refuses vectors from a different one.
138
+
139
+ ### Models
140
+
141
+ A model is a base model from its own Hugging Face repository, pinned to a commit, plus two LoRAs from the StreamEmbed model repository: one for screenshots (a consistency adapter that keeps pruned, streamed frames close to full frames) and one for questions. Only the LoRAs live in the StreamEmbed repository; its `models.json` names each model's base repository, commit and files.
142
+
143
+ | Model | What it is |
144
+ |---|---|
145
+ | `qwen3-vl-2b` (default) | Qwen3-VL-Embedding-2B with the StreamEmbed LoRAs |
146
+ | `qwen3-vl-8b` | Qwen3-VL-Embedding-8B with the StreamEmbed LoRAs; needs a GPU with about 20 GB |
147
+ | `qwen3-vl-2b-base` | Qwen3-VL-Embedding-2B without LoRAs; built in, needs no model repo |
148
+
149
+ The model repository also holds LoRAs for SigLIP2 So400m, SigLIP2 Base and VultronRetrieverFlash 0.8B. `available_models()` lists them, but the stream encoder supports Qwen3-VL models only, so selecting one raises `NotImplementedError` when StreamEmbed first encodes.
150
+
151
+ `configure(models_repo=...)` or `$STREAMEMBED_MODELS` points to another Hugging Face repository or a local folder with the same layout. An index records its model and refuses vectors from another one.
152
+
153
+ The first run of `qwen3-vl-2b` downloads the base model (about 4 GB) and the LoRAs (70 MB each); after that nothing is downloaded. Encoding needs about 8 GB of memory and takes 0.7 to 1.3 s per frame on an M2 Pro GPU; the change gate skips screens that did not change.
154
+
155
+ ## Requirements
156
+
157
+ Python 3.12 or later on macOS (Apple silicon, tested), Linux under X11 or Windows (both not yet tested on a real machine; the service files are tested). On macOS, capturing the screen needs Screen Recording permission for the app that runs Python; `build_index_from_now` raises `PermissionError` until it is granted.
158
+
159
+ Dependencies are pinned to torch 2.8.0 and transformers 5.17.0: the stream encoder re-implements parts of the Qwen3-VL forward pass against transformers internals, and its outputs were checked for equality with these versions. Install StreamEmbed in its own environment (for example `uv tool`, `pipx`, or a venv) if your project needs other versions.
160
+
161
+ The `hnsw` index type needs the `hnsw` extra (`pip install "streamembed[hnsw]"`), which installs chroma-hnswlib 0.7.6: hnswlib with prebuilt wheels (the `hnswlib` package itself is a source package that needs a C++ compiler). Its wheels cover Python 3.12; on later Python versions it is built from source. It does not use OpenMP and runs in one process with torch (checked on macOS with torch 2.8.0 on MPS). The other types need only numpy.
162
+
163
+ ## Privacy
164
+
165
+ - Screenshots, vectors and metadata stay in the index folder (owner-only). Screenshots are stored unencrypted.
166
+ - On macOS, capture is skipped when the screen is locked, when the frontmost app is a password manager, and when the frontmost window is a private browsing window. Other windows on screen are not checked; use `capture.pause()` for sensitive work. On Linux and Windows these checks are not implemented yet: everything on screen is captured.
167
+ - Nothing is sent over the network after the model download.
168
+
169
+ ## Development
170
+
171
+ ```bash
172
+ uv venv && uv pip install -e ".[dev,hnsw]"
173
+ .venv/bin/python -m pytest # API tests with a stand-in encoder; no model needed (hnsw tests are skipped without the extra)
174
+ ```
175
+
176
+ `src/streamembed/engine/` is the stream encoder from the paper's code and keeps its names: Token Pruning is spatial pruning, KV Reuse is temporal reuse.
177
+
178
+ ## License
179
+
180
+ Apache-2.0. See `LICENSE` and `NOTICE`; the model weights are downloaded under their own license.
@@ -1,8 +1,8 @@
1
1
  [project]
2
2
  name = "streamembed"
3
- version = "0.1.0"
3
+ version = "0.2.0"
4
4
  description = "Search your own screen history by describing what you saw, from screenshots, on your machine"
5
- readme = "README.md"
5
+ readme = "PYPI.md"
6
6
  license = "Apache-2.0"
7
7
  license-files = ["LICENSE", "NOTICE"]
8
8
  requires-python = ">=3.12"
@@ -30,16 +30,22 @@ dependencies = [
30
30
 
31
31
  [project.optional-dependencies]
32
32
  dev = ["pytest>=8"]
33
+ # index_type="hnsw". chroma-hnswlib is hnswlib (same module and API) with prebuilt wheels; hnswlib itself ships only a source
34
+ # package that needs a C++ compiler. It does not use OpenMP, so it can share the process with torch.
35
+ hnsw = ["chroma-hnswlib==0.7.6"]
33
36
 
34
37
  [build-system]
35
38
  requires = ["hatchling>=1.27"]
36
39
  build-backend = "hatchling.build"
37
40
 
41
+ [project.scripts]
42
+ streamembed = "streamembed.cli:main"
43
+
38
44
  [tool.hatch.build.targets.wheel]
39
45
  packages = ["src/streamembed"]
40
46
 
41
47
  [tool.hatch.build.targets.sdist]
42
- include = ["src/streamembed", "tests", "examples", "README.md", "pyproject.toml", "LICENSE", "NOTICE"]
48
+ include = ["src/streamembed", "tests", "examples", "README.md", "PYPI.md", "pyproject.toml", "LICENSE", "NOTICE"]
43
49
 
44
50
  [tool.pytest.ini_options]
45
51
  testpaths = ["tests"]
@@ -0,0 +1,10 @@
1
+ """StreamEmbed: search your own screen history by describing what you saw. Everything runs on your machine."""
2
+ from .api import (Capture, Result, available_index_types, available_models, build_index_from_directory, build_index_from_now, configure, is_paused,
3
+ pause, query_index, resume, visualize_results)
4
+ from .config import get_config, reset_config, set_config
5
+ from .service import install_service, service_status, uninstall_service
6
+
7
+ __version__ = "0.2.0"
8
+ __all__ = ["Capture", "Result", "available_index_types", "available_models", "build_index_from_directory", "build_index_from_now", "configure", "query_index",
9
+ "visualize_results", "install_service", "service_status", "uninstall_service", "pause", "resume", "is_paused",
10
+ "get_config", "set_config", "reset_config"]
@@ -0,0 +1,6 @@
1
+ """`python -m streamembed ...` = the `streamembed` command (see streamembed.cli)."""
2
+ import sys
3
+
4
+ from .cli import main
5
+
6
+ sys.exit(main())