VerityNgn Technical Architecture
Version 2.0 - Updated with Intelligent Segmentation and Enhanced Claims Extraction
Table of Contents
- Overview
- Intelligent Video Segmentation System
- Enhanced Claims Extraction Pipeline
- Counter-Intelligence Integration
- Model Specifications
- Token Economics
- Performance Benchmarks
Overview
VerityNgn v2.0 introduces a context-aware video segmentation system that optimizes API calls by maximizing utilization of the 1M token context window available in Gemini 2.5 Flash. This architectural improvement reduces API calls by up to 86% for typical videos while maintaining full analysis quality.Key Architecture Improvements in v2.0
| Component | v1.0 | v2.0 | Improvement |
|---|---|---|---|
| Segmentation | Fixed 5-minute segments | Intelligent context-aware | 86% fewer API calls |
| Context Usage | ~3% utilization | ~58% utilization | 19x improvement |
| Claims Extraction | Single-pass | Multi-pass with scoring | Higher quality claims |
| Processing Time (33-min video) | 56-84 minutes | 8-12 minutes | 6-7x faster |
Intelligent Video Segmentation System
Design Philosophy
The segmentation system maximizes use of available context window while maintaining safety margins and accounting for all token consumption sources.Token Consumption Rate
- Captures all visual content changes
- Sufficient for OCR and visual analysis
- Balances quality with token efficiency
- Tested extensively on health/supplement videos
Context Window Budget Calculation
For Gemini 2.5 Flash:Optimal Segment Duration Formula
Example Calculations
Gemini 2.5 Flash (1M Context)
| Video Duration | Optimal Segments | Segment Duration | Context Utilization |
|---|---|---|---|
| 10 minutes | 1 segment | 10 min | 21% |
| 20 minutes | 1 segment | 20 min | 42% |
| 33 minutes | 1 segment | 33 min | 58% ✅ |
| 60 minutes | 2 segments | 30 min each | 53% per segment |
| 120 minutes | 3 segments | 40 min each | 70% per segment |
Gemini 1.5 Pro (2M Context)
Implementation: verityngn/config/video_segmentation.py
The video segmentation module provides:
Core Functions:
Integration: verityngn/workflows/analysis.py
The analysis workflow automatically:
- Retrieves video duration from metadata
- Calculates optimal segment duration
- Logs segmentation plan with expected time
- Processes segments with progress updates
- Combines segment outputs into comprehensive analysis
Enhanced Claims Extraction Pipeline
Multi-Pass Extraction System
Claim Specificity Scoring
Algorithm:| Claim | Specificity Score | Reasoning |
|---|---|---|
| ”Lipozem causes 15 pounds of weight loss in 30 days” | 90 | Specific number, timeframe |
| ”Product improves health” | 20 | Vague, no metrics |
| ”Study suggests potential benefits” | 30 | Hedging, no specifics |
| ”60% of users reported improvement” | 85 | Specific percentage |
Absence Claim Generation
Purpose: Identify what’s NOT mentioned but should be for credibility. Algorithm:Claim Type Classification
Claims are classified into types for appropriate verification strategies:- Scientific: References studies, research, mechanisms
- Statistical: Percentages, measurements, data
- Causal: Cause-effect relationships
- Comparative: Better/worse than alternatives
- Testimonial: User experiences, anecdotes
- Expert Opinion: Authority-based claims
Counter-Intelligence Integration
Balanced Impact Model (v2.0)
Refined from v1.0: YouTube review influence reduced from -0.35 to -0.20 Reasoning:- Reviews provide counter-perspective but aren’t authoritative
- Balance between skepticism and over-correction
- Maintained 94% precision on press release detection
- Counter-intel searches run in parallel with evidence gathering
- No impact on segmentation calculation
- Results integrated into final probability calculation
Model Specifications
Supported Models
| Model | Context Window | Max Output | Best For |
|---|---|---|---|
| Gemini 2.5 Flash | 1M tokens | 65K tokens | Default (fast + large output) |
| Gemini 1.5 Pro | 2M tokens | 8K tokens | Very long videos |
| Gemini 1.5 Flash | 1M tokens | 8K tokens | Budget-conscious |
Selection Criteria
Use Gemini 2.5 Flash when:- Video < 48 minutes (single segment)
- Need detailed claim extraction (large output)
- Default choice for most cases ✅
- Video > 100 minutes (requires larger context)
- Budget not a primary concern
- Need maximum context window
Token Economics
Cost Comparison: v1.0 vs v2.0
Example: 33-minute LIPOZEM videov1.0 (Fixed 5-minute segments)
v2.0 (Intelligent segmentation)
Cost Impact
Assuming Gemini 2.5 Flash pricing:| Metric | v1.0 | v2.0 | Savings |
|---|---|---|---|
| API Calls | 7 | 1 | 86% |
| Total Tokens | 630K | 579K | 8% |
| Processing Time | 56-84 min | 8-12 min | 85% |
Performance Benchmarks
Processing Time (Gemini 2.5 Flash)
| Video Length | v1.0 Time | v2.0 Time | Speedup |
|---|---|---|---|
| 10 minutes | 16-24 min | 8-12 min | 2x |
| 20 minutes | 32-48 min | 8-12 min | 4x |
| 33 minutes | 56-84 min | 8-12 min | 6-7x |
| 60 minutes | 96-144 min | 16-24 min | 6x |
API Call Reduction
| Video Length | v1.0 Calls | v2.0 Calls | Reduction |
|---|---|---|---|
| 10 minutes | 2 | 1 | 50% |
| 20 minutes | 4 | 1 | 75% |
| 33 minutes | 7 | 1 | 86% |
| 60 minutes | 12 | 2 | 83% |
| 120 minutes | 24 | 3 | 88% |
Context Window Utilization
v1.0: Average 3% utilization (massive waste) v2.0: Average 40-60% utilization for typical videos (optimal range) Why not 100%?- 10% safety margin prevents edge case failures
- Output token reservation necessary for detailed extraction
- Prompt overhead accounts for instructions and metadata
Configuration
Environment Variables
Programmatic Configuration
Future Work
Planned Enhancements
- Adaptive FPS: Adjust frame rate based on video content complexity
- Multi-Model Support: Seamless switching between Claude, GPT-4, Gemini
- Dynamic Context Allocation: Reserve more/less output tokens based on claim density
- Segment Overlap: Small overlaps to catch boundary context
- Parallel Processing: Process independent segments simultaneously
Research Directions
- Optimal safety margin sizing through empirical testing
- Content-aware segmentation (scene change detection)
- Compression techniques for repeated visual content
- Integration with vision-only models (lower token cost)
References
- Main Research Paper
- Intelligent Segmentation Technical Paper
- Video Segmentation Module Source
- Analysis Workflow Source
Last Updated: October 28, 2025
Version: 2.0
Author: VerityNgn Research Team
