Spaces:
Sleeping
Sleeping
Add Visualizer and Grand Arena GIFs to README.md
Browse files
README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
| 4 |
|
| 5 |
RAG Visualizer is an interactive, local-first tool that lets you **see** what happens inside a RAG pipeline β from how your text gets chunked, to how those chunks land in vector space, to which chunks get retrieved for a given query. No cloud APIs, no black boxes. Everything runs on your machine with local Ollama models.
|
| 6 |
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
## β¨ Features
|
|
@@ -38,11 +40,20 @@ Visualize and compare **5 chunking strategies** side-by-side:
|
|
| 38 |
- **Sonar Probe** β click anywhere on the canvas to find the nearest chunks by 2D proximity
|
| 39 |
- **Document X-Ray Highlighting** β retrieved chunks glow in the original text with rank-based styling (gold for Rank 1, dashed for Rank 2, dotted for Rank 3)
|
| 40 |
|
| 41 |
-
###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
-
|
|
|
|
|
|
|
| 46 |
|
| 47 |
---
|
| 48 |
|
|
@@ -264,9 +275,40 @@ Embeds a query and retrieves the top-K most similar chunks from ChromaDB.
|
|
| 264 |
|
| 265 |
**Response:** `QueryResponse` with query coordinates, retrieved chunks, and distance scores.
|
| 266 |
|
| 267 |
-
### `
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
|
| 269 |
-
|
| 270 |
|
| 271 |
---
|
| 272 |
|
|
|
|
| 4 |
|
| 5 |
RAG Visualizer is an interactive, local-first tool that lets you **see** what happens inside a RAG pipeline β from how your text gets chunked, to how those chunks land in vector space, to which chunks get retrieved for a given query. No cloud APIs, no black boxes. Everything runs on your machine with local Ollama models.
|
| 6 |
|
| 7 |
+

|
| 8 |
+
|
| 9 |
---
|
| 10 |
|
| 11 |
## β¨ Features
|
|
|
|
| 40 |
- **Sonar Probe** β click anywhere on the canvas to find the nearest chunks by 2D proximity
|
| 41 |
- **Document X-Ray Highlighting** β retrieved chunks glow in the original text with rank-based styling (gold for Rank 1, dashed for Rank 2, dotted for Rank 3)
|
| 42 |
|
| 43 |
+
### βοΈ Phase 3.2 β LLM-as-a-Judge (The Grand Arena)
|
| 44 |
+
|
| 45 |
+
- **Side-by-Side Comparison** β Compare retrieval results from two different models/strategies in a split-screen arena
|
| 46 |
+
- **AI Referee** β Call upon a local Ollama model to evaluate, rank, and score retrieved contexts
|
| 47 |
+
- **Multi-Dimensional Scorecard** β Referee grades chunks on Relevance, Completeness, Factual Plausibility, and Clarity
|
| 48 |
+
- **Pydantic Validator Guardrails** β Validates the referee's output to catch and override arithmetic lies and position bias
|
| 49 |
+
|
| 50 |
+

|
| 51 |
|
| 52 |
+
### π Phase 4 β Adaptive Thresholding (Gradient Fix)
|
| 53 |
+
|
| 54 |
+
- Semantic chunking uses an **adaptive gradient derivative / peak detection** algorithm instead of a static threshold split
|
| 55 |
+
- Computes the dynamic threshold based on document-wide mean and standard deviation of inter-sentence embedding distances
|
| 56 |
+
- Uses local maxima peak detection to prevent fragmenting paragraphs, ensuring splits only happen at true topic shift peaks
|
| 57 |
|
| 58 |
---
|
| 59 |
|
|
|
|
| 275 |
|
| 276 |
**Response:** `QueryResponse` with query coordinates, retrieved chunks, and distance scores.
|
| 277 |
|
| 278 |
+
### `POST /api/compare`
|
| 279 |
+
|
| 280 |
+
Compares retrieval results from two different configurations side-by-side.
|
| 281 |
+
|
| 282 |
+
**Request Body:**
|
| 283 |
+
|
| 284 |
+
```json
|
| 285 |
+
{
|
| 286 |
+
"search_text": "query",
|
| 287 |
+
"top_k": 3,
|
| 288 |
+
"model_a": "nomic-embed-text",
|
| 289 |
+
"strategy_a": "fixed_size",
|
| 290 |
+
"model_b": "EmbeddingGemma",
|
| 291 |
+
"strategy_b": "semantic"
|
| 292 |
+
}
|
| 293 |
+
```
|
| 294 |
+
|
| 295 |
+
**Response:** `CompareResponse` containing results from both configuration A and configuration B.
|
| 296 |
+
|
| 297 |
+
### `POST /api/judge`
|
| 298 |
+
|
| 299 |
+
Submits retrieval results to a local LLM judge for evaluation and scoring.
|
| 300 |
+
|
| 301 |
+
**Request Body:**
|
| 302 |
+
|
| 303 |
+
```json
|
| 304 |
+
{
|
| 305 |
+
"search_query": "query",
|
| 306 |
+
"chunk_a": "text of chunk a",
|
| 307 |
+
"chunk_b": "text of chunk b"
|
| 308 |
+
}
|
| 309 |
+
```
|
| 310 |
|
| 311 |
+
**Response:** `JudgeResponse` with winner declaration, confidence, scorecards, strengths, and weaknesses.
|
| 312 |
|
| 313 |
---
|
| 314 |
|