Embed and storefrom langchain.vectorstores import Chromafrom langchain.embeddings import GPT4AllEmbeddingsfrom langchain.embeddings import OllamaEmbeddings # We can also try Ollama embeddingsvectorstore = Chroma.from_documents(documents=all_splits,                                    embedding=GPT4AllEmbeddings())    Found model file at  /Users/rlm/.cache/gpt4all/ggml-all-MiniLM-L6-v2-f16.bin    objc[77472]: Class GGMLMetalClass is implemented in both /Users/rlm/miniforge3/envs/llama2/lib/python3.9/site-packages/gpt4all/llmodel_DO_NOT_MODIFY/build/libreplit-mainline-metal.dylib (0x17f754208) and /Users/rlm/miniforge3/envs/llama2/lib/python3.9/site-packages/gpt4all/llmodel_DO_NOT_MODIFY/build/libllamamodel-mainline-metal.dylib (0x17fb80208). One of the two will be used. Which one is undefined.# Retrievequestion = "How can Task Decomposition be done?"docs = vectorstore.similarity_search(question)len(docs)    4# RAG promptfrom langchain import hubQA_CHAIN_PROMPT = hub.pull("rlm/rag-prompt-llama")# LLMfrom langchain.llms import Ollamafrom langchain.callbacks.manager import CallbackManagerfrom langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandlerllm = Ollama(model="llama2",             verbose=True,             callback_manager=CallbackManager([StreamingStdOutCallbackHandler()]))# QA chainfrom langchain.chains import RetrievalQAqa_chain = RetrievalQA.from_chain_type(    llm,    retriever=vectorstore.as_retriever(),    chain_type_kwargs={"prompt": QA_CHAIN_PROMPT},)question = "What are the various approaches to Task Decomposition for AI Agents?"result = qa_chain({"query": question})     There are several approaches to task decomposition for AI agents, including:        1. Chain of thought (CoT): This involves instructing the model to "think step by step" and use more test-time computation to decompose hard tasks into smaller and simpler steps.    2. Tree of thoughts (ToT): This extends CoT by exploring multiple reasoning possibilities at each step,
Ollama allows you to run open-source large language models, such as Llama 2, locally.
Ollama allows you to run open-source large language models, such as Llama 2, locally. ->: Embed and storefrom langchain.vectorstores import Chromafrom langchain.embeddings import GPT4AllEmbeddingsfrom langchain.embeddings import OllamaEmbeddings # We can also try Ollama embeddingsvectorstore = Chroma.from_documents(documents=all_splits,                                    embedding=GPT4AllEmbeddings())    Found model file at  /Users/rlm/.cache/gpt4all/ggml-all-MiniLM-L6-v2-f16.bin    objc[77472]: Class GGMLMetalClass is implemented in both /Users/rlm/miniforge3/envs/llama2/lib/python3.9/site-packages/gpt4all/llmodel_DO_NOT_MODIFY/build/libreplit-mainline-metal.dylib (0x17f754208) and /Users/rlm/miniforge3/envs/llama2/lib/python3.9/site-packages/gpt4all/llmodel_DO_NOT_MODIFY/build/libllamamodel-mainline-metal.dylib (0x17fb80208). One of the two will be used. Which one is undefined.# Retrievequestion = "How can Task Decomposition be done?"docs = vectorstore.similarity_search(question)len(docs)    4# RAG promptfrom langchain import hubQA_CHAIN_PROMPT = hub.pull("rlm/rag-prompt-llama")# LLMfrom langchain.llms import Ollamafrom langchain.callbacks.manager import CallbackManagerfrom langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandlerllm = Ollama(model="llama2",             verbose=True,             callback_manager=CallbackManager([StreamingStdOutCallbackHandler()]))# QA chainfrom langchain.chains import RetrievalQAqa_chain = RetrievalQA.from_chain_type(    llm,    retriever=vectorstore.as_retriever(),    chain_type_kwargs={"prompt": QA_CHAIN_PROMPT},)question = "What are the various approaches to Task Decomposition for AI Agents?"result = qa_chain({"query": question})     There are several approaches to task decomposition for AI agents, including:        1. Chain of thought (CoT): This involves instructing the model to "think step by step" and use more test-time computation to decompose hard tasks into smaller and simpler steps.    2. Tree of thoughts (ToT): This extends CoT by exploring multiple reasoning possibilities at each step,