Skip to content

Embeddings

Remem generates embeddings locally using fastembed with the all-MiniLM-L6-v2 model, inside the remem-server process.

PropertyValue
Modelall-MiniLM-L6-v2
Dimensions384
Similarity metricCosine
InferenceCPU, local, in-process

The model is configured via the [embedding] section of remem-server.toml:

[embedding]
model = "all-MiniLM-L6-v2"
cache_size = 10000 # embeddings kept in LRU cache

No internet connection is required at runtime, no external embedding API, no per-query cost. dimension in [vector] must match the embedding model’s output size — changing [embedding].model to a different model requires updating [vector].dimension to match, and requires reindexing existing data.

  • On store_memory — the content is embedded and the vector is stored in the HNSW index
  • On search_memories with search_type: "semantic" or search_type: "hybrid" — the query is embedded at search time

Auto-discovery of connections between memories is controlled by the [connections] section of remem-server.toml, not an environment variable:

[connections]
auto_discovery_threshold = 0.7 # minimum similarity to auto-link two memories
auto_discovery_top_k = 5 # max auto-created connections per new memory

When a memory is stored, its embedding is compared against existing memories; pairs with cosine similarity at or above auto_discovery_threshold get linked, capped at auto_discovery_top_k new edges per memory. This runs on a background worker, so store_memory returns before discovery completes.

Lower values create denser graphs with more loose connections. Higher values create sparser graphs with only strong connections.

For long documents, consider:

  • Storing paragraph-level chunks as separate memories and linking them with part_of connections
  • Summarising the content and storing the summary as the memory content