SkillAgentSearch skills...

Latent Scope

A scientific instrument for investigating latent spaces

Install / Use

npx skills add enjalot/latent-scope

Installs into whichever agent you are using.

About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Latent Scope

PyPI version

Quickly embed, project, cluster and explore a dataset with open models locally or via API. This project is a new kind of workflow + tool for visualizing and exploring datasets through the lens of latent spaces.

Docs · Demos

| | | | | | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------: | | Fineweb EDU | Dad Jokes | Common Corpus | Data is Plural |

Latent Scope encodes a process that is increasingly common in AI and data science workflows: Embed unstructured data into high-dimensional vectors, reduce the dimensionality of those vectors, cluster the resulting points, label the clusters with an LLM and then explore the annotated data.

<img src="https://github.com/enjalot/latent-scope/blob/main/documentation/process-crop.png?raw=true" alt="Setup your scope">

In addition to making this process easier by providing a web interface for each step, Latent Scope provides an intuitive way to explore the resulting annotated data via an interactive visualization tightly coupled with the input data.

<img src="https://github.com/enjalot/latent-scope/blob/main/documentation/explore.png?raw=true" alt="Explore and your data">

Capabilities

Latent Scope works with text and image datasets and supports:

  • Dense embeddings from sentence-transformers/HuggingFace, OpenAI, Cohere, Voyage, Mistral, Together, and any OpenAI-compatible endpoint.
  • ColBERT late-interaction (multi-vector) embeddings with MaxSim similarity search — see examples/colbert_quickstart/.
  • Image embeddings (CLIP-style) with an interactive image map: a zoomable representative-image sprite atlas that takes over from the heatmap as you zoom in.
  • LanceDB vector storage, UMAP projection, and LLM cluster labeling.
  • Multiple clustering methods — EVoC, HDBSCAN, KMeans, and Gaussian Mixture — with a choice of clustering on the 2D UMAP or the high-dimensional embedding (ls-cluster --method, see docs/clustering.md).
  • GPU acceleration (optional): cuML-accelerated UMAP, HDBSCAN, and KMeans on NVIDIA GPUs, with automatic CPU fallback — controlled by LATENT_SCOPE_DEVICE (see docs/gpu-acceleration.md).
  • Named experiments + gallery: give UMAP and cluster runs human-friendly names/descriptions and browse them as a thumbnail gallery instead of a bare umap-001 id list.
  • Color-by + Compare: color the Explore and Compare maps by any numeric or categorical column, and share a lasso/brush selection across both Compare panes (see docs/exploring.md).

Curation (deleting rows, tagging during Setup, reassigning clusters) is not part of 1.0 — it is planned as a post-1.0 (1.1) initiative. See docs/exploring.md.

See docs/data-importing.md for the full set of input formats and import options (including images, ColBERT, and data-size guidance), and CLAUDE.md for an agent-friendly quickstart.

Getting started

Follow the documentation guides to get started:

  1. Install and Configure
  2. Your First Scope
  3. Explore and Curate
  4. Exporting Data

Using with AI coding agents

Latent Scope ships a cross-provider agent skill so tools like Claude Code, Codex, and Cursor can drive the pipeline on your behalf. The runbook is AGENTS.md (Claude Code also auto-loads it via .claude/skills/latent-scope/); CLAUDE.md covers the codebase. Point your agent at the repo and ask it to "map my data" and it should know the whole flow.

Example Analysis

What can you do with Latent Scope? The following examples demonstrate the kinds of perspective and insights you can gain from your unstructured text data.

Quick Start

Latent Scope works on Mac, Linux and Windows. Python 3.12 is the recommended python version.

To get started, install the latent-scope python module and run the server via the Command Line:

python -m venv venv
source venv/bin/activate
pip install latentscope
ls-init ~/latent-scope-data --openai_key=XXX --mistral_key=YYY # optional api keys to enable API models
ls-serve

Then open your browser to http://localhost:5001 and start processing your first dataset!

See the Your First Scope guide for a detailed walk-through of the process.

Python interface

You can also ingest data from a Pandas dataframe using the Python interface:

import latentscope as ls
df = pd.read_parquet("...")
ls.init("~/latent-scope-data") # you can also pass in openai_key="XXX", mistral_key="XXX" etc.)
ls.ingest("dadabase", df, text_column="joke")
ls.serve()

See these notebooks for detailed examples of using the Python interface to prepare and load data.

  • dvs-survey - A small test dataset of 700 rows to quickly illustrate the process. This notebook shows how you can do every step of the process with the Python interface.
  • dadabase - A more interesting (and funny) dataset of 50k rows. This notebook shows how you can preprocess a dataset, ingest it into latentscope and then use the web interface to complete the process.
  • dolly15k - Grab data from HuggingFace datasets and ingest into the process.
  • emotion - 400k rows of emotional tweets.

Command line quick start

When latent-scope is installed, it creates a suite of command line scripts that can be used to setup the scopes for exploring in the web application. The output of each step in the process is flat files stored in the data directory specified at init. These files are in standard formats that were designed to be ported into other pipelines or interfaces.

# like above, we make sure to install latent-scope
python -m venv venv
source venv/bin/activate
pip install latent-scope

# prepare some data
wget "https://storage.googleapis.com/fun-data/latent-scope/examples/dvs-survey/datavis-misunderstood.csv" > ~/Downloads/datavis-misunderstood.csv

ls-init "~/latent-scope-data"
# ls-ingest dataset_id --path <file> (csv/parquet/json/jsonl/xlsx)
ls-ingest "datavis-misunderstood" --path "~/Downloads/datavis-misunderstood.csv"
# get a list of model ids available (lists both embedding and chat models available)
ls-list-models
# ls-embed dataset_id text_column model_id [--prefix ...]
ls-embed datavis-misunderstood "answer" transformers-intfloat___e5-small-v2
# ls-umap dataset_id embedding_id n_neighbors min_dist
ls-umap datavis-misunderstood embedding-001 25 .1
# ls-cluster dataset_id umap_id samples min_samples cluster_selection_epsilon [--method]
# default --method is evoc (clusters the high-dim embedding); see docs/clustering.md
ls-cluster datavis-misunderstood umap-001 5 5 0.0 --method hdbscan
# ls-label dataset_id text_column cluster_id model_id samples context
ls-label datavis-misunderstood "answer" cluster-001 transformers-HuggingFaceH4___zephyr-7b-beta 0 ""
# ls-scope  dataset_id embedding_id umap_id cluster_id cluster_labels_id label descrip

Related Skills

View on GitHub
GitHub Stars786
CategoryDevelopment
Updated1d ago
Forks34

Languages

JavaScript

Security Score

95/100

Audited on Aug 7, 2026

No findings