the vector distance that can be returnedresults = rds.similarity_search_with_score("foo", k=5, distance_threshold=0.1)for result in results:    print(f"Content: {result[0].page_content} --- Score: {result[1]}")    Content: foo --- Score: 0.0    Content: foo --- Score: 0.0    Content: foo --- Score: 0.0# with scoresresults = rds.similarity_search_with_relevance_scores("foo", k=5)for result in results:    print(f"Content: {result[0].page_content} --- Similiarity: {result[1]}")    Content: foo --- Similiarity: 1.0    Content: foo --- Similiarity: 1.0    Content: foo --- Similiarity: 1.0    Content: bar --- Similiarity: 0.8434    Content: bar --- Similiarity: 0.8434# limit scores (similarities have to be over .9)results = rds.similarity_search_with_relevance_scores("foo", k=5, score_threshold=0.9)for result in results:    print(f"Content: {result[0].page_content} --- Similarity: {result[1]}")    Content: foo --- Similarity: 1.0    Content: foo --- Similarity: 1.0    Content: foo --- Similarity: 1.0# you can also add new documents as followsnew_document = ["baz"]new_metadata = [{    "user": "sam",    "age": 50,    "job": "janitor",    "credit_score": "high"}]# both the document and metadata must be listsrds.add_texts(new_document, new_metadata)    ['doc:users:b9c71d62a0a34241a37950b448dafd38']# now query the new documentresults = rds.similarity_search("baz", k=3)print(results[0].metadata)    {'id': 'doc:users:b9c71d62a0a34241a37950b448dafd38', 'user': 'sam', 'job': 'janitor', 'credit_score': 'high', 'age': '50'}# use maximal marginal relevance search to diversify resultsresults = rds.max_marginal_relevance_search("foo")# the lambda_mult parameter controls the diversity of the results, the lower the more diverseresults = rds.max_marginal_relevance_search("foo", lambda_mult=0.1)Connect to an Existing Indexâ€‹In order to have the same metadata indexed when using the Redis VectorStore. You will need to have the same index_schema passed in either as a path to a yaml file or
Redis vector database introduction and langchain integration guide.
Redis vector database introduction and langchain integration guide. ->: the vector distance that can be returnedresults = rds.similarity_search_with_score("foo", k=5, distance_threshold=0.1)for result in results:    print(f"Content: {result[0].page_content} --- Score: {result[1]}")    Content: foo --- Score: 0.0    Content: foo --- Score: 0.0    Content: foo --- Score: 0.0# with scoresresults = rds.similarity_search_with_relevance_scores("foo", k=5)for result in results:    print(f"Content: {result[0].page_content} --- Similiarity: {result[1]}")    Content: foo --- Similiarity: 1.0    Content: foo --- Similiarity: 1.0    Content: foo --- Similiarity: 1.0    Content: bar --- Similiarity: 0.8434    Content: bar --- Similiarity: 0.8434# limit scores (similarities have to be over .9)results = rds.similarity_search_with_relevance_scores("foo", k=5, score_threshold=0.9)for result in results:    print(f"Content: {result[0].page_content} --- Similarity: {result[1]}")    Content: foo --- Similarity: 1.0    Content: foo --- Similarity: 1.0    Content: foo --- Similarity: 1.0# you can also add new documents as followsnew_document = ["baz"]new_metadata = [{    "user": "sam",    "age": 50,    "job": "janitor",    "credit_score": "high"}]# both the document and metadata must be listsrds.add_texts(new_document, new_metadata)    ['doc:users:b9c71d62a0a34241a37950b448dafd38']# now query the new documentresults = rds.similarity_search("baz", k=3)print(results[0].metadata)    {'id': 'doc:users:b9c71d62a0a34241a37950b448dafd38', 'user': 'sam', 'job': 'janitor', 'credit_score': 'high', 'age': '50'}# use maximal marginal relevance search to diversify resultsresults = rds.max_marginal_relevance_search("foo")# the lambda_mult parameter controls the diversity of the results, the lower the more diverseresults = rds.max_marginal_relevance_search("foo", lambda_mult=0.1)Connect to an Existing Indexâ€‹In order to have the same metadata indexed when using the Redis VectorStore. You will need to have the same index_schema passed in either as a path to a yaml file or