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

  1. A map in RAMOnly a compact map of cluster centres and storage offsets is kept in memory.
  2. Vectors on diskCompressed int8 vectors stay on disk, memory-mapped, and are read on demand.
  3. Probe the nearest clustersA query reads only the nearest clusters (32 by default).
  4. Exact re-rankThe best candidates from those clusters are re-ranked exactly.
  5. Live updatesNew facts go to a small in-memory delta until the next rebuild.

Results

SetupSearch timeSearch memorySame as exact
Lab · 60,000 facts30 → 2 ms467 → 82 MB96–100%
Live server · 809 facts16.5 → 6.8 ms55 → 50 MB100%

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