← all features

Vector · live examples

Embeddings beside the rows they describe.

A vector is a vector — whatever produced it. Policy text, caller voiceprints, KYC document photos, video segments, even pure transaction behavior: embed it with any model and OriginChain stores and searches it beside the rows it describes. Three index kinds cover the scale curve (HNSW default, IVF past ~1M, IVF-PQ at ≥100M), metadata filters ride along in the same call, and the final example closes the loop: retrieve, then hand the chunks to an LLM for a grounded answer.

01
Embed
Documents are embedded at write time — one atomic put with the row and metadata.
02
Index
HNSW (default) for instant recall; IVF with tunable nprobe past ~1M vectors; IVF-PQ compression at ≥100M.
03
Ground
Filtered top-k by cosine, dot, or L2 — retrieved chunks go straight to the LLM, the answer cites what the database returned.
checking instance…one substrate · sql / graph / vector / fts / nql
Foundations
01

Top-k cosine

easy

Policies semantically closest to a hardship question.

request
POST /v1/tenants/:t/vector/policies/topk
{
  "vector": "<embed(question) — 384 dims via /api/embed>",
  "k": 3,
  "metric": "cosine",
  "question": "customer lost income and cannot pay EMI this month"
}
02

Top-k + metadata filter

easy

Same search, restricted to loan-category policies only.

request
POST /v1/tenants/:t/vector/policies/topk
{
  "vector": "<embed(question) — 384 dims via /api/embed>",
  "k": 3,
  "metric": "cosine",
  "filter": {
    "category": "loans"
  },
  "question": "KYC requirements for repayment assistance"
}
Index kinds — HNSW · IVF · IVF-PQ
03

HNSW — default, with the speed dial

easy

The default in-memory graph index. mode picks the beam width: high_recall for correctness, fast when p99 matters more.

request
POST /v1/tenants/:t/vector/policies/topk
{
  "vector": "<embed(question) — 384 dims via /api/embed>",
  "k": 5,
  "metric": "cosine",
  "index": "hnsw",
  "mode": "fast",
  "question": "account closure with outstanding dues"
}
04

IVF — sub-linear past a million vectors

intermediate

Inverted-file index: centroids + posting lists. nprobe is the dial — how many cells the query visits, recall vs latency.

request
POST /v1/tenants/:t/vector/policies/topk
{
  "vector": "<embed(question) — 384 dims via /api/embed>",
  "k": 5,
  "metric": "cosine",
  "index": "ivf",
  "nprobe": 8,
  "question": "moratorium eligibility after job loss"
}
05

IVF-PQ — hundred-million scale

intermediate

IVF plus product quantization: posting payloads compressed ~16x so the index that wouldn't fit in RAM now does.

request
POST /v1/tenants/:t/vector/policies/topk
{
  "vector": "<embed(question) — 384 dims via /api/embed>",
  "k": 5,
  "metric": "cosine",
  "index": "ivf_pq",
  "nprobe": 16,
  "question": "premium card travel insurance"
}
Multimodal — any embedding, one substrate
06

Voiceprint match — audio-to-audio

intermediate

Call-center audio embedded with a speaker model. Search a new caller's voiceprint against the archive: same voice showing up behind different customer identities is a fraud ring, not a coincidence.

request
POST /v1/tenants/:t/vector/call_audio/topk
{
  "vector": "<speaker-embedding of inbound call, 256 dims>",
  "k": 5,
  "metric": "cosine",
  "filter": {
    "channel": "phone_support"
  },
  "question": "voiceprint of caller claiming to be CUST-0089"
}
07

Speech-to-speech — ask by voice, answered by voice

intermediate

The full voice loop: caller audio → embedding → top-k over transcribed call history and policies → LLM drafts the answer → TTS speaks it. OriginChain is the retrieval hop in the middle.

