**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]]¶
Run similarity search with distance asynchronously.
static delete(ids: Optional[List[str]] = None, **kwargs: Any) → bool[source]¶
Delete a Redis entry.
Parameters
ids – List of ids (keys in redis) to delete.
redis_url – Redis connection url. This should be passed in the kwargs
or set as an environment variable: REDIS_URL.
Returns
Whether or not the deletions were successful.
Return type
bool
Raises
ValueError – If the redis python package is not installed.
ValueError – If the ids (keys in redis) are not provided
static drop_index(index_name: str, delete_documents: bool, **kwargs: Any) → bool[source]¶
Drop a Redis search index.
Parameters
index_name (str) – Name of the index to drop.
delete_documents (bool) – Whether to drop the associated documents.
Returns
Whether or not the drop was successful.
Return type
bool
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_existing_index(embedding: Embeddings, index_name: str, schema: Union[Dict[str, str], str, PathLike], key_prefix: Optional[str] = None, **kwargs: Any) → Redis[source]¶
Connect to an existing Redis index.
Example
from langchain_community.vectorstores import Redis
from langchain_community.embeddings import OpenAIEmbeddings