Embeddings & Vector Search
Text embeddings convert text into semantic vectors that capture meaning. This allows TruthVouch to understand that “When was TruthVouch founded?” and “What’s TruthVouch’s founding year?” mean the same thing — enabling fast, intelligent fact-checking even when questions are phrased differently.
How TruthVouch Uses Embeddings
1. Neural Cache (L2)
Semantic search via pgvector:
- Query converted to embedding
- Compared against cached truth nugget embeddings
- Sub-10ms retrieval of semantically similar results
2. Hallucination Detection
NLI scoring uses embeddings:
- Premise converted to embedding
- Hypothesis converted to embedding
- Relationship (entailment/neutral/contradiction) determined
- 94%+ accuracy hallucination detection
3. Fact Matching
Finding relevant truth nuggets:
- User query converted to embedding
- Matched against truth nugget embeddings
- Returns top K most relevant facts
4. Query Recommendations
Suggest related queries:
- Current query embedding computed
- Similar past queries found via vector search
- Top related queries recommended
How It Works
TruthVouch automatically generates embeddings for your truth nuggets and incoming AI responses. When a new claim arrives, it’s converted to an embedding and compared against your knowledge base using semantic similarity. This happens in milliseconds, enabling real-time hallucination detection.
Enterprise Customization
For organizations with domain-specific terminology, TruthVouch supports custom embedding models. Contact your account team to configure a model optimized for your industry or specialized knowledge domain.
Next Steps
- Neural Cache: Learn how embeddings power intelligent caching
- Hallucination Detection: Understand the full detection pipeline
- Embeddings Customization: Configure domain-specific embedding models