Verification Engines
QWED provides 8 specialized verification engines, each using deterministic methods first and LLM only as fallback.
Engine Overview
| Engine | Technology | Key Features |
|---|---|---|
| Math | SymPy + Decimal | Calculus, Matrix ops, NPV/IRR, Statistics |
| Logic | Z3 Theorem Prover | ForAll/Exists quantifiers, BitVectors, Arrays |
| Code | Multi-Lang AST | Python, JavaScript, Java, Go security analysis |
| SQL | SQLGlot AST | Complexity limits, Cost estimation, Schema validation |
| Stats | Wasm/Docker Sandbox | Secure code execution with AST validation |
| Fact | TF-IDF + NLP | Semantic similarity, Entity matching, Citations |
| Image | Deterministic + VLM | Metadata extraction, Size verification, Multi-VLM |
| Reasoning | Multi-LLM + Cache | Chain-of-thought validation, Result caching |
Deterministic-First Philosophy
All engines now follow a deterministic-first approach:
- Try deterministic methods first (100% reproducible)
- Fall back to LLM only when necessary
- Discount LLM confidence when used
# Example: Fact verification is now deterministic!
result = client.verify_fact(
claim="Paris is in France",
context="Paris is the capital of France."
)
# Uses TF-IDF similarity + entity matching
# No LLM needed for most claims!
Engine Selection
QWED auto-detects the appropriate engine:
| Content Pattern | Detected Engine |
|---|---|
2+2=4, sqrt(16), derivative | Math |
(AND ...), ForAll, Exists | Logic |
SELECT, INSERT, DROP | SQL |
```python, import, function | Code |
| Claims with context | Fact |
| Image bytes + claim | Image |
Or specify explicitly:
result = client.verify(query, type="math")
Engine Documentation
Deterministic Engines
- Math Engine - Calculus, Matrix, Financial
- Logic Engine - Quantifiers, Theorem Proving
- Code Engine - Multi-language Security
- SQL Engine - Complexity Limits
Data Verification Engines
- Stats Engine - Wasm Sandbox Execution
- Fact Engine - TF-IDF + Citations
- Image Engine - Deterministic Verification
Orchestration Engines
- Reasoning Engine - Multi-LLM Validation
- Consensus Engine - Parallel Execution