Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalChainsHow toAsync APIDifferent call methodsCustom chainDebugging chainsLoading from LangChainHubAdding memory (state)Using OpenAI functionsSerializationFoundationalDocumentsMemoryAgentsCallbacksModulesSecurityGuidesMoreModulesChainsHow toLoading from LangChainHubLoading from LangChainHubThis notebook covers how to load chains from LangChainHub.from langchain.chains import load_chainchain = load_chain("lc://chains/llm-math/chain.json")chain.run("whats 2 raised to .12")            > Entering new LLMMathChain chain...    whats 2 raised to .12    Answer: 1.0791812460476249    > Finished chain.    'Answer: 1.0791812460476249'Sometimes chains will require extra arguments that were not serialized with the chain. For example, a chain that does question answering over a vector database will require a vector database.from langchain.embeddings.openai import OpenAIEmbeddingsfrom langchain.vectorstores import Chromafrom langchain.text_splitter import CharacterTextSplitterfrom langchain.llms import OpenAIfrom langchain.chains import VectorDBQAfrom langchain.document_loaders import TextLoaderloader = TextLoader("../../state_of_the_union.txt")documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)texts = text_splitter.split_documents(documents)embeddings = OpenAIEmbeddings()vectorstore = Chroma.from_documents(texts, embeddings)    Running Chroma using direct local API.    Using DuckDB in-memory for database. Data will be transient.chain = load_chain("lc://chains/vector-db-qa/stuff/chain.json", vectorstore=vectorstore)query = "What did the president say about Ketanji Brown Jackson"chain.run(query)    " The president said that Ketanji Brown Jackson is a
This notebook covers how to load chains from LangChainHub.
This notebook covers how to load chains from LangChainHub. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalChainsHow toAsync APIDifferent call methodsCustom chainDebugging chainsLoading from LangChainHubAdding memory (state)Using OpenAI functionsSerializationFoundationalDocumentsMemoryAgentsCallbacksModulesSecurityGuidesMoreModulesChainsHow toLoading from LangChainHubLoading from LangChainHubThis notebook covers how to load chains from LangChainHub.from langchain.chains import load_chainchain = load_chain("lc://chains/llm-math/chain.json")chain.run("whats 2 raised to .12")            > Entering new LLMMathChain chain...    whats 2 raised to .12    Answer: 1.0791812460476249    > Finished chain.    'Answer: 1.0791812460476249'Sometimes chains will require extra arguments that were not serialized with the chain. For example, a chain that does question answering over a vector database will require a vector database.from langchain.embeddings.openai import OpenAIEmbeddingsfrom langchain.vectorstores import Chromafrom langchain.text_splitter import CharacterTextSplitterfrom langchain.llms import OpenAIfrom langchain.chains import VectorDBQAfrom langchain.document_loaders import TextLoaderloader = TextLoader("../../state_of_the_union.txt")documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)texts = text_splitter.split_documents(documents)embeddings = OpenAIEmbeddings()vectorstore = Chroma.from_documents(texts, embeddings)    Running Chroma using direct local API.    Using DuckDB in-memory for database. Data will be transient.chain = load_chain("lc://chains/vector-db-qa/stuff/chain.json", vectorstore=vectorstore)query = "What did the president say about Ketanji Brown Jackson"chain.run(query)    " The president said that Ketanji Brown Jackson is a