Visualizers

Learn by moving things

Interactive explainers for the ideas behind retrieval, embeddings, and agents. A formula tells you what is true; dragging a vector shows you why. Each one also appears inside the article it belongs to, and runs entirely in your browser, so drag, poke, and break it.

Portrait of Sachin Gupta rendered in binary

Did it answer the question you asked?

From: How to Judge a RAG System →

Response relevancy (historically answer relevancy): generate questions the answer would fit, then measure how close they are to the original question. A tight answer implies questions that cluster on the original; a padded, off-topic answer implies questions that drift away.

Did it answer the question you asked?interactive
original questiongenerate questions the answer would fit, then compare them to this

The question: 'how long do I have to return a defective laptop?' Relevancy asks whether the answer actually addresses this.

Change Maya’s or Arun’s identity and inspect which copied passages keep the source document’s grants.

YOUR TURN · CHANGE ONE INPUT

Send D2 through the copy room.

Fictional records. Browser simulation. No live model call.

SOURCE FOLDER

D2

Engineering incident note

tenant: sachin
groups: ["engineering"]
users: []
D2.1× Deny

Sign-in requests time out under peak load.

Parent D2 · Sachin · policy v1

Maya: No matching permission

D2.2× Deny

The identity team is fixing the session refresh path.

Parent D2 · Sachin · policy v1

Maya: No matching permission

0 of 2 copies allowed for Maya. Each copy is evaluated using its inherited company and grants.

Inspect the input, rule, and output

Input / state

{
  "principal": {
    "id": "maya",
    "name": "Maya",
    "role": "Support",
    "tenantId": "sachin",
    "groups": [
      "support"
    ]
  },
  "source": {
    "id": "D2",
    "title": "Engineering incident note",
    "team": "Engineering",
    "tenantId": "sachin",
    "allowedGroups": [
      "engineering"
    ],
    "allowedUsers": [],
    "match": 98,
    "fact": "Sign-in requests time out under peak load. The identity team is fixing the session refresh path."
  },
  "paragraphs": [
    "Sign-in requests time out under peak load.",
    "The identity team is fixing the session refresh path."
  ]
}

Decision rule

validate permission metadata
copy tenant + grants onto each chunk
allow = sameCompany && (directGrant || groupGrant)

Output

{
  "chunks": [
    {
      "id": "D2.1",
      "title": "Engineering incident note",
      "team": "Engineering",
      "tenantId": "sachin",
      "allowedGroups": [
        "engineering"
      ],
      "allowedUsers": [],
      "match": 98,
      "fact": "Sign-in requests time out under peak load.",
      "parentId": "D2",
      "aclVersion": 1
    },
    {
      "id": "D2.2",
      "title": "Engineering incident note",
      "team": "Engineering",
      "tenantId": "sachin",
      "allowedGroups": [
        "engineering"
      ],
      "allowedUsers": [],
      "match": 98,
      "fact": "The identity team is fixing the session refresh path.",
      "parentId": "D2",
      "aclVersion": 1
    }
  ],
  "decisions": [
    {
      "id": "D2.1",
      "hasIdentity": true,
      "sameCompany": true,
      "directGrant": false,
      "groupGrant": false,
      "matchingGroups": [],
      "allowed": false,
      "reason": "No matching permission"
    },
    {
      "id": "D2.2",
      "hasIdentity": true,
      "sameCompany": true,
      "directGrant": false,
      "groupGrant": false,
      "matchingGroups": [],
      "allowed": false,
      "reason": "No matching permission"
    }
  ]
}

This view runs the same deterministic functions as the downloadable example. The short rule above summarizes the operation; the download contains the complete implementation.

Recover two of Maya’s five target passages, then widen the candidate set. The cutoff changes search reach, never permission.

YOUR TURN · CHANGE ONE INPUT

Move the cutoff through the ranked pile.

Fictional records. Browser simulation. No live model call.

The complete ranked pile

  1. 1D2.1× Denied98 pts
  2. 2D4.1× Denied96 pts
  3. 3D1.1✓ Allowed94 pts
  4. 4D2.2× Denied92 pts
  5. 5D3.1✓ Allowed90 ptscutoff
  6. 6D1.2✓ Allowed88 pts
  7. 7D3.2✓ Allowed86 pts
  8. 8D1.3✓ Allowed84 pts
  9. 9D4.2× Denied82 pts
  10. 10D3.3✓ Allowed80 pts
FETCH 5, THEN FILTER · REQUEST 5

2 passages returned

D1.1D3.1
EXACT ALLOWED BASELINE

5 target passages

