langchain.vectorstores.meilisearch.Meilisearch¶
class langchain.vectorstores.meilisearch.Meilisearch(embedding: Embeddings, client: Optional[Client] = None, url: Optional[str] = None, api_key: Optional[str] = None, index_name: str = 'langchain-demo', text_key: str = 'text', metadata_key: str = 'metadata')[source]¶
Meilisearch vector store.
To use this, you need to have meilisearch python package installed,
and a running Meilisearch instance.
To learn more about Meilisearch Python, refer to the in-depth
Meilisearch Python documentation: https://meilisearch.github.io/meilisearch-python/.
See the following documentation for how to run a Meilisearch instance:
https://www.meilisearch.com/docs/learn/getting_started/quick_start.
Example
from langchain.vectorstores import Meilisearch
from langchain.embeddings.openai import OpenAIEmbeddings
import meilisearch
# api_key is optional; provide it if your meilisearch instance requires it
client = meilisearch.Client(url='http://127.0.0.1:7700', api_key='***')
embeddings = OpenAIEmbeddings()
vectorstore = Meilisearch(
    embedding=embeddings,
    client=client,
    index_name='langchain_demo',
    text_key='text')
Initialize with Meilisearch client.
Attributes
embeddings
Access the query embedding object if available.
Methods
__init__(embedding[, client, url, api_key, ...])
Initialize with Meilisearch client.
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.