Skip to main content

NAPsack records and aggregates your computer use — screenshots plus input events (click, keypress, scroll, cursor move). It groups activity into event bursts and uses a VLM pipeline to generate human-readable captions describing what happened.

Project description

NAPsack

NAPsack records and structures your computer use by generating natural language caption from screenshots and input events (click, keypress, scroll, cursor move).

napsack_overview

Quickstart

Requires Python 3.11+ and ffmpeg for video generation. Use uv to run the commands below.

API Keys

NAPsack uses a VLM to generate captions. Create a .env file in the project root (or export variables in your shell):

cp .env.example .env

Then fill in the key for your chosen client:

Client Variable Where to get it
gemini (default) GEMINI_API_KEY Google AI Studio
vllm (none — pass --vllm-url) Self-hosted vLLM server
bigquery (uses Application Default Credentials) gcloud auth application-default login

For Gemini, your .env should contain:

GEMINI_API_KEY=your_key_here

Record a session (press CTRL+C to stop)

uv run -m record --monitor

Label the recorded session

uv run -m label --session logs/session_name --client gemini

NAPsack supports gemini and vllm for data labeling and integrates with big query

Output

logs/session_name
├── screenshots         # Recorded screenshots
├── aggregations.jsonl  # Recorded event bursts
├── captions.jsonl	    # All VLM-generated captions
├── annotated.mp4       # Final video showing generated captions and input events
└── data.jsonl          # Final data containing raw input events and LLM generated captions

Method

Record

NAPsack groups temporally adjacent input events of the same type into event bursts. An event is assigned to the current burst if the time since the preceding event of that type does not exceed the corresponding gap threshold and the elapsed time since the burst start remains within the max duration.

  • If the gap threshold is exceeded, a new burst is started.
  • If the max duration is exceeded, the first half of the current burst is finalized and saved, while the second half becomes the active burst. A burst is force-restarted when the active monitor changes.

Label

The label module:

  • Loads sessions or raw screenshots and chunks.
  • Uses prompts (in label/prompts) to instruct the VLM to generate captions that describe the user's actions and context.
  • Produces captions.jsonl and data.jsonl (captions aligned to screenshots and events).
  • Optionally renders an annotated video (annotated.mp4) showing captions and event visualizations overlayed on frames.

The label step performs a second layer of aggregation: it uses the bursts detected at recording time and further refines and annotates them with VLM outputs to create final human-readable summaries.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napsack-0.1.0.tar.gz (58.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

napsack-0.1.0-py3-none-any.whl (70.6 kB view details)

Uploaded Python 3

File details

Details for the file napsack-0.1.0.tar.gz.

File metadata

  • Download URL: napsack-0.1.0.tar.gz
  • Upload date:
  • Size: 58.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.11

File hashes

Hashes for napsack-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cbcc1d43b2b1b48a4bd24d1d1d546418740a49f626437cd0f1644afefa192642
MD5 754d3cd2d77c534e59371a2c47167498
BLAKE2b-256 201ac3485d5faafc8418f14d5be19f7caba267305ba4a490c9bd27a2ee4105c4

See more details on using hashes here.

File details

Details for the file napsack-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: napsack-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 70.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.11

File hashes

Hashes for napsack-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5aaeb50d263a380da53b55c69c336ebeabd19d87f5b6eb7dd4dae702f1d29d33
MD5 9834d38183b4ce8de312d0d15233a26f
BLAKE2b-256 cf6b444b8bf00846895f905b280e184f1db9b2b9f5ce9a63c1db512f45c894cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page