The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
[docs]: change rag reference in vector store pages (#25125)
Isaac Francisco11adc09e0245
diff --git a/docs/docs/integrations/vectorstores/astradb.ipynb b/docs/docs/integrations/vectorstores/astradb.ipynbindex 22db0166a8..812fbe29b3 100644--- a/docs/docs/integrations/vectorstores/astradb.ipynb+++ b/docs/docs/integrations/vectorstores/astradb.ipynb@@ -455,68 +455,13 @@"id": "734e683a","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": 25,- "id": "9b3cc97b",- "metadata": {},- "outputs": [],- "source": [- "# | output: false\n",- "# | echo: false\n",- "from langchain_openai import ChatOpenAI\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-4o-mini\")"- ]- },- {- "cell_type": "code",- "execution_count": 21,- "id": "08401498",- "metadata": {},- "outputs": [- {- "data": {- "text/plain": [- "'LangGraph is used for building stateful, agentic applications. It provides a framework that facilitates the development of such applications. Its capabilities make it a preferred choice for developers in this domain.'"- ]- },- "execution_count": 21,- "metadata": {},- "output_type": "execute_result"- }- ],- "source": [- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"What is LangGraph used for?\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{diff --git a/docs/docs/integrations/vectorstores/chroma.ipynb b/docs/docs/integrations/vectorstores/chroma.ipynbindex d5fafe1882..8ca17147d0 100644--- a/docs/docs/integrations/vectorstores/chroma.ipynb+++ b/docs/docs/integrations/vectorstores/chroma.ipynb@@ -459,68 +459,13 @@"id": "a2b7b73c","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": 13,- "id": "9aad065b",- "metadata": {},- "outputs": [],- "source": [- "# | output: false\n",- "# | echo: false\n",- "from langchain_openai import ChatOpenAI\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-4o-mini\")"- ]- },- {- "cell_type": "code",- "execution_count": 15,- "id": "84a19f48",- "metadata": {},- "outputs": [- {- "data": {- "text/plain": [- "'LangGraph is used for building stateful, agentic applications. It provides a framework that supports the development of such applications efficiently.'"- ]- },- "execution_count": 15,- "metadata": {},- "output_type": "execute_result"- }- ],- "source": [- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"What is LangGraph used for?\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{diff --git a/docs/docs/integrations/vectorstores/clickhouse.ipynb b/docs/docs/integrations/vectorstores/clickhouse.ipynbindex f3de48038c..5136718205 100644--- a/docs/docs/integrations/vectorstores/clickhouse.ipynb+++ b/docs/docs/integrations/vectorstores/clickhouse.ipynb@@ -356,57 +356,13 @@"id": "57fade30","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": null,- "id": "8a7fec6b",- "metadata": {},- "outputs": [],- "source": [- "# | output: false\n",- "# | echo: false\n",- "from langchain_openai import ChatOpenAI\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-4o-mini\")"- ]- },- {- "cell_type": "code",- "execution_count": null,- "id": "ae6871dc",- "metadata": {},- "outputs": [],- "source": [- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"What is LangGraph used for?\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{diff --git a/docs/docs/integrations/vectorstores/couchbase.ipynb b/docs/docs/integrations/vectorstores/couchbase.ipynbindex e783d4dc4c..a762de72ab 100644--- a/docs/docs/integrations/vectorstores/couchbase.ipynb+++ b/docs/docs/integrations/vectorstores/couchbase.ipynb@@ -674,57 +674,13 @@"id": "28ab35ec","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": null,- "id": "a6a849aa",- "metadata": {},- "outputs": [],- "source": [- "# | output: false\n",- "# | echo: false\n",- "from langchain_openai import ChatOpenAI\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-4o-mini\")"- ]- },- {- "cell_type": "code",- "execution_count": null,- "id": "e34c9e3a",- "metadata": {},- "outputs": [],- "source": [- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"What is LangGraph used for?\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{diff --git a/docs/docs/integrations/vectorstores/elasticsearch.ipynb b/docs/docs/integrations/vectorstores/elasticsearch.ipynbindex ff4c11fc18..99065abdcc 100644--- a/docs/docs/integrations/vectorstores/elasticsearch.ipynb+++ b/docs/docs/integrations/vectorstores/elasticsearch.ipynb@@ -469,68 +469,13 @@"id": "17b509ae","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": 14,- "id": "58e17804",- "metadata": {},- "outputs": [],- "source": [- "# | output: false\n",- "# | echo: false\n",- "from langchain_openai import ChatOpenAI\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-4o-mini\")"- ]- },- {- "cell_type": "code",- "execution_count": 15,- "id": "01dac420",- "metadata": {},- "outputs": [- {- "data": {- "text/plain": [- "'LanGraph is used for building stateful, agentic applications. It serves as a framework to facilitate the development of exciting new projects.'"- ]- },- "execution_count": 15,- "metadata": {},- "output_type": "execute_result"- }- ],- "source": [- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"What is LanGraph used for?\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{diff --git a/docs/docs/integrations/vectorstores/faiss.ipynb b/docs/docs/integrations/vectorstores/faiss.ipynbindex 175ed8060b..f0aca8d018 100644--- a/docs/docs/integrations/vectorstores/faiss.ipynb+++ b/docs/docs/integrations/vectorstores/faiss.ipynb@@ -360,68 +360,13 @@"id": "5edd1909","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": 8,- "id": "6b792eaa",- "metadata": {},- "outputs": [],- "source": [- "# | output: false\n",- "# | echo: false\n",- "from langchain_openai import ChatOpenAI\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-4o-mini\")"- ]- },- {- "cell_type": "code",- "execution_count": 10,- "id": "1aca9435",- "metadata": {},- "outputs": [- {- "data": {- "text/plain": [- "'LangGraph is used for building stateful, agentic applications. It provides a framework that facilitates the development of these types of applications.'"- ]- },- "execution_count": 10,- "metadata": {},- "output_type": "execute_result"- }- ],- "source": [- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"What is LangGraph used for?\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{diff --git a/docs/docs/integrations/vectorstores/milvus.ipynb b/docs/docs/integrations/vectorstores/milvus.ipynbindex b6c806e637..0f4f1b378f 100644--- a/docs/docs/integrations/vectorstores/milvus.ipynb+++ b/docs/docs/integrations/vectorstores/milvus.ipynb@@ -393,68 +393,13 @@"id": "8ac953f1","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": 35,- "id": "d17118c2",- "metadata": {},- "outputs": [],- "source": [- "# | output: false\n",- "# | echo: false\n",- "from langchain_openai import ChatOpenAI\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-4o-mini\")"- ]- },- {- "cell_type": "code",- "execution_count": 36,- "id": "7bbe3b95",- "metadata": {},- "outputs": [- {- "data": {- "text/plain": [- "'LangGraph is used for building stateful, agentic applications. It provides a framework that facilitates the development of such applications effectively.'"- ]- },- "execution_count": 36,- "metadata": {},- "output_type": "execute_result"- }- ],- "source": [- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"What is LangGraph used for?\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{diff --git a/docs/docs/integrations/vectorstores/mongodb_atlas.ipynb b/docs/docs/integrations/vectorstores/mongodb_atlas.ipynbindex c71fbd6526..f158b17f3a 100644--- a/docs/docs/integrations/vectorstores/mongodb_atlas.ipynb+++ b/docs/docs/integrations/vectorstores/mongodb_atlas.ipynb@@ -457,68 +457,13 @@"id": "72312657","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": 66,- "id": "a42da723",- "metadata": {},- "outputs": [],- "source": [- "# | output: false\n",- "# | echo: false\n",- "from langchain_openai import ChatOpenAI\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-4o-mini\")"- ]- },- {- "cell_type": "code",- "execution_count": 67,- "id": "80c1130f",- "metadata": {},- "outputs": [- {- "data": {- "text/plain": [- "'LangGraph is used for building stateful, agentic applications. It provides a framework that facilitates the development of such applications.'"- ]- },- "execution_count": 67,- "metadata": {},- "output_type": "execute_result"- }- ],- "source": [- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"What is LangGraph used for?\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{diff --git a/docs/docs/integrations/vectorstores/pgvector.ipynb b/docs/docs/integrations/vectorstores/pgvector.ipynbindex d88add2147..5dd2746726 100644--- a/docs/docs/integrations/vectorstores/pgvector.ipynb+++ b/docs/docs/integrations/vectorstores/pgvector.ipynb@@ -434,68 +434,13 @@"id": "7ecd77a0","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": 3,- "id": "f0b14168",- "metadata": {},- "outputs": [],- "source": [- "# | output: false\n",- "# | echo: false\n",- "from langchain_openai import ChatOpenAI\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-4o-mini\")"- ]- },- {- "cell_type": "code",- "execution_count": 8,- "id": "a4eba12c",- "metadata": {},- "outputs": [- {- "data": {- "text/plain": [- "'There are cats in the pond right now.'"- ]- },- "execution_count": 8,- "metadata": {},- "output_type": "execute_result"- }- ],- "source": [- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"Who is at the pond right now?\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{diff --git a/docs/docs/integrations/vectorstores/pinecone.ipynb b/docs/docs/integrations/vectorstores/pinecone.ipynbindex 6641695065..29365946d4 100644--- a/docs/docs/integrations/vectorstores/pinecone.ipynb+++ b/docs/docs/integrations/vectorstores/pinecone.ipynb@@ -408,68 +408,13 @@"id": "72990cb5","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": 20,- "id": "f12560cb",- "metadata": {},- "outputs": [],- "source": [- "# | output: false\n",- "# | echo: false\n",- "from langchain_openai import ChatOpenAI\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-4o-mini\")"- ]- },- {- "cell_type": "code",- "execution_count": 21,- "id": "262651fc",- "metadata": {},- "outputs": [- {- "data": {- "text/plain": [- "'LangGraph is used for building stateful, agentic applications. It provides a framework that facilitates the development of these types of applications.'"- ]- },- "execution_count": 21,- "metadata": {},- "output_type": "execute_result"- }- ],- "source": [- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"What is LangGraph used for?\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{diff --git a/docs/docs/integrations/vectorstores/qdrant.ipynb b/docs/docs/integrations/vectorstores/qdrant.ipynbindex c0ccbe4f08..fe5544e7e8 100644--- a/docs/docs/integrations/vectorstores/qdrant.ipynb+++ b/docs/docs/integrations/vectorstores/qdrant.ipynb@@ -713,68 +713,13 @@"id": "6ac07288","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": 16,- "id": "07bd9785",- "metadata": {},- "outputs": [],- "source": [- "# | output: false\n",- "# | echo: false\n",- "from langchain_openai import ChatOpenAI\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-4o-mini\")"- ]- },- {- "cell_type": "code",- "execution_count": 17,- "id": "d97f0c91",- "metadata": {},- "outputs": [- {- "data": {- "text/plain": [- "'LangGraph is used for building stateful, agentic applications. It provides a framework that facilitates the development of such applications.'"- ]- },- "execution_count": 17,- "metadata": {},- "output_type": "execute_result"- }- ],- "source": [- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"What is LangGraph used for?\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{diff --git a/docs/docs/integrations/vectorstores/redis.ipynb b/docs/docs/integrations/vectorstores/redis.ipynbindex d2565beab5..6230bff240 100644--- a/docs/docs/integrations/vectorstores/redis.ipynb+++ b/docs/docs/integrations/vectorstores/redis.ipynb@@ -930,66 +930,13 @@"cell_type": "markdown","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": 17,- "metadata": {},- "outputs": [],- "source": [- "# | output: false\n",- "# | echo: false\n",- "from langchain_openai import ChatOpenAI\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-4o-mini\")"- ]- },- {- "cell_type": "code",- "execution_count": 18,- "metadata": {},- "outputs": [- {- "data": {- "text/plain": [- "'LangGraph is used for building stateful, agentic applications. It provides a framework to facilitate the development of such applications.'"- ]- },- "execution_count": 18,- "metadata": {},- "output_type": "execute_result"- }- ],- "source": [- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"What is LangGraph used for?\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{diff --git a/libs/cli/langchain_cli/integration_template/docs/vectorstores.ipynb b/libs/cli/langchain_cli/integration_template/docs/vectorstores.ipynbindex c78091133f..f259710b09 100644--- a/libs/cli/langchain_cli/integration_template/docs/vectorstores.ipynb+++ b/libs/cli/langchain_cli/integration_template/docs/vectorstores.ipynb@@ -288,45 +288,13 @@"id": "901c75dc","metadata": {},"source": [- "## Chain usage\n",+ "## Usage for retrieval-augmented generation\n","\n",- "The code below shows how to use the vector store as a retriever in a simple RAG chain:\n",+ "For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n","\n",- "```{=mdx}\n",- "import ChatModelTabs from \"@theme/ChatModelTabs\";\n",- "\n",- "<ChatModelTabs customVarName=\"llm\" />\n",- "```"- ]- },- {- "cell_type": "code",- "execution_count": null,- "id": "619b5ef6",- "metadata": {},- "outputs": [],- "source": [- "from langchain_openai import ChatOpenAI\n",- "from langchain import hub\n",- "from langchain_core.output_parsers import StrOutputParser\n",- "from langchain_core.runnables import RunnablePassthrough\n",- "\n",- "\n",- "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\")\n",- "\n",- "prompt = hub.pull(\"rlm/rag-prompt\")\n",- "\n",- "def format_docs(docs):\n",- " return \"\\n\\n\".join(doc.page_content for doc in docs)\n",- "\n",- "rag_chain = (\n",- " {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",- " | prompt\n",- " | llm\n",- " | StrOutputParser()\n",- ")\n",- "\n",- "rag_chain.invoke(\"thud\")"+ "- [Tutorials: working with external knowledge](https://python.langchain.com/v0.2/docs/tutorials/#working-with-external-knowledge)\n",+ "- [How-to: Question and answer with RAG](https://python.langchain.com/v0.2/docs/how_to/#qa-with-rag)\n",+ "- [Retrieval conceptual docs](https://python.langchain.com/v0.2/docs/concepts/#retrieval)"]},{