autorag.viz¶
Topic embedding visualization: Chroma-backed embeddings + UMAP + FastAPI endpoints.
- class autorag.viz.TopicPoint(**data)[source]¶
Bases:
BaseModelOne topic node placed in 3-D space by the UMAP projection.
- Parameters:
- class autorag.viz.Edge(**data)[source]¶
Bases:
BaseModelA similarity edge between two
TopicPointindices.
- class autorag.viz.VizData(**data)[source]¶
Bases:
BaseModelPayload returned by
GET /viz/data— points, edges, clip metadata.- Parameters:
- points: list[TopicPoint]¶
- class autorag.viz.SearchResult(**data)[source]¶
Bases:
BaseModelOne hit returned by
GET /viz/search.- Parameters:
- autorag.viz.umap_3d(embeddings)[source]¶
Project N-D embeddings down to 3 columns with cosine UMAP.
Handles the small-N degenerate cases (n == 1 → all zeros; n < 4 → pad to three columns) so the page can render the very first clip.
- autorag.viz.Row¶
(clip_id, clip_title, topic, topic_index).
- Type:
A single point in the viz
- autorag.viz.viz_page()¶
Serve the React/r3f single-page app at
GET /viz.- Return type:
HTMLResponse
- autorag.viz.viz_data(distance_threshold=fastapi.Query)¶
Return the full
VizDatapayload for the/vizpage.Pulls every clip + topic from SQLite, fills missing embeddings via Ollama (and caches them in Chroma), runs the 3-D UMAP projection, and assembles cluster labels and similarity edges using
distance_thresholdas the cluster cut.
- autorag.viz.viz_search(q=fastapi.Query, top_k=fastapi.Query)¶
Return the
top_ktopics whose embedding is closest toq.Embeds the query with the same Ollama model used at ingest time and runs the search inside Chroma. Hits that don’t have a corresponding point in the current viz dataset are skipped silently.
- Parameters:
- Return type: