In this example Locality Sensitive Hashing (LSH) is used in 2 different ways to create a reasonably fast and potentially very large associative memory bank.
You can think of it as a soft vector to vector hash table. The input vector does not have to be exactly correct to get an approximately correct response. Making it easier for a neural network to learn how to use it as an external memory bank.
First a LSH is used to select a few weight vectors among many. Then the chosen weight vectors are combined with further LSHs of the input vector to create the associations.
Large scale associative memory:
https://s6regen.github.io/Block-Associative-Memory/
The JavaScript code is in the docs folder here: