The Valori Kernel is the deterministic, event-sourced heart of the system.
It is a no_std compatible Rust library that manages vector storage, graph relationships, and indexing.
All state mutations happen via Kernel Events.
InsertRecord: Adds a vector.DeleteRecord: Soft-deletes a record (tombstone).CreateNode/CreateEdge: Modifies the semantic graph.- Determinism: Replaying the same sequence of events always results in the exact same state hash.
Floating point math is non-deterministic across architectures (x86 vs ARM vs WASM).
Valori uses Q16.16 Fixed Point (i32 wrapper) for all vector operations to ensure bit-perfect consistency everywhere.
The KernelState struct holds the in-memory database.
- Records: Dense storage of vectors.
- Graph: Adjacency list for Nodes and Edges.
- Index: Pluggable vector index (BruteForce or HNSW).
kernel.rs: The main entry point (ValoriKernel).index/: Vector indexing algorithms.storage/: Memory pools for records and nodes.proof/: Merkle tree and hashing for state verification.replay/: Logic to rebuild state from an Event Log.
apply_event(event): The ONLY way to mutate state.search(query, k): Read-only index query.snapshot(): Serializes the entire state to a binary blob.restore(data): Replaces state from a binary blob.
- NO Floating Point: Do not use
f32orf64in core logic. UseFxpScalar. - NO System Time: Time logic must be supplied externally via events.
- NO Randomness: Use deterministic PRNG seeded from the Event Log if needed.
- Crash Safety: The Kernel relies on the
Application Layer(Node) to persist the Event Log (WAL).