D1.1D3.1D1.2D3.2D1.3

40% recall2 of 5 target passages recovered.

The cutoff changes reach, never permission. Still missed: D1.2, D3.2, D1.3.

Inspect the input, rule, and output

Input / state

{
  "principal": {
    "id": "maya",
    "name": "Maya",
    "role": "Support",
    "tenantId": "sachin",
    "groups": [
      "support"
    ]
  },
  "k": 5,
  "fetchCount": 5,
  "ranking": [
    {
      "id": "D2.1",
      "title": "Engineering incident note",
      "team": "Engineering",
      "tenantId": "sachin",
      "allowedGroups": [
        "engineering"
      ],
      "allowedUsers": [],
      "match": 98,
      "fact": "Sign-in requests time out under peak load.",
      "parentId": "D2",
      "aclVersion": 1
    },
    {
      "id": "D4.1",
      "title": "Launch cost review",
      "team": "Finance",
      "tenantId": "sachin",
      "allowedGroups": [
        "finance"
      ],
      "allowedUsers": [],
      "match": 96,
      "fact": "The delay adds $24,000 to the internal launch budget.",
      "parentId": "D4",
      "aclVersion": 1
    },
    {
      "id": "D1.1",
      "title": "Customer launch update",
      "team": "Shared",
      "tenantId": "sachin",
      "allowedGroups": [
        "support",
        "engineering"
      ],
      "allowedUsers": [],
      "match": 94,
      "fact": "Orion’s launch has moved to 14 October.",
      "parentId": "D1",
      "aclVersion": 1
    },
    {
      "id": "D2.2",
      "title": "Engineering incident note",
      "team": "Engineering",
      "tenantId": "sachin",
      "allowedGroups": [
        "engineering"
      ],
      "allowedUsers": [],
      "match": 92,
      "fact": "The identity team is fixing the session refresh path.",
      "parentId": "D2",
      "aclVersion": 1
    },
    {
      "id": "D3.1",
      "title": "Customer support FAQ",
      "team": "Support",
      "tenantId": "sachin",
      "allowedGroups": [
        "support"
      ],
      "allowedUsers": [],
      "match": 90,
      "fact": "Existing workspaces stay available.",
      "parentId": "D3",
      "aclVersion": 1
    },
    {
      "id": "D1.2",
      "title": "Customer launch update",
      "team": "Shared",
      "tenantId": "sachin",
      "allowedGroups": [
        "support",
        "engineering"
      ],
      "allowedUsers": [],
      "match": 88,
      "fact": "The team is completing reliability checks.",
      "parentId": "D1",
      "aclVersion": 1
    },
    {
      "id": "D3.2",
      "title": "Customer support FAQ",
      "team": "Support",
      "tenantId": "sachin",
      "allowedGroups": [
        "support"
      ],
      "allowedUsers": [],
      "match": 86,
      "fact": "Customers do not need to take any action.",
      "parentId": "D3",
      "aclVersion": 1
    },
    {
      "id": "D1.3",
      "title": "Customer launch update",
      "team": "Shared",
      "tenantId": "sachin",
      "allowedGroups": [
        "support",
        "engineering"
      ],
      "allowedUsers": [],
      "match": 84,
      "fact": "The launch update will be revised after the next readiness review.",
      "parentId": "D1",
      "aclVersion": 1
    },
    {
      "id": "D4.2",
      "title": "Launch cost review",
      "team": "Finance",
      "tenantId": "sachin",
      "allowedGroups": [
        "finance"
      ],
      "allowedUsers": [],
      "match": 82,
      "fact": "Finance will reconcile launch costs after release.",
      "parentId": "D4",
      "aclVersion": 1
    },
    {
      "id": "D3.3",
      "title": "Customer support FAQ",
      "team": "Support",
      "tenantId": "sachin",
      "allowedGroups": [
        "support"
      ],
      "allowedUsers": [],
      "match": 80,
      "fact": "Support will share the next approved launch update.",
      "parentId": "D3",
      "aclVersion": 1
    }
  ]
}

Decision rule

target = rank(all).filter(allowed).slice(0, k)
returned = rank(all).slice(0, fetchCount)
  .filter(allowed).slice(0, k)
recall = recoveredTargetCount / target.length

Output

{
  "target": [
    "D1.1",
    "D3.1",
    "D1.2",
    "D3.2",
    "D1.3"
  ],
  "returned": [
    "D1.1",
    "D3.1"
  ],
  "recall": 0.4
}

This view runs the same deterministic functions as the downloadable example. The short rule above summarizes the operation; the download contains the complete implementation.

Visualizers — Sachin Gupta