RAG, Vector Search & Conversational AI Engineering Glossary
Implementation-level technical definitions covering embeddings, cosine similarity, BM25, Reciprocal Rank Fusion, HNSW indexing, prompt-injection defenses, Shadow DOM encapsulation, and Core Web Vitals.
Retrieval-Augmented Generation (RAG) (Architecture)
An AI architecture that retrieves relevant passages from an external, updatable knowledge base at query time and injects them into the language model prompt, grounding answers in verified source documents without retraining model weights.
Dense Vector Embedding (Embeddings)
A fixed-length numerical array (such as 768 or 1,536 floating-point values) produced by an encoder neural network that maps words, sentences, or passages into continuous semantic space where conceptually related texts sit close together.
Cosine Similarity (Retrieval)
A metric measuring the cosine of the angle between two non-zero vectors, ranging from -1 to 1 (or 0 to 1 for normalized text embeddings). Higher cosine similarity indicates stronger semantic alignment between a user query and a document chunk.
Semantic Chunking (Ingestion)
The process of splitting long documents into coherent, self-contained passages (typically 300–800 tokens) along structural boundaries like Markdown headings, paragraphs, and sentences rather than arbitrary character counts.
Sliding Window Overlap (Ingestion)
Repeating a small tail segment (typically 10%–18% of tokens) from the end of Chunk N at the start of Chunk N+1 so conditional clauses and pronoun antecedents across paragraph breaks are never severed from context.
BM25 (Best Matching 25) (Retrieval)
A probabilistic lexical ranking function based on term frequency (TF), inverse document frequency (IDF), and document-length normalization. Excels at matching exact product SKUs, error codes, and proper nouns that dense vectors may blur.
Hybrid Search (Retrieval)
Executing dense vector similarity search and lexical keyword search (BM25) in parallel, then merging both candidate lists into a unified ranking so queries benefit from both conceptual meaning and exact string precision.
Reciprocal Rank Fusion (RRF) (Retrieval)
A calibration-free rank aggregation formula, Score(d) = Σ 1 / (k + rank_i(d)) with smoothing constant k ≈ 60, used to combine heterogeneous BM25 and vector retrieval rankings without fragile score normalization.
HNSW (Hierarchical Navigable Small World) (Retrieval)
A multi-layer graph algorithm for Approximate Nearest Neighbor (ANN) vector search (supported in pgvector and dedicated vector stores) delivering sub-10ms logarithmic query latency at high recall.
Cross-Encoder Reranker (Retrieval)
A secondary transformer model that jointly attends over a (query, candidate_chunk) pair to compute a fine-grained relevance score, re-ordering the top 20–50 retrieved candidates down to the best 4–6 passages before LLM synthesis.
Hallucination (Extrinsic vs. Intrinsic) (Safety & Quality)
When a language model generates plausible-sounding statements unsupported by (extrinsic) or directly contradicting (intrinsic) the provided reference passages—such as inventing a 60-day refund window when policy states 14 days.
Similarity Cutoff Threshold (Safety & Quality)
A minimum relevance score (for example, cosine similarity ≥ 0.65) required before retrieved chunks are accepted as valid grounding context. Queries scoring below the threshold trigger a deterministic refusal or human handoff.
Sampling Temperature (LLM Inference)
A logit-scaling hyperparameter controlling token selection randomness. Support RAG pipelines set temperature near 0.0–0.15 to maximize factual repeatability, whereas creative writing tasks use 0.7–1.0.
Context Window (LLM Inference)
The maximum combined number of input and output tokens a language model can attend to in a single request, encompassing system instructions, retrieved RAG passages, multi-turn chat history, and the generated reply.
Context Rot / Lost-in-the-Middle (LLM Inference)
The empirical degradation in recall accuracy when dozens of noisy or marginally relevant chunks are stuffed into a large context window, diluting attention away from the single authoritative policy passage.
Time to First Token (TTFT) (LLM Inference)
The elapsed milliseconds from when a user submits a chat message until the first streamed response token renders in the widget. Keeping TTFT under 800ms is critical for conversational responsiveness.
Byte-Pair Encoding (BPE) Tokenization (LLM Inference)
The subword segmentation algorithm used by modern LLMs to convert raw UTF-8 strings into integer token IDs. Standard English prose averages roughly 0.75 words (or ~4 characters) per token.
Direct Prompt Injection (Security)
An adversarial input typed directly by a user attempting to override developer system instructions—for example, commanding a retail chatbot to ignore policy rules, reveal its system prompt, or approve unauthorized discounts.
Indirect Prompt Injection (Security)
Hidden adversarial instructions embedded inside external web pages, PDFs, or emails that get ingested into a knowledge base or retrieved at runtime, attempting to hijack the assistant when that passage is loaded into context.
XML Context Sandboxing (Security)
Enclosing retrieved documents and user messages inside distinct structural tags (such as <verified_context> and <user_query>) paired with explicit instruction-hierarchy rules so the LLM treats enclosed strings strictly as passive data.
Shadow DOM Encapsulation (Widget Engineering)
A browser Web Components standard (element.attachShadow) that isolates an embedded chat widget’s DOM subtree and CSS rules from the host website, preventing stylesheet collisions and layout breakage.
Interaction to Next Paint (INP) (Widget Engineering)
Google’s Core Web Vitals responsiveness metric measuring the latency of user clicks, taps, and keystrokes throughout a page’s lifecycle (target ≤ 200ms at the 75th percentile). Lightweight async widgets protect host INP.
Cumulative Layout Shift (CLS) (Widget Engineering)
A Core Web Vitals visual stability metric quantifying unexpected layout movement during page load (target ≤ 0.1). Fixed-position floating chat launchers mounted outside document flow produce zero CLS.
Containment Rate vs. Verified Deflection (Support Economics)
Containment measures the share of chat sessions that end without immediate live-agent transfer (including frustrated drop-offs), whereas Verified Deflection counts only sessions where the customer’s issue was genuinely resolved without a follow-up ticket.
Content Hashing (SHA-256) (Ingestion)
Computing a cryptographic digest of normalized source document text during crawling or upload so unchanged pages skip redundant re-embedding while modified policies trigger immediate chunk replacement.
Parent-Child Document Retrieval (Architecture)
Indexing small, granular child chunks (150–250 tokens) for high-precision vector matching while retrieving the surrounding parent section (600–1,000 tokens) at synthesis time so the LLM receives complete policy context.
RAG Triad Evaluation (Safety & Quality)
A three-part quality audit measuring (1) Context Relevance/Recall (did retrieval find the right chunk?), (2) Grounded Faithfulness (did the LLM stick strictly to that chunk?), and (3) Answer Relevance (did the reply address the user’s actual intent?).
PII Redaction Pre-Filter (Security)
Deterministic pattern and Luhn-checksum scrubbing executed on user chat inputs before logging or third-party LLM transmission to strip payment card numbers, national IDs, and secret tokens.