Large language model (LLM) agents keep information across dialogue turns by storing dense vector embeddings and retrieving them with approximate nearest‑neighbor search. The fruit fly olfactory circuit generates a locality‑sensitive hash (FlyHash) via sparse random projection followed by winner‑take‑all competition, and prior work (Dasgupta et al., 2017) showed that FlyHash preserves neighbor structure per bit better than conventional random‑hyperplane hashing (SimHash). This paper applies FlyHash to LLM agent memory retrieval for the first time and investigates three practitioner‑oriented questions:
- Does the quality advantage hold when the bit budget is matched? Across ten random seeds and four cross‑modal datasets, FlyHash consistently outperforms SimHash, and we identify and fix a previously undocumented comparison pitfall.
- Does the advantage translate into real memory‑size and latency savings, especially against the dense‑vector index HNSW that practitioners use today? At equal bit budgets FlyHash’s codes are longer and slower to compare than SimHash’s, and HNSW dominates both hash methods at typical scales. A sparse‑set comparison we introduce narrows but does not eliminate the naive latency gap, narrowing the practical use‑case of hashing.
- Does the advantage survive when using genuine, non‑circular agent‑memory relevance labels instead of the embedding‑nearest‑neighbor proxy common in the literature? The benefit persists.
We report precise answers to all three questions, including two that temper the headline claim, and release our implementation, a working agent‑memory demo, and a full account of the methodological pitfalls we discovered and corrected.\n\nReview: FlyHash delivers superior retrieval quality over SimHash, yet its larger code size and slower comparison limit practical deployment; it is mainly useful when extreme storage compactness is required and query scale is modest.