Skip to main content
MemWire generates vector embeddings to store and retrieve memories. Configure the embedding model via MemWireConfig:
from memwire import MemWire, MemWireConfig

config = MemWireConfig(
    model_name="sentence-transformers/all-MiniLM-L6-v2",
    embedding_dim=384,
)
memory = MemWire(config=config)

Supported embedding backends

Two model types are used:
TypePurpose
Dense modelSemantic similarity — powers memory search and recall
Sparse modelKeyword matching — used alongside dense vectors in hybrid search

Default models

from memwire import MemWire, MemWireConfig

# These are the defaults — no config needed unless you want to change them
config = MemWireConfig(
    model_name="sentence-transformers/all-MiniLM-L6-v2",
    embedding_dim=384,
    sparse_model_name="prithivida/Splade_PP_en_v1",
)
memory = MemWire(config=config)
ModelTypeDimensionsNotes
sentence-transformers/all-MiniLM-L6-v2Dense384Fast, multilingual-friendly, good general-purpose baseline
prithivida/Splade_PP_en_v1SparseSPLADE sparse model for hybrid BM25+vector search

Changing the dense model

You can swap the dense model for any FastEmbed-compatible model. Make sure embedding_dim matches the model’s output dimension.
config = MemWireConfig(
    model_name="BAAI/bge-small-en-v1.5",
    embedding_dim=384,
)
config = MemWireConfig(
    model_name="BAAI/bge-base-en-v1.5",
    embedding_dim=768,
)
config = MemWireConfig(
    model_name="BAAI/bge-large-en-v1.5",
    embedding_dim=1024,
)
If you change the embedding model after data has already been stored, the existing vectors will be incompatible with new embeddings. Reset your Qdrant storage when switching models.

If you want to use dense-only search (no sparse model loaded), disable hybrid search:
config = MemWireConfig(
    use_hybrid_search=False,
)

Reranking

Enable a cross-encoder reranker to re-score the top candidates after initial retrieval. This improves precision at the cost of slightly higher latency.
config = MemWireConfig(
    use_reranking=True,
    reranker_model_name="Xenova/ms-marco-MiniLM-L-6-v2",
)

Configuration reference

ParameterDefaultDescription
model_namesentence-transformers/all-MiniLM-L6-v2Dense embedding model. Must be FastEmbed-compatible.
embedding_dim384Output dimension of the dense model. Must match the model.
sparse_model_nameprithivida/Splade_PP_en_v1Sparse model for hybrid BM25+vector search.
use_hybrid_searchTrueCombine dense and sparse vectors. Disable to use dense-only search.
use_rerankingFalseApply a cross-encoder reranker to re-score top candidates.
reranker_model_nameXenova/ms-marco-MiniLM-L-6-v2Cross-encoder reranker model (used when use_reranking=True).
embedding_cache_maxsize10000LRU cache size for embedding vectors. Increase for large-scale workloads.