Ask a question to get started
Enter to send•Shift+Enter new line
Annoy( self, embedding_function: Callable, index: Any, metric: str, docstore:
VectorStore
Turns annoy results into a list of documents and scores.
Return docs most similar to query.
Return docs most similar to embedding vector.
Return docs most similar to docstore_index.
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents.
Construct Annoy wrapper from raw documents.
Construct Annoy wrapper from embeddings.
Save Annoy index, docstore, and index_to_docstore_id to disk.
Load Annoy index, docstore, and index_to_docstore_id to disk.
Annoy vector store.
Annoy
To use, you should have the annoy python package installed.
annoy
Example:
.. code-block:: python
from langchain_community.vectorstores import Annoy db = Annoy(embedding_function, index, docstore, index_to_docstore_id)