id
stringlengths
14
15
text
stringlengths
17
2.72k
source
stringlengths
47
115
14b25052c0d4-0
HuggingFace Hub Tools Huggingface Tools that supporting text I/O can be loaded directly using the load_huggingface_tool function. # Requires transformers>=4.29.0 and huggingface_hub>=0.14.1 pip install --upgrade transformers huggingface_hub > /dev/null from langchain.agents import load_huggingface_tool tool = load_hug...
https://python.langchain.com/docs/integrations/tools/huggingface_tools
0d65d6eae836-0
This notebook shows how to use IFTTT Webhooks. import os key = os.environ["IFTTTKey"] url = f"https://maker.ifttt.com/trigger/spotify/json/with/key/{key}" tool = IFTTTWebhook( name="Spotify", description="Add a song to spotify playlist", url=url )
https://python.langchain.com/docs/integrations/tools/ifttt
304a79fd759c-0
Human are AGI so they can certainly be used as a tool to help out AI agent when it is confused. from langchain.chat_models import ChatOpenAI from langchain.llms import OpenAI from langchain.agents import load_tools, initialize_agent from langchain.agents import AgentType llm = ChatOpenAI(temperature=0.0) math_llm = Op...
https://python.langchain.com/docs/integrations/tools/human_tools
304a79fd759c-1
Observation: oh who said it Thought:I can use DuckDuckGo Search to find out who said the quote Action: DuckDuckGo Search Action Input: "Who said 'Veni, vidi, vici'?"
https://python.langchain.com/docs/integrations/tools/human_tools
304a79fd759c-2
Action Input: "Who said 'Veni, vidi, vici'?" Observation: Updated on September 06, 2019. "Veni, vidi, vici" is a famous phrase said to have been spoken by the Roman Emperor Julius Caesar (100-44 BCE) in a bit of stylish bragging that impressed many of the writers of his day and beyond. The phrase means roughly "I came,...
https://python.langchain.com/docs/integrations/tools/human_tools
304a79fd759c-3
Thought:I now know the final answer Final Answer: Julius Caesar said the quote "Veni, vidi, vici" which means "I came, I saw, I conquered".
https://python.langchain.com/docs/integrations/tools/human_tools
304a79fd759c-4
> Finished chain. 'Julius Caesar said the quote "Veni, vidi, vici" which means "I came, I saw, I conquered".'
https://python.langchain.com/docs/integrations/tools/human_tools
982e9bec6863-0
Lemon Agent Lemon Agent helps you build powerful AI assistants in minutes and automate workflows by allowing for accurate and reliable read and write operations in tools like Airtable, Hubspot, Discord, Notion, Slack and Github. See full docs here. Most connectors available today are focused on read-only operations, li...
https://python.langchain.com/docs/integrations/tools/lemonai
982e9bec6863-1
"tools": ["hackernews-get-user", "airtable-append-data"] } ] Your model will have access to these functions and will prefer them over self-selecting tools to solve a given task. All you have to do is to let the agent know that it should use a given function by including the function name in the prompt. Include Lemon AI...
https://python.langchain.com/docs/integrations/tools/lemonai
982e9bec6863-2
""" Define your instruction to be given to your LLM """ prompt = f"""Read information from Hackernews for user {hackernews_username} and then write the results to Airtable (baseId: {airtable_base_id}, tableId: {airtable_table_id}). Only write the fields "username", "karma" and "created_at_i". Please make sure that Airt...
https://python.langchain.com/docs/integrations/tools/lemonai
ad082c112c62-0
Metaphor is a search engine fully designed to be used by LLMs. You can search and then get the contents for any page. This notebook goes over how to use Metaphor search. First, you need to set up the proper API keys and environment variables. Get 1000 free searches/month here. Then enter your API key as an environment ...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-1
SearchResponse(results=[Result(title='A Search Engine for Machine Intelligence', url='https://bellow.ai/', id='bdYc6hvHww_JvLv9k8NhPA', score=0.19460266828536987, published_date='2023-01-01', author=None, extract=None), Result(title='Adept: Useful General Intelligence', url='https://www.adept.ai/', id='aNBppxBZvQRZMov6...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-2
extract=None), Result(title='AI.XYZ', url='https://www.ai.xyz/', id='A5c1ePEvsaQeml2Kui_-vA', score=0.1797989457845688, published_date='2023-01-01', author=None, extract=None), Result(title='Halist AI', url='https://halist.ai/', id='-lKPLSb4N4dgMZlTgoDvJg', score=0.17975398898124695, published_date='2023-03-01', author...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-3
Invoking: `get_contents` with `{'ids': ['bdYc6hvHww_JvLv9k8NhPA', 'aNBppxBZvQRZMov6sFVj9g', 'jieb6sB53mId3EDo0z-SDw', 'kUiCuCjJYMD4N0NXdCtqlQ', '45iSS8KnJ9tL1ilPg3dL9A', 'nCoPMUtqWQqhUvsdTjJT6A', 'Zy0YaekZdd4rurPQKkys7A', 'A5c1ePEvsaQeml2Kui_-vA', '-lKPLSb4N4dgMZlTgoDvJg', '_XIjx1YLPfI4cKePIEc_bQ']}`
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-4
GetContentsResponse(contents=[DocumentContent(id='bdYc6hvHww_JvLv9k8NhPA', url='https://bellow.ai/', title='A Search Engine for Machine Intelligence', extract="<div><div><h2>More Opinions</h2><p>Get responses from multiple AIs</p><p>Don't rely on a single source of truth, explore the full space of machine intelligence ...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-5
preferred CRM vendor into our custom system. You have full control over <strong>how</strong> and <strong>when</strong> we get tickets.</p></div><p></p></div><div><p></p><div><h3>Pay per resolution</h3><p>We charge for each conversation we solve. No onboarding fees. No hourly rates. Pay for what you use.</p></div></div>...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-6
and reduces churn.</p><p>â\x80\x8d<strong>No setup, no learning curve, just plug it in and go.</strong></p></div></div><div><div><p></p><div><p>â\x80\x9cIâ\x80\x99m able to better manage the team because I can pinpoint gaps in the teamâ\x80\x99s knowledge or training, and find room for process improvements.â\x80\x9d</p...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-7
url='https://www.sidekickai.co/', title='Sidekick AI | Customer Service Automated', extract='<div><div><div><div><div><div><div><p>Hi, I am an AI named Jenny, working at Pizza Planet. How can I help you today?</p></div><div><p>How much are large pizzas with 1 topping?</p></div><div><p>For most toppings, a large with on...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-8
Sidekick takes an omnichannel approach to customer service, aggregating all customer interactions across all platforms in one area. Currently most social media platforms are supported, along with website embeddings and API integration.\n </p><div><div><div><p>On the web.</p><div><p>Sidekick makes adding a live chat to ...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-9
"23874",\n "body": "How much is a large 2 topping?"\n}</pre></div></div><div><p>Sample Response</p><div><pre>{\n "response": "A large'), DocumentContent(id='Zy0YaekZdd4rurPQKkys7A', url='https://www.hebbia.ai/', title='Hebbia - Search, Reinvented', extract="<div><div><h2>Direct to the point <br />with cutting-edge AI.<...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-10
\n \n \n <p></p>\n \n </div><div><p>\n</p><h2><strong>Tackles info<br />overload</strong></h2>\n<p></p></div><div><p>\n</p><h4>“Like ChatGPT, but way more proactive and useful because it’s designed by me, for only me”</h4>\n<p></p></div><div>\n \n \n \n <p></p>\n \n </div><div><p>\n</p><h2><strong>Never sits<br />aroun...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-11
AI to know.</h4>\n</div><div>\n \n \n \n <p></p>\n \n </div><div>\n<p><strong>STEP THREE</strong></p><h2><strong>Get started</strong></h2><h4>Ask your AI to help you with ideas and support throughout your day. Eventually it will be able to proactively support you.</h4>\n</div><div>\n \n \n \n <p></p>\n \n </div></div>\...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-12
Airin clones how your top expert solves problems in as little as 2 hours. Airin creates an AI companion for the rest of your team by focusing on the patterns in your expert’s questions and hypotheses, not their answers. <a href="/how-it-works">Learn how it works </a></p></div></section><section><div><p> Your customers,...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-13
1. [Bellow AI](https://bellow.ai/): This startup provides a search engine for machine intelligence. It allows users to get responses from multiple AIs, exploring the full space of machine intelligence and getting highly tailored results. 2. [Adept AI](https://www.adept.ai/): Adept is focused on creating useful general...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-14
"Here are some of the hottest AI agent startups and what they do:\n\n1. [Bellow AI](https://bellow.ai/): This startup provides a search engine for machine intelligence. It allows users to get responses from multiple AIs, exploring the full space of machine intelligence and getting highly tailored results.\n\n2. [Adept ...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-15
This is the old way of using Metaphor - through our own in-house integration. results takes in a Metaphor-optimized search query and a number of results (up to 500). It returns a list of results with title, url, author, and creation date. [{'title': 'Core Views on AI Safety: When, Why, What, and How', 'url': 'https://w...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-16
'url': 'https://forum.effectivealtruism.org/posts/uGDCaPFaPkuxAowmH/anthropic-core-views-on-ai-safety-when-why-what-and-how', 'author': 'Jonmenaster', 'published_date': '2023-03-09'}, {'title': "[Linkpost] Sam Altman's 2015 Blog Posts Machine Intelligence Parts 1 & 2 - LessWrong", 'url': 'https://www.lesswrong.com/post...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-17
end_crawl_date: Optional[str] - "Crawl date" refers to the date that Metaphor discovered a link, which is more granular and can be more useful than published date. If endCrawlDate is specified, results will only include links that were crawled before end_crawl_date. Must be specified in ISO 8601 format (YYYY-MM-DDTHH:M...
https://python.langchain.com/docs/integrations/tools/metaphor_search
ad082c112c62-18
llm = ChatOpenAI(model_name="gpt-4", temperature=0.7) metaphor_tool = MetaphorSearchResults(api_wrapper=search) agent_chain = initialize_agent( [metaphor_tool, extract_text, navigate_tool], llm, agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION, verbose=True, ) agent_chain.run( "find me an interesting twee...
https://python.langchain.com/docs/integrations/tools/metaphor_search
92d83e5bf24c-0
Alibaba Cloud OpenSearch Alibaba Cloud Opensearch is a one-stop platform to develop intelligent search services. OpenSearch was built on the large-scale distributed search engine developed by Alibaba. OpenSearch serves more than 500 business cases in Alibaba Group and thousands of Alibaba Cloud customers. OpenSearch he...
https://python.langchain.com/docs/integrations/vectorstores/alibabacloud_opensearch
92d83e5bf24c-1
embeddings = OpenAIEmbeddings() Create opensearch settings. settings = AlibabaCloudOpenSearchSettings( endpoint="The endpoint of opensearch instance, You can find it from the console of Alibaba Cloud OpenSearch.", instance_id="The identify of opensearch instance, You can find it from the console of Alibaba Cloud OpenSe...
https://python.langchain.com/docs/integrations/vectorstores/alibabacloud_opensearch
92d83e5bf24c-2
# for example # settings = AlibabaCloudOpenSearchSettings( # endpoint="ha-cn-5yd39d83c03.public.ha.aliyuncs.com", # instance_id="ha-cn-5yd39d83c03", # datasource_name="ha-cn-5yd39d83c03_test", # username="this is a user name", # password="this is a password", # embedding_index_name="index_embedding", # field_name_mappi...
https://python.langchain.com/docs/integrations/vectorstores/alibabacloud_opensearch
3617eeab04e4-0
Activeloop Deep Lake Activeloop Deep Lake as a Multi-Modal Vector Store that stores embeddings and their metadata including text, Jsons, images, audio, video, and more. It saves the data locally, in your cloud, or on Activeloop storage. It performs hybrid search including embeddings and their attributes. This notebook ...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
3617eeab04e4-1
tensor htype shape dtype compression ------- ------- ------- ------- ------- embedding embedding (42, 1536) float32 None id text (42, 1) str None metadata json (42, 1) str None text text (42, 1) str None To disable dataset summary printings all the time, you can specify verbose=False during VectorStore initiali...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
3617eeab04e4-2
qa = RetrievalQA.from_chain_type( llm=OpenAIChat(model="gpt-3.5-turbo"), chain_type="stuff", retriever=db.as_retriever(), ) /home/ubuntu/langchain_activeloop/langchain/libs/langchain/langchain/llms/openai.py:786: UserWarning: You are trying to use a chat model. This way of initializing it is no longer supported. Instea...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
3617eeab04e4-3
[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 like to honor someone who has dedicated his life to serve this country: Justic...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
3617eeab04e4-4
Document(page_content='Tonight, I’m announcing a crackdown on these companies overcharging American businesses and consumers. \n\nAnd as Wall Street firms take over more nursing homes, quality in those homes has gone down and costs have gone up. \n\nThat ends on my watch. \n\nMedicare is going to set higher standards f...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
3617eeab04e4-5
Document(page_content='A former top litigator in private practice. A former federal public defender. And from a family of public school educators and police officers. A consensus builder. Since she’s been nominated, she’s received a broad range of support—from the Fraternal Order of Police to former judges appointed by...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
3617eeab04e4-6
Document(page_content='And for our LGBTQ+ Americans, let’s finally get the bipartisan Equality Act to my desk. The onslaught of state laws targeting transgender Americans and their families is wrong. \n\nAs I said last year, especially to our younger transgender Americans, I will always have your back as your President...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
3617eeab04e4-7
Document(page_content='Tonight, I’m announcing a crackdown on these companies overcharging American businesses and consumers. \n\nAnd as Wall Street firms take over more nursing homes, quality in those homes has gone down and costs have gone up. \n\nThat ends on my watch. \n\nMedicare is going to set higher standards f...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
3617eeab04e4-8
Document(page_content='And for our LGBTQ+ Americans, let’s finally get the bipartisan Equality Act to my desk. The onslaught of state laws targeting transgender Americans and their families is wrong. \n\nAs I said last year, especially to our younger transgender Americans, I will always have your back as your President...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
3617eeab04e4-9
docs = text_splitter.split_documents(documents) embedding = OpenAIEmbeddings() db = DeepLake(dataset_path=dataset_path, embedding=embeddings, overwrite=True) ids = db.add_documents(docs) Your Deep Lake dataset has been successfully created! Dataset(path='hub://adilkhan/langchain_testing_python', tensors=['embeddin...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
3617eeab04e4-10
docs = text_splitter.split_documents(documents) embedding = OpenAIEmbeddings() db = DeepLake( dataset_path=dataset_path, embedding=embeddings, overwrite=True, runtime={"tensor_db": True}, ) ids = db.add_documents(docs) Your Deep Lake dataset has been successfully created! | Dataset(path='hub://adilkhan/langchain_te...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
3617eeab04e4-11
Evaluating ingest: 100%|██████████| 1/1 [00:10<00:00 \ Dataset(path='s3://hub-2.0-datasets-n/langchain_test', tensors=['embedding', 'ids', 'metadata', 'text']) tensor htype shape dtype compression ------- ------- ------- ------- ------- embedding generic (4, 1536) float32 None ids text (4, 1) str None metadata jso...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
3617eeab04e4-12
This dataset can be visualized in Jupyter Notebook by ds.visualize() or at https://app.activeloop.ai/davitbun/langchain_test_copy / hub://davitbun/langchain_test_copy loaded successfully. Deep Lake Dataset in hub://davitbun/langchain_test_copy already exists, loading from the storage Dataset(path='hub://davitb...
https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake
acec95af7907-0
This notebook shows how to use functionality related to the AnalyticDB vector database. To run, you should have an AnalyticDB instance up and running: from langchain.document_loaders import TextLoader loader = TextLoader("../../../state_of_the_union.txt") documents = loader.load() text_splitter = CharacterTextSplitter...
https://python.langchain.com/docs/integrations/vectorstores/analyticdb
feee4efea085-0
This notebook shows how to use functionality related to the Annoy vector database. # allows for custom annoy parameters, defaults are n_trees=100, n_jobs=-1, metric="angular" vector_store_v2 = Annoy.from_texts( texts, embeddings_func, metric="dot", n_trees=100, n_jobs=1 ) [Document(page_content='Madam Speaker, Madam Vi...
https://python.langchain.com/docs/integrations/vectorstores/annoy
feee4efea085-1
Document(page_content='Groups of citizens blocking tanks with their bodies. Everyone from students to retirees teachers turned soldiers defending their homeland. \n\nIn this struggle as President Zelenskyy said in his speech to the European Parliament “Light will win over darkness.” The Ukrainian Ambassador to the Unit...
https://python.langchain.com/docs/integrations/vectorstores/annoy
feee4efea085-2
Document(page_content='We are inflicting pain on Russia and supporting the people of Ukraine. Putin is now isolated from the world more than ever. \n\nTogether with our allies –we are right now enforcing powerful economic sanctions. \n\nWe are cutting off Russia’s largest banks from the international financial system. ...
https://python.langchain.com/docs/integrations/vectorstores/annoy
feee4efea085-3
metadatas = [{"x": "food"}, {"x": "food"}, {"x": "stuff"}, {"x": "animal"}] # embeddings embeddings = embeddings_func.embed_documents(texts) # embedding dim f = len(embeddings[0]) # index metric = "angular" index = AnnoyIndex(f, metric=metric) for i, emb in enumerate(embeddings): index.add_item(i, emb) index.build(1...
https://python.langchain.com/docs/integrations/vectorstores/annoy
657518294229-0
Atlas Atlas is a platform by Nomic made for interacting with both small and internet scale unstructured datasets. It enables anyone to visualize, search, and share massive datasets in their browser. This notebook shows you how to use functionality related to the AtlasDB vectorstore. python3 -m spacy download en_core_we...
https://python.langchain.com/docs/integrations/vectorstores/atlas
ce611e96f5fc-0
AwaDB AwaDB is an AI Native database for the search and storage of embedding vectors used by LLM Applications. This notebook shows how to use functionality related to the AwaDB. from langchain.text_splitter import CharacterTextSplitter from langchain.vectorstores import AwaDB from langchain.document_loaders import Text...
https://python.langchain.com/docs/integrations/vectorstores/awadb
55067484976a-0
Azure Cognitive Search Azure Cognitive Search (formerly known as Azure Search) is a cloud search service that gives developers infrastructure, APIs, and tools for building a rich search experience over private, heterogeneous content in web, mobile, and enterprise applications. Vector search is currently in public previ...
https://python.langchain.com/docs/integrations/vectorstores/azuresearch
55067484976a-1
vector_store.add_documents(documents=docs) Perform a vector similarity search​ Execute a pure vector similarity search using the similarity_search() method: # Perform a similarity search docs = vector_store.similarity_search( query="What did the president say about Ketanji Brown Jackson", k=3, search_type="similarity",...
https://python.langchain.com/docs/integrations/vectorstores/azuresearch
55067484976a-2
And I did that 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. Perform a vector similarity search with relevance scores​ Execute a pure vector similarity search using the similarity_search_wi...
https://python.langchain.com/docs/integrations/vectorstores/azuresearch
55067484976a-3
0.8441472), (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 like to honor someone who has dedicated his life to serve this cou...
https://python.langchain.com/docs/integrations/vectorstores/azuresearch
55067484976a-4
0.82153815), (Document(page_content='A former top litigator in private practice. A former federal public defender. And from a family of public school educators and police officers. A consensus builder. Since she’s been nominated, she’s received a broad range of support—from the Fraternal Order of Police to former judge...
https://python.langchain.com/docs/integrations/vectorstores/azuresearch
55067484976a-5
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. Justice Breyer, thank you for your service. One of the most serious constitutional responsibilities a President ...
https://python.langchain.com/docs/integrations/vectorstores/azuresearch
55067484976a-6
fields = [ SimpleField( name="id", type=SearchFieldDataType.String, key=True, filterable=True, ), SearchableField( name="content", type=SearchFieldDataType.String, searchable=True, ), SearchField( name="content_vector", type=SearchFieldDataType.Collection(SearchFieldDataType.Single), searchable=True, vector_search_dime...
https://python.langchain.com/docs/integrations/vectorstores/azuresearch
55067484976a-7
vector_store: AzureSearch = AzureSearch( azure_search_endpoint=vector_store_address, azure_search_key=vector_store_password, index_name=index_name, embedding_function=embedding_function, fields=fields, ) Perform a query with a custom filter # Data in the metadata dictionary with a corresponding field in the index will ...
https://python.langchain.com/docs/integrations/vectorstores/azuresearch
55067484976a-8
embeddings: OpenAIEmbeddings = OpenAIEmbeddings(deployment=model, chunk_size=1) embedding_function = embeddings.embed_query fields = [ SimpleField( name="id", type=SearchFieldDataType.String, key=True, filterable=True, ), SearchableField( name="content", type=SearchFieldDataType.String, searchable=True, ), SearchField...
https://python.langchain.com/docs/integrations/vectorstores/azuresearch
55067484976a-9
vector_store.add_texts( ["Test 1", "Test 1", "Test 1"], [ {"title": "Title 1", "source": "source1", "random": "10290", "last_update": today}, {"title": "Title 1", "source": "source1", "random": "48392", "last_update": yesterday}, {"title": "Title 1", "source": "source1", "random": "32893", "last_update": one_month_ago}...
https://python.langchain.com/docs/integrations/vectorstores/azuresearch
42178966d239-0
BagelDB (Open Vector Database for AI), is like GitHub for AI data. It is a collaborative platform where users can create, share, and manage vector datasets. It can support private projects for independent developers, internal collaborations for enterprises, and public contributions for data DAOs. {'ids': ['578c6d24-376...
https://python.langchain.com/docs/integrations/vectorstores/bageldb
efe1253d7cb7-0
Cassandra Apache Cassandra® is a NoSQL, row-oriented, highly scalable and highly available database. Newest Cassandra releases natively support Vector Similarity Search. To run this notebook you need either a running Cassandra cluster equipped with Vector Search capabilities (in pre-release at the time of writing) or a...
https://python.langchain.com/docs/integrations/vectorstores/cassandra
efe1253d7cb7-1
if database_mode == "C": if CASSANDRA_CONTACT_POINTS: cluster = Cluster( [cp.strip() for cp in CASSANDRA_CONTACT_POINTS.split(",") if cp.strip()] ) else: cluster = Cluster() session = cluster.connect() elif database_mode == "A": ASTRA_DB_CLIENT_ID = "token" cluster = Cluster( cloud={ "secure_connect_bundle": ASTRA_DB_S...
https://python.langchain.com/docs/integrations/vectorstores/cassandra
efe1253d7cb7-2
# docsearch_preexisting.similarity_search(query, k=2) print(docs[0].page_content) Maximal Marginal Relevance Searches​ In addition to using similarity search in the retriever object, you can also use mmr as retriever. retriever = docsearch.as_retriever(search_type="mmr") matched_docs = retriever.get_relevant_documents(...
https://python.langchain.com/docs/integrations/vectorstores/cassandra
28acd22eac49-0
ClickHouse ClickHouse is the fastest and most resource efficient open-source database for real-time apps and analytics with full SQL support and a wide range of functions to assist users in writing analytical queries. Lately added data structures and distance search functions (like L2Distance) as well as approximate ne...
https://python.langchain.com/docs/integrations/vectorstores/clickhouse
28acd22eac49-1
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. Justice Breyer, thank you for your service. One of the most serious constitutional responsibilities a President ...
https://python.langchain.com/docs/integrations/vectorstores/clickhouse
28acd22eac49-2
embeddings = OpenAIEmbeddings() for i, d in enumerate(docs): d.metadata = {"doc_id": i} docsearch = Clickhouse.from_documents(docs, embeddings) Inserting data...: 100%|██████████| 42/42 [00:00<00:00, 6939.56it/s] meta = docsearch.metadata_column output = docsearch.similarity_search_with_relevance_scores( "What did th...
https://python.langchain.com/docs/integrations/vectorstores/clickhouse
4d3097bf0d7d-0
Chroma Chroma is a AI-native open-source vector database focused on developer productivity and happiness. Chroma is licensed under Apache 2.0. Install Chroma with: Chroma runs in various modes. See below for examples of each integrated with LangChain. in-memory - in a python script or jupyter notebook in-memory with pe...
https://python.langchain.com/docs/integrations/vectorstores/chroma
4d3097bf0d7d-1
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. Tonight, I’d like to honor someone who has dedicated his life to serve this country: Justice Stephen Breyer—an Army v...
https://python.langchain.com/docs/integrations/vectorstores/chroma
4d3097bf0d7d-2
And I did that 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. Passing a Chroma Client into Langchain​ You can also create a Chroma Client and pass it to LangChain. This is particularly usefu...
https://python.langchain.com/docs/integrations/vectorstores/chroma
4d3097bf0d7d-3
There are 3 in the collection Basic Example (using the Docker Container)​ You can also run the Chroma Server in a Docker container separately, create a Client to connect to it, and then pass that to LangChain. Chroma has the ability to handle multiple Collections of documents, but the LangChain interface expects one, ...
https://python.langchain.com/docs/integrations/vectorstores/chroma
4d3097bf0d7d-4
And I did that 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. Update and Delete​ While building toward a real application, you want to go beyond adding data, and also update and delete data....
https://python.langchain.com/docs/integrations/vectorstores/chroma
4d3097bf0d7d-5
# delete the last document print("count before", example_db._collection.count()) example_db._collection.delete(ids=[ids[-1]]) print("count after", example_db._collection.count()) {'source': '../../../state_of_the_union.txt'} {'ids': ['1'], 'embeddings': None, 'metadatas': [{'new_value': 'hello world', 'source': '../../...
https://python.langchain.com/docs/integrations/vectorstores/chroma
4d3097bf0d7d-6
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. Justice Breyer, thank you for your service. One of the most serious constitutional responsibilities a President ...
https://python.langchain.com/docs/integrations/vectorstores/chroma
4d3097bf0d7d-7
And I did that 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. Other Information​ Similarity search with score​ The returned distance score is cosine distance. Therefore, a lower score is bet...
https://python.langchain.com/docs/integrations/vectorstores/chroma
4d3097bf0d7d-8
retriever.get_relevant_documents(query)[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 like to honor someone who has dedica...
https://python.langchain.com/docs/integrations/vectorstores/chroma
e2e54e02dc1a-0
Dingo Dingo is a distributed multi-mode vector database, which combines the characteristics of data lakes and vector databases, and can store data of any type and size (Key-Value, PDF, audio, video, etc.). It has real-time low-latency processing capabilities to achieve rapid insight and response, and can efficiently co...
https://python.langchain.com/docs/integrations/vectorstores/dingo
e2e54e02dc1a-1
# The OpenAI embedding model `text-embedding-ada-002 uses 1536 dimensions` docsearch = Dingo.from_documents(docs, embeddings, client=dingo_client, index_name=index_name) from langchain.embeddings.openai import OpenAIEmbeddings from langchain.text_splitter import CharacterTextSplitter from langchain.vectorstores import ...
https://python.langchain.com/docs/integrations/vectorstores/dingo
35646220f27b-0
DashVector DashVector is a fully-managed vectorDB service that supports high-dimension dense and sparse vectors, real-time insertion and filtered search. It is built to scale automatically and can adapt to different application requirements. This notebook shows how to use functionality related to the DashVector vector ...
https://python.langchain.com/docs/integrations/vectorstores/dashvector
718bd2edacfd-0
DocArray InMemorySearch DocArrayInMemorySearch is a document index provided by Docarray that stores documents in memory. It is a great starting point for small datasets, where you may not want to launch a database server. This notebook shows how to use functionality related to the DocArrayInMemorySearch. Setup​ Uncomme...
https://python.langchain.com/docs/integrations/vectorstores/docarray_in_memory
718bd2edacfd-1
And I did that 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. Similarity search with score​ The returned distance score is cosine distance. Therefore, a lower score is better. docs = db.simi...
https://python.langchain.com/docs/integrations/vectorstores/docarray_in_memory
b0536bc7338f-0
DocArray HnswSearch DocArrayHnswSearch is a lightweight Document Index implementation provided by Docarray that runs fully locally and is best suited for small- to medium-sized datasets. It stores vectors on disk in hnswlib, and stores all other data in SQLite. This notebook shows how to use functionality related to th...
https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw
b0536bc7338f-1
And I did that 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. Similarity search with score​ The returned distance score is cosine distance. Therefore, a lower score is better. docs = db.simi...
https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw
7510d0ce2138-0
Elasticsearch Elasticsearch is a distributed, RESTful search and analytics engine, capable of performing both vector and lexical search. It is built on top of the Apache Lucene library. This notebook shows how to use functionality related to the Elasticsearch database. pip install elasticsearch openai tiktoken langcha...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-1
embedding = OpenAIEmbeddings() elastic_vector_search = ElasticsearchStore( es_url="http://localhost:9200", index_name="test_index", embedding=embedding, es_user="elastic", es_password="changeme" ) How to obtain a password for the default "elastic" user?​ To obtain your Elastic Cloud password for the default "elastic" u...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-2
loader = TextLoader("../../modules/state_of_the_union.txt") documents = loader.load() text_splitter = CharacterTextSplitter(chunk_size=500, chunk_overlap=0) docs = text_splitter.split_documents(documents) embeddings = OpenAIEmbeddings() db = ElasticsearchStore.from_documents( docs, embeddings, es_url="http://localhost...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-3
query = "What did the president say about Ketanji Brown Jackson" results = db.similarity_search(query) print(results) [Document(page_content='One of the most serious constitutional responsibilities a President has is nominating someone to serve on the United States Supreme Court. \n\nAnd I did that 4 days ago, when I n...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-4
Metadata ElasticsearchStore supports metadata to stored along with the document. This metadata dict object is stored in a metadata object field in the Elasticsearch document. Based on the metadata value, Elasticsearch will automatically setup the mapping by infering the data type of the metadata value. For example, if ...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-5
db = ElasticsearchStore.from_documents( docs, embeddings, es_url="http://localhost:9200", index_name="test-metadata" )
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-6
query = "What did the president say about Ketanji Brown Jackson" docs = db.similarity_search(query) print(docs[0].metadata) {'source': '../../modules/state_of_the_union.txt', 'date': '2016-01-01', 'rating': 2, 'author': 'John Doe'} With metadata added to the documents, you can add metadata filtering at query time. Exa...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-7
print(docs[0].metadata) Filter supports many more types of queries than above. Read more about them in the documentation. Distance Similarity Algorithm Elasticsearch supports the following vector distance similarity algorithms: cosine euclidean dot_product The cosine similarity algorithm is the default. You can specif...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-8
db = ElasticsearchStore.from_documents( docs, embeddings, es_url="http://localhost:9200", index_name="test", distance_strategy="COSINE" # distance_strategy="EUCLIDEAN_DISTANCE" # distance_strategy="DOT_PRODUCT" ) Retrieval Strategies Elasticsearch has big advantages over other vector only databases from its ability...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-9
db = ElasticsearchStore.from_documents( docs, embeddings, es_url="http://localhost:9200", index_name="test", strategy=ElasticsearchStore.ApproxRetrievalStrategy( hybrid=True, ) ) When hybrid is enabled, the query performed will be a combination of approximate semantic search and keyword based search. It will use rr...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-10
# creating a new index with the pipeline, # not relying on langchain to create the index db.client.indices.create( index=APPROX_SELF_DEPLOYED_INDEX_NAME, mappings={ "properties": { "text_field": {"type": "text"}, "vector_query_field": { "properties": { "predicted_value": { "type": "dense_vector", "dims": 384, "index": ...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-11
# Perform search db.similarity_search("hello world", k=10) SparseVectorRetrievalStrategy (ELSER)​ This strategy uses Elasticsearch's sparse vector retrieval to retrieve the top-k results. We only support our own "ELSER" embedding model for now. NOTE This requires the ELSER model to be deployed and running in Elasticsea...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-12
db = ElasticsearchStore.from_documents( docs, embeddings, es_url="http://localhost:9200", index_name="test", strategy=ElasticsearchStore.ExactRetrievalStrategy() ) Customise the Query With custom_query parameter at search, you are able to adjust the query that is used to retrieve documents from Elasticsearch. This i...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
7510d0ce2138-13
Results: page_content='One of the most serious constitutional responsibilities a President has is nominating someone to serve on the United States Supreme Court. \n\nAnd I did that 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 J...
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
fb1b9029f3b3-0
Epsilla Epsilla is an open-source vector database that leverages the advanced parallel graph traversal techniques for vector indexing. Epsilla is licensed under GPL-3.0. This notebook shows how to use the functionalities related to the Epsilla vector database. As a prerequisite, you need to have a running Epsilla vecto...
https://python.langchain.com/docs/integrations/vectorstores/epsilla