Research · Preprint
The Zain Alhassani Algorithm: A Disk-First Memory Architecture for Semantic Search on Low-RAM Hardware
Zain Al-Abdeen Alhassani · Jarvice Digital · ORCID 0009-0004-8436-7463
Published 26 October 2026 on Zenodo · DOI 10.5281/zenodo.23662047
Abstract
Semantic search usually keeps every vector in RAM. This design keeps only a compact map of cluster centres and storage offsets in RAM. The compressed (int8) vectors stay on disk, memory-mapped, and are read on demand. Only the nearest clusters are read, and their best candidates are then re-ranked exactly. On 60,000 facts, search memory fell from 467 MB to 82 MB and search time from up to 30 ms to about 2 ms, matching exact search in 96–100% of queries. The design runs in production in Ziko Brain, the memory behind the Jarvice AI platform.
467 → 82 MBSearch memory (60k facts)
30 → ~2 msSearch time
96–100%Same results as exact search
How it works
- A map in RAMOnly a compact map of cluster centres and storage offsets is kept in memory.
- Vectors on diskCompressed int8 vectors stay on disk, memory-mapped, and are read on demand.
- Probe the nearest clustersA query reads only the nearest clusters (32 by default).
- Exact re-rankThe best candidates from those clusters are re-ranked exactly.
- Live updatesNew facts go to a small in-memory delta until the next rebuild.
Results
| Setup | Search time | Search memory | Same as exact |
|---|---|---|---|
| Lab · 60,000 facts | 30 → 2 ms | 467 → 82 MB | 96–100% |
| Live server · 809 facts | 16.5 → 6.8 ms | 55 → 50 MB | 100% |
Measured on a 2 vCPU / 7.8 GB RAM server.
Cite this work
Alhassani, Z. A. (2026). The Zain Alhassani Algorithm: A Disk-First Memory Architecture for Semantic Search on Low-RAM Hardware. Zenodo. https://doi.org/10.5281/zenodo.23662047
Details
- Author
- Zain Al-Abdeen Alhassani (ORCID)
- Affiliation
- Jarvice Digital, Baghdad, Iraq
- Type
- Preprint, v1
- DOI
- 10.5281/zenodo.23662047
- Licence
- CC BY 4.0
- Keywords
- semantic search, vector search, disk-first memory architecture, memory-mapped index, int8 quantization, low-RAM hardware, Ziko Brain