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.
Top-k cosine
easyPolicies semantically closest to a hardship question.
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" }
Top-k + metadata filter
easySame search, restricted to loan-category policies only.
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" }
HNSW — default, with the speed dial
easyThe default in-memory graph index. mode picks the beam width: high_recall for correctness, fast when p99 matters more.
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" }
IVF — sub-linear past a million vectors
intermediateInverted-file index: centroids + posting lists. nprobe is the dial — how many cells the query visits, recall vs latency.
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" }
IVF-PQ — hundred-million scale
intermediateIVF plus product quantization: posting payloads compressed ~16x so the index that wouldn't fit in RAM now does.
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" }
Voiceprint match — audio-to-audio
intermediateCall-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.
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" }
Speech-to-speech — ask by voice, answered by voice
intermediateThe 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.
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" } }
Image forensics — reused KYC documents
intermediateKYC 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.
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" } }
Cross-modal — text query, image results
intermediateShared 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.
POST /v1/tenants/:t/vector/cheque_images/topk { "vector": "<text embedding in shared space: 'handwritten amount visibly overwritten or altered'>", "k": 3, "metric": "cosine" }
Video KYC — coached-applicant detection
intermediateVideo-KYC clips embedded per segment. Search with a known coached-fraud session: applicants pausing to read scripted answers cluster tightly, whoever the applicant is.
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" } }
Behavioral embeddings — accounts that act like mules
intermediateNo 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.
POST /v1/tenants/:t/vector/txn_behavior/topk { "vector": "<centroid of confirmed-mule behavior vectors, 128 dims>", "k": 5, "metric": "cosine", "filter": { "flagged": false } }
Metric comparison
intermediateOne query, three metrics — cosine vs dot vs L2 rank the same corpus differently.
POST /v1/tenants/:t/vector/policies/topk { "vector": "<embed(question) — 384 dims via /api/embed>", "k": 3, "metric": "dot", "question": "premium card travel insurance" }
Compound metadata filter
intermediateSemantic search constrained by category IN (…) AND effective_date range — filters evaluated inside the same top-k call.
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" }
Near-duplicate detection
intermediateGovernance hygiene: policies whose embeddings sit suspiciously close to each other — overlapping rules that contradict on the edges.
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)" }
RAG finale — retrieve, then answer
intermediateTop-3 policies retrieved from OriginChain, fed verbatim to the LLM, answer grounded on exactly those chunks.
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?" }