request
POST /v1/tenants/:t/vector/call_transcripts/topk
{
  "vector": "<embedding of spoken question: 'why was my EMI charged twice this month?'>",
  "k": 3,
  "metric": "cosine",
  "filter": {
    "customer_id": "CUST-0042"
  }
}
08

Image forensics — reused KYC documents

intermediate

KYC document photos embedded with a vision model. A newly submitted utility bill lands within 0.98 of one already on file for a different customer — the same physical document, resubmitted.

request
POST /v1/tenants/:t/vector/kyc_images/topk
{
  "vector": "<CLIP-style image embedding of submitted utility bill, 512 dims>",
  "k": 3,
  "metric": "cosine",
  "exclude_ids": [
    "DOC-55102"
  ],
  "filter": {
    "doc_type": "address_proof"
  }
}
09

Cross-modal — text query, image results

intermediate

Shared text-image embedding space: type a description, retrieve matching cheque images. No tags, no OCR pass — the description and the pixels land near each other.

request
POST /v1/tenants/:t/vector/cheque_images/topk
{
  "vector": "<text embedding in shared space: 'handwritten amount visibly overwritten or altered'>",
  "k": 3,
  "metric": "cosine"
}
10

Video KYC — coached-applicant detection

intermediate

Video-KYC clips embedded per segment. Search with a known coached-fraud session: applicants pausing to read scripted answers cluster tightly, whoever the applicant is.

request
POST /v1/tenants/:t/vector/kyc_videos/topk
{
  "vector": "<video-segment embedding of confirmed coached session VID-2210>",
  "k": 3,
  "metric": "cosine",
  "exclude_ids": [
    "VID-2210"
  ],
  "filter": {
    "review_status": "auto_approved"
  }
}
11

Behavioral embeddings — accounts that act like mules

intermediate

No media at all: 90 days of transaction behavior encoded as a vector per account. Nearest neighbours to the confirmed-mule centroid are the accounts behaving like mules before any rule fires.

request
POST /v1/tenants/:t/vector/txn_behavior/topk
{
  "vector": "<centroid of confirmed-mule behavior vectors, 128 dims>",
  "k": 5,
  "metric": "cosine",
  "filter": {
    "flagged": false
  }
}
Intermediate patterns
12

Metric comparison

intermediate

One query, three metrics — cosine vs dot vs L2 rank the same corpus differently.

request
POST /v1/tenants/:t/vector/policies/topk
{
  "vector": "<embed(question) — 384 dims via /api/embed>",
  "k": 3,
  "metric": "dot",
  "question": "premium card travel insurance"
}
13

Compound metadata filter

intermediate

Semantic search constrained by category IN (…) AND effective_date range — filters evaluated inside the same top-k call.

request
POST /v1/tenants/:t/vector/policies/topk
{
  "vector": "<embed(question) — 384 dims via /api/embed>",
  "k": 5,
  "metric": "cosine",
  "filter": {
    "category": {
      "in": [
        "loans",
        "compliance"
      ]
    },
    "effective_date": {
      "gte": "2026-01-01"
    }
  },
  "question": "moratorium eligibility after job loss"
}
14

Near-duplicate detection

intermediate

Governance hygiene: policies whose embeddings sit suspiciously close to each other — overlapping rules that contradict on the edges.

request
POST /v1/tenants/:t/vector/policies/topk
{
  "vector": "<embedding of POL-012 itself>",
  "k": 3,
  "metric": "cosine",
  "exclude_ids": [
    "POL-012"
  ],
  "question": "self-similarity sweep for POL-012 (EMI Restructuring Eligibility)"
}
Retrieval feeding the LLM
15

RAG finale — retrieve, then answer

intermediate

Top-3 policies retrieved from OriginChain, fed verbatim to the LLM, answer grounded on exactly those chunks.

request
POST /v1/tenants/:t/vector/policies/topk
{
  "vector": "<embed(question) — 384 dims via /api/embed>",
  "k": 3,
  "metric": "cosine",
  "question": "Can a customer with one missed EMI get repayment assistance?"
}