id
stringlengths
14
15
text
stringlengths
23
2.21k
source
stringlengths
52
97
a4cb4780b09c-2
Redis Readme fileInstalling​pip install redisWe want to use OpenAIEmbeddings so we have to get the OpenAI API Key.import osimport getpassos.environ["OPENAI_API_KEY"] = getpass.getpass("OpenAI API Key:")Example​from langchain.embeddings import OpenAIEmbeddingsfrom langchain.text_splitter import CharacterTextSplitter...
https://python.langchain.com/docs/integrations/vectorstores/redis
a4cb4780b09c-3
= "What did the president say about Ketanji Brown Jackson"results = rds.similarity_search(query)print(results[0].page_content)Redis as Retriever​Here we go over different options for using the vector store as a retriever.There are three different search methods we can use to do retrieval. By default, it will use sema...
https://python.langchain.com/docs/integrations/vectorstores/redis
a4cb4780b09c-4
redis on default port with user "joe", pass "secret" using redis version 6+ ACLsredis_url = "redis://joe:secret@redis/0"# connection to sentinel at localhost with default group mymaster and db 0, no passwordredis_url = "redis+sentinel://localhost:26379"# connection to sentinel at host redis with default port 26379 and ...
https://python.langchain.com/docs/integrations/vectorstores/redis
351c32d9c132-0
DocArrayHnswSearch | 🦜�🔗 Langchain
https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw
351c32d9c132-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKIntegrationsCallbacksChat modelsDocument loadersDocument transformersLLMsMemoryRetrieversText embedding modelsAgent toolkitsToolsVector storesAlibaba Cloud OpenSearchAnalyticDBAnnoyAtlasAwaDBAzure Cognitive SearchCassandraChrom...
https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw
351c32d9c132-2
langchain.text_splitter import CharacterTextSplitterfrom langchain.vectorstores import DocArrayHnswSearchfrom langchain.document_loaders import TextLoaderdocuments = TextLoader("../../../state_of_the_union.txt").load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)docs = text_splitter.split_docu...
https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw
351c32d9c132-3
score is better.docs = db.similarity_search_with_score(query)docs[0] (Document(page_content='Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you’re at it, pass the Disclose Act so Americans can know who is funding our elections. \n\nTonight, I’d li...
https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw
b5d6ec64a74d-0
Hologres | 🦜�🔗 Langchain
https://python.langchain.com/docs/integrations/vectorstores/hologres
b5d6ec64a74d-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKIntegrationsCallbacksChat modelsDocument loadersDocument transformersLLMsMemoryRetrieversText embedding modelsAgent toolkitsToolsVector storesAlibaba Cloud OpenSearchAnalyticDBAnnoyAtlasAwaDBAzure Cognitive SearchCassandraChrom...
https://python.langchain.com/docs/integrations/vectorstores/hologres
b5d6ec64a74d-2
Proxima is a high-performance software library developed by Alibaba DAMO Academy. It allows you to search for the nearest neighbors of vectors. Proxima provides higher stability and performance than similar open source software such as Faiss. Proxima allows you to search for similar text or image embeddings with high t...
https://python.langchain.com/docs/integrations/vectorstores/hologres
b5d6ec64a74d-3
Click here to fast deploy a Hologres cloud instance.#!pip install psycopg2from langchain.embeddings.openai import OpenAIEmbeddingsfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.vectorstores import HologresSplit documents and get embeddings by call OpenAI APIfrom langchain.document_loaders impor...
https://python.langchain.com/docs/integrations/vectorstores/hologres
b5d6ec64a74d-4
while you’re at it, pass the Disclose Act so Americans can know who is funding our elections. Tonight, I’d like to honor someone who has dedicated his life to serve this country: Justice Stephen Breyer—an Army veteran, Constitutional scholar, and retiring Justice of the United States Supreme Court. Justic...
https://python.langchain.com/docs/integrations/vectorstores/hologres
27cac980e0b8-0
Marqo | 🦜�🔗 Langchain
https://python.langchain.com/docs/integrations/vectorstores/marqo
27cac980e0b8-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKIntegrationsCallbacksChat modelsDocument loadersDocument transformersLLMsMemoryRetrieversText embedding modelsAgent toolkitsToolsVector storesAlibaba Cloud OpenSearchAnalyticDBAnnoyAtlasAwaDBAzure Cognitive SearchCassandraChrom...
https://python.langchain.com/docs/integrations/vectorstores/marqo
27cac980e0b8-2
import Marqofrom langchain.document_loaders import TextLoaderfrom langchain.document_loaders import TextLoaderloader = TextLoader("../../../state_of_the_union.txt")documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)docs = text_splitter.split_documents(documents)import marqo#...
https://python.langchain.com/docs/integrations/vectorstores/marqo
27cac980e0b8-3
4 days ago, when I nominated Circuit Court of Appeals Judge Ketanji Brown Jackson. One of our nation’s top legal minds, who will continue Justice Breyer’s legacy of excellence.result_docs = docsearch.similarity_search_with_score(query)print(result_docs[0][0].page_content, result_docs[0][1], sep="\n") Tonight. I ...
https://python.langchain.com/docs/integrations/vectorstores/marqo
27cac980e0b8-4
framework and add more texts through add_texts.The documents that are returned are customised by passing your own function to the page_content_builder callback in the search methods.Multimodal Example​# use a new indexindex_name = "langchain-multimodal-demo"# incase the demo is re-runtry: client.delete_index(index...
https://python.langchain.com/docs/integrations/vectorstores/marqo
27cac980e0b8-5
'result': 'created', 'status': 201}, {'_id': '5142c258-ef9f-4bf2-a1a6-2307280173a0', 'result': 'created', 'status': 201}]}def get_content(res): """Helper to format Marqo's documents into text to be used as page_content""" return f"{res['caption']}: {res['image']}"docsearch = Marqo(client, i...
https://python.langchain.com/docs/integrations/vectorstores/marqo
27cac980e0b8-6
"functions and computing functions into one unit.", }, { "Title": "Telephone", "Description": "A telephone is a telecommunications device that permits two or more users to" "conduct a conversation when they are too far apart to be easily heard directly.", }, ],) ...
https://python.langchain.com/docs/integrations/vectorstores/marqo
27cac980e0b8-7
is a document that is about elephants"]) ['9986cc72-adcd-4080-9d74-265c173a9ec3']query = "modern communications devices"doc_results = docsearch.similarity_search(query)print(doc_results[0].page_content) A smartphone is a portable computer device that combines mobile telephone functions and computing functions int...
https://python.langchain.com/docs/integrations/vectorstores/marqo
27cac980e0b8-8
open("../../../state_of_the_union.txt") as f: state_of_the_union = f.read()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)texts = text_splitter.split_text(state_of_the_union)index_name = "langchain-qa-with-retrieval"docsearch = Marqo.from_documents(docs, index_name=index_name) Index langch...
https://python.langchain.com/docs/integrations/vectorstores/marqo
19cbf1cf0411-0
MyScale | 🦜�🔗 Langchain
https://python.langchain.com/docs/integrations/vectorstores/myscale
19cbf1cf0411-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKIntegrationsCallbacksChat modelsDocument loadersDocument transformersLLMsMemoryRetrieversText embedding modelsAgent toolkitsToolsVector storesAlibaba Cloud OpenSearchAnalyticDBAnnoyAtlasAwaDBAzure Cognitive SearchCassandraChrom...
https://python.langchain.com/docs/integrations/vectorstores/myscale
19cbf1cf0411-2
export MYSCALE_HOST='<your-endpoints-url>' MYSCALE_PORT=<your-endpoints-port> MYSCALE_USERNAME=<your-username> MYSCALE_PASSWORD=<your-password> ...You can easily find your account, password and other info on our SaaS. For details please refer to this documentEvery attributes under MyScaleSettings can be set with prefix...
https://python.langchain.com/docs/integrations/vectorstores/myscale
19cbf1cf0411-3
import MyScale, MyScaleSettingsfrom langchain.document_loaders import TextLoaderloader = TextLoader("../../../state_of_the_union.txt")documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)docs = text_splitter.split_documents(documents)embeddings = OpenAIEmbeddings()for i, d in ...
https://python.langchain.com/docs/integrations/vectorstores/myscale
b9e55ba552b7-0
Rockset | 🦜�🔗 Langchain
https://python.langchain.com/docs/integrations/vectorstores/rockset
b9e55ba552b7-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKIntegrationsCallbacksChat modelsDocument loadersDocument transformersLLMsMemoryRetrieversText embedding modelsAgent toolkitsToolsVector storesAlibaba Cloud OpenSearchAnalyticDBAnnoyAtlasAwaDBAzure Cognitive SearchCassandraChrom...
https://python.langchain.com/docs/integrations/vectorstores/rockset
b9e55ba552b7-2
of this exercise, we will create a collection called langchain_demo. Since Rockset supports schemaless ingest, you don't need to inform us of the shape of metadata for your texts. However, you do need to decide on two columns upfront:Where to store the text. We will use the column description for this.Where to store th...
https://python.langchain.com/docs/integrations/vectorstores/rockset
b9e55ba552b7-3
_input.* EXCEPT(_meta), VECTOR_ENFORCE(_input.description_embedding, #length_of_vector_embedding, 'float') as description_embedding FROM
https://python.langchain.com/docs/integrations/vectorstores/rockset
b9e55ba552b7-4
_input// We used OpenAI text-embedding-ada-002 for this examples, where #length_of_vector_embedding = 1536Now let's install the rockset-python-client. This is used by langchain to talk to the Rockset database.pip install rocksetThis is it! Now you're ready to start writing some python code to store vector embeddings in...
https://python.langchain.com/docs/integrations/vectorstores/rockset
b9e55ba552b7-5
embeddings for the texts, but you're free to use whatever you want.# Make sure the environment variable OPENAI_API_KEY is set upembeddings = OpenAIEmbeddings()docsearch = RocksetDB( client=rockset_client, embeddings=embeddings, collection_name=COLLECTION_NAME, text_key=TEXT_KEY, embedding_key=EMBEDDING_K...
https://python.langchain.com/docs/integrations/vectorstores/rockset
b9e55ba552b7-6
can add filters on text key, or any of the metadata fields. Note: Since Rockset stores each metadata field as a separate column internally, these filters are much faster than other vector databases which store all metadata as a single JSON.For eg, to find all texts NOT containing the substring "and", you can use the fo...
https://python.langchain.com/docs/integrations/vectorstores/rockset
b9e55ba552b7-7
In this example you successfuly created a Rockset collection, inserted documents along with their OpenAI vector embeddings, and searched for similar docs both with and without any metadata filters.Keep an eye on https://rockset.com/blog/introducing-vector-search-on-rockset/ for future updates in this space!PreviousRedi...
https://python.langchain.com/docs/integrations/vectorstores/rockset
fc4eb3d1e28b-0
Cassandra | 🦜�🔗 Langchain
https://python.langchain.com/docs/integrations/vectorstores/cassandra
fc4eb3d1e28b-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKIntegrationsCallbacksChat modelsDocument loadersDocument transformersLLMsMemoryRetrieversText embedding modelsAgent toolkitsToolsVector storesAlibaba Cloud OpenSearchAnalyticDBAnnoyAtlasAwaDBAzure Cognitive SearchCassandraChrom...
https://python.langchain.com/docs/integrations/vectorstores/cassandra
fc4eb3d1e28b-2
# ASTRA_DB_SECURE_BUNDLE_PATH = input("Full path to your Secure Connect Bundle? ")elif database_mode == "C": CASSANDRA_CONTACT_POINTS = input( "Contact points? (comma-separated, empty for localhost) " ).strip()depending on whether local or cloud-based Astra DB, create the corresponding database connecti...
https://python.langchain.com/docs/integrations/vectorstores/cassandra
fc4eb3d1e28b-3
= getpass.getpass("OpenAI API Key:")Creation and usage of the Vector Store​from langchain.embeddings.openai import OpenAIEmbeddingsfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.vectorstores import Cassandrafrom langchain.document_loaders import TextLoaderfrom langchain.document_loaders impor...
https://python.langchain.com/docs/integrations/vectorstores/cassandra
fc4eb3d1e28b-4
print(d.page_content)Or use max_marginal_relevance_search directly:found_docs = docsearch.max_marginal_relevance_search(query, k=2, fetch_k=10)for i, doc in enumerate(found_docs): print(f"{i + 1}.", doc.page_content, "\n")PreviousAzure Cognitive SearchNextChromaPlease provide database connection parameters and secre...
https://python.langchain.com/docs/integrations/vectorstores/cassandra