Real RuVector, running in this tab
VectorDB from @ruvector/wasm 0.2.1: HNSW index, cosine distance, 32 dimensions.
- Every experience is a real
insert(vector, id, metadata).
- Every risk estimate is a real
search(query, k=8). The memory panel shows the live count and the average time per search. Browsers round single timings to 0.1 ms, so only the average is meaningful.
- Power cycle uses
saveToIndexedDB() and VectorDB.loadFromIndexedDB(). A page reload uses them too.
- Chapter 4 runs RuVector's SONA engine (built from source): each episode becomes a trajectory (
startTrajectory, endTrajectory), forceLearn() clusters them with the ReasoningBank (k-means++), and findPatterns() returns the patterns. A second VectorDB stores the patterns. SONA's MicroLoRA and EWC++ are not used: their effect here was too small to matter.
The only JavaScript "learning" code
Risk = similarity-weighted average of the outcomes of the 8 neighbours that RuVector returns. Floor that resembles nothing in memory gets risk 0, so only real incidents create risk. The planner adds risk × 80 to a cell's cost, plus 25% of a neighbouring cell's risk as a safety margin for the robot's width.
A pass over a cell is stored as "safe" only if the robot drove it at operating speed (above 0.8 m/s) and was not recovering from an incident. Slow or recovering passes prove nothing, so they are not stored.