The Zain Alhassani Algorithm: A Disk-First Memory Architecture for Semantic Search on Low-RAM Hardware
AI assistants that learn continuously store each fact as a high-dimensional vector and retrieve facts by semantic similarity. The common design keeps every vector in main memory, so memory use grows with knowledge and quickly exceeds small servers. The Zain Alhassani Algorithm is a disk-first memory architecture: all facts and vectors stay on disk, and main memory holds only a compact map of cluster centres and storage offsets. A query consults the map, reads only the nearest clusters from disk, scores them with 8-bit vectors and re-ranks the best candidates exactly. New facts are searchable immediately. In a test with 60,000 facts it reduced search memory from 467 MB to 82 MB and search time from up to 30 ms to about 2 ms, returning the same best result as exact search in 96–100% of queries. It runs in production as the memory of Ziko Brain on the Jarvice AI platform.
Authors
- zain zain alhassani (ORCID: https://orcid.org/0009-0004-8436-7463)
Institutions
- Digital Science (United States) (US)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-10-26
- DOI
- https://doi.org/10.5281/zenodo.23662046
- Primary Topic
- Information Retrieval and Search Behavior
- Type
- preprint