Valori: A Deterministic Memory Substrate for AI Systems
Abstract
Valori introduces a deterministic AI memory system using fixed-point arithmetic to ensure bit-identical results across platforms, addressing non-determinism in vector embeddings and similarity search for trustworthy AI.
Modern AI systems rely on vector embeddings stored and searched using floating-point arithmetic. While effective for approximate similarity search, this design introduces fundamental non-determinism: identical models, inputs, and code can produce different memory states and retrieval results across hardware architectures (e.g., x86 vs. ARM). This prevents replayability and safe deployment, leading to silent data divergence that prevents post-hoc verification and compromises audit trails in regulated sectors. We present Valori, a deterministic AI memory substrate that replaces floating-point memory operations with fixed-point arithmetic (Q16.16) and models memory as a replayable state machine. Valori guarantees bit-identical memory states, snapshots, and search results across platforms. We demonstrate that non-determinism arises before indexing or retrieval and show how Valori enforces determinism at the memory boundary. Our results suggest that deterministic memory is a necessary primitive for trustworthy AI systems. The reference implementation is open-source and available at https://github.com/varshith-Git/Valori-Kernel (archived at https://zenodo.org/records/18022660).
Community
Valori: A Deterministic Fixed-Point Vector Kernel
Tags:vector-database, rust, determinism, finance, audit, hnsw, fixed-point, systems-engineering
TL;DR
Floating-point math causes vector search results to drift between ARM (Mac) and x86 (Linux) architectures due to compiler and hardware variances. Valori is a Q16.16 Fixed-Point kernel written in Rust that guarantees bit-exact reproducibility across all hardware platforms, making it the first "Audit-Grade" vector engine for high-stakes AI.
1. The Problem: "The Silent Drift"
Most vector databases (FAISS, Pinecone, Weaviate) rely on hardware-accelerated floating-point arithmetic (f32). While fast, this introduces Non-Determinism:
- Associativity Variance:
(a + b) + c≠a + (b + c)depending on SIMD optimizations. - Architecture Variance: A backtest run on a MacBook (ARM NEON) often yields different nearest neighbors than the live execution on an AWS Server (Intel AVX2).
In RAG pipelines, this is annoying. In High-Frequency Trading or Legal Forensics, this variance is a liability. You cannot audit a probabilistic black box.
2. The Solution: Valori Kernel
Valori is a forensic memory engine built from scratch in Rust. It replaces standard floating-point math with a custom Q16.16 Fixed-Point Arithmetic system inside an HNSW graph.
- Zero Drift: The mathematical operations are integer-based.
1 + 1 = 2on every CPU, forever. - Audit-Ready: Includes a
calculate_state_hash()method that generates a cryptographic fingerprint of the database state. If a single bit changes, the hash breaks. - Crash Proof: Implements a specialized persistence layer with <40ms recovery time (Cold Boot to Full Query) for 50k vector datasets.
3. Benchmarks (Engineering Verification)
Validated on Apple M2 (ARM64) vs Intel Xeon (x86_64).
| Metric | Result | Notes |
|---|---|---|
| Recall@10 | 99.0% | Matches brute-force ground truth. |
| Determinism | 100% | Bit-exact match across architectures. |
| Recovery Time | 35ms | For 50k vectors (Snapshot Load). |
| Latency | ~0.5ms | Per query (Single Thread). |
4. Usage (Rust)
Valori is designed to be embedded directly into high-integrity Rust applications.
Add to Cargo.toml:
[dependencies]
valori_kernel = { git = "https://github.com/varshith-Git/Valori-Kernel" }
Example: Deterministic Ingest & Audit
use valori_kernel::{ValoriKernel, types::FixedPointVector};
fn main() -> anyhow::Result<()> {
// 1. Initialize the Kernel (Q16.16 Math)
let mut kernel = ValoriKernel::new();
// 2. Ingest Data (Manual f32 -> FixedPoint conversion for safety)
let raw_vector = [0.5, -0.2, 0.9, ...]; // 128-dim
// Convert float to Q16.16 integer representation
let mut fixed_arr = [0i32; 128];
for (i, &val) in raw_vector.iter().enumerate() {
fixed_arr[i] = (val * 65536.0) as i32;
}
// Insert with ID=1, Tag=100
kernel.insert(1, FixedPointVector(fixed_arr), 100);
// 3. Search
// Guaranteed to return the exact same ID and Distance on any CPU
let results = kernel.search(&fixed_arr, 5, None)?;
println!("Found neighbors: {:?}", results);
// 4. Generate Forensic Evidence
// This hash proves the database state is identical bit-for-bit
let audit_hash = kernel.graph.calculate_state_hash();
println!("Cryptographic State Signature: {}", audit_hash);
Ok(())
}
5. Who is this for?
- Quant Developers: Who need backtests to match live execution perfectly.
- Systems Engineers: Debugging "Why did the agent say X?" (Eliminate the database as a variable).
- Auditors: Who need to certify AI decision logs using cryptographic proofs.
Citation
If you use Valori in your research, please cite:
@misc
{gudur2025valori,
title={Valori: A Deterministic Fixed-Point Vector Kernel},
author={Gudur, Varshith},
year={2025},
publisher={arXiv},
url={https://arxiv.org/abs/2512.22280}
}
Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper