AIConnect
Air-Gapped Vector Math & Chunking Lab

Vector Similarity & RAG Chunking Visualizer

Explore sliding window token boundaries, tune chunk overlap, and inspect high-dimensional vector similarity distances (Cosine, Dot Product, Euclidean L2) in real time with zero cloud data egress.

Chunking & Retrieval Parameters

Document: ~401 tokens (1788 chars)Chunks: 4
Chunk Size ($N$)256 tokens
64 (Dense)5121024 (Broad)
Chunk Overlap ($K$)20% (~51 tok)
0% (None)20% (Standard)50% (Max)
Simulated User Retrieval Query:
Top-K:
Chunk #4↺ 51 tok overlap
~117 tokensRank #1
Cosine Similarity Score61.0%

Agent (Neha): Our automated fraud monitoring system has initiated a chargeback dispute case number #CB-90821-IN. We have issued a temporary provisional credit of INR 1,21,800 to your primary savings account pending merchant inquiry. [00:01:34] Customer (Rahul): That is a relief. How long will the arbitration review take with Visa network? [00:01:42] Agent (Neha): Standard Visa chargeback resolution requires 7 to 10 business days. You will receive real-time SMS updates. Is there anything else I can help you with today?

Chunk #3↺ 51 tok overlap
~118 tokensRank #2
Cosine Similarity Score52.6%

unauthorized international debit of $1,450.00 USD on my Visa Infinite card at 03:14 AM IST yesterday. The merchant descriptor shows "CloudScale Web Services Dublin". I was asleep at that hour and did not authorize this charge! [00:01:05] Agent (Neha): I completely understand your concern, Mr. Sharma. I have immediately blocked your debit card ending in 4028 to prevent any recurring settlement attempts. [00:01:18] Agent (Neha): Our automated fraud monitoring system has initiated a chargeback dispute case number #CB-90821-IN. We

Chunk #2↺ 51 tok overlap
~118 tokensRank #3
Cosine Similarity Score51.1%

sending a 6-digit OTP to your registered phone. Could you please confirm the verification code? [00:00:29] Customer (Rahul): Sure, the OTP received on SMS is 482910. Also, my PAN ending with 8492B is on file. [00:00:38] Agent (Neha): Thank you, your identity has been successfully authenticated under UIDAI guidelines. How can I assist you with your checking account today? [00:00:48] Customer (Rahul): I noticed an unauthorized international debit of $1,450.00 USD on my Visa Infinite card at 03:14 AM IST yesterday.

Chunk #1
~121 tokens
Cosine Similarity Score50.6%

# Inbound Telephony Session — Branch Customer Support [00:00:02] Agent (Neha): Thank you for calling HDFC Global Priority Banking. My name is Neha. May I have your full name and registered phone number for identity verification? [00:00:11] Customer (Rahul): Hello Neha, yes. My name is Rahul Sharma, and my phone number is +91-98765-43210. [00:00:19] Agent (Neha): Thank you, Mr. Sharma. For two-factor statutory verification, I am sending a 6-digit OTP to your registered phone. Could you please confirm the verification code? [00:00:29]

Source Document Text

Live Reactive Input
Characters: 1788Tokens: ~401

Production RAG Architecture: Chunking Trade-Offs & Vector Distance Metrics

1. Small vs Large Chunks

Small chunks (128–256 tokens) yield sharp semantic precision and pinpoint cosine similarity for factual lookups, but risk fragmenting contextual answers across boundaries. Large chunks (512–1024 tokens) capture complete workflows but dilute embedding density with irrelevant noise.

2. The Role of Chunk Overlap

Sliding window overlap (10% to 25%) ensures boundary sentences are never severed mid-thought. For speech AI transcripts (fine-tuned Whisper v3) and CloudOps logs, overlap guarantees that conversational turns and multi-line tracebacks remain intact.

3. Distance Metrics & Indexing

Cosine similarity evaluates directional angle regardless of document length, making it the industry standard for text RAG. Dot Product requires normalized vectors ($L_2 = 1.0$), while Euclidean distance ($L_2$) measures geometric distance in spatial vector indexes like OpenSearch and pgvector.

Need Enterprise RAG & Vector Search Architecture?

AIConnect designs and deploys high-throughput hybrid RAG pipelines using Amazon OpenSearch Serverless, PostgreSQL pgvector, and automated Iceberg PySpark ETL lakehouses for enterprise swarms.

Schedule Architecture Consultation