Milvus Milvus is an open-source vector database that suits AI applications of every size from running a demo chatbot in Jupyter notebook to building web-scale search that serves billions of users.

Usage

import os
from mem0 import Memory

config = {
    "vector_store": {
        "provider": "milvus",
        "config": {
            "collection_name": "test",
            "embedding_model_dims": "123",
            "url": "127.0.0.1",
            "token": "8e4b8ca8cf2c67",
        }
    }
}

m = Memory.from_config(config)
messages = [
    {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
    {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
    {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},
    {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
]
m.add(messages, user_id="alice", metadata={"category": "movies"})

Config

Here’s the parameters available for configuring Milvus Database:

ParameterDescriptionDefault Value
urlFull URL/Uri for Milvus/Zilliz serverhttp://localhost:19530
tokenToken for Zilliz server / for local setup defaults to None.None
collection_nameThe name of the collectionmem0
embedding_model_dimsDimensions of the embedding model1536
metric_typeMetric type for similarity searchL2