{"id":77039,"date":"2025-04-10T10:00:00","date_gmt":"2025-04-10T01:00:00","guid":{"rendered":"https:\/\/www.creationline.com\/tech-blog\/?p=77039"},"modified":"2026-05-26T18:52:04","modified_gmt":"2026-05-26T09:52:04","slug":"langchain%e3%81%aerag%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab%e3%82%92%e3%82%84%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f%ef%bc%88%e5%89%8d%e7%b7%a8%ef%bc%89-langchain-langgraph-ra","status":"publish","type":"post","link":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039","title":{"rendered":"LangChain\u306eRAG\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3084\u3063\u3066\u307f\u305f\uff08\u524d\u7de8\uff09 #langchain #langgraph #rag #azure #openai"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<p>\u672c\u7a3f\u3067\u306f <a href=\"https:\/\/www.langchain.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">LangChain<\/a> \u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb <a href=\"https:\/\/python.langchain.com\/docs\/tutorials\/rag\/\" target=\"_blank\" rel=\"noreferrer noopener\">Build a Retrieval Augmented Generation (RAG) App: Part 1<\/a> \u3092 <a href=\"https:\/\/azure.microsoft.com\/ja-jp\/products\/ai-services\/openai-service\" target=\"_blank\" rel=\"noreferrer noopener\">Azure OpenAI<\/a> \u3092\u4f7f\u3063\u3066\u5b9f\u65bd\u3057\u3066\u307f\u305f\u8a18\u9332\u3067\u3059\u3002<\/p>\n\n\n\n<p>LLM\u306e\u307f\u306b\u57fa\u3065\u3044\u305f\u751f\u6210AI\u3067\u306f\u3001LLM\u30e2\u30c7\u30eb\u304c\u77e5\u3089\u306a\u3044\u5185\u5bb9\u3092\u7121\u7406\u306b\u56de\u7b54\u3057\u3088\u3046\u3068\u3059\u308b\u5834\u5408\u3001\u304a\u304b\u3057\u306a\u7d50\u679c\u3092\u751f\u6210\u3057\u3066\u3057\u307e\u3044\u304c\u3061\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u793e\u5185\u306e\u307f\u3067\u5171\u6709\u3055\u308c\u3066\u3044\u308b\u6587\u7ae0\u306b\u3064\u3044\u3066\u77e5\u3089\u306a\u3044\u3068\u56de\u7b54\u3059\u308b\u306a\u3089\u307e\u3060\u3057\u3082\u3001\u307e\u3063\u305f\u304f\u9593\u9055\u3063\u305f\u5185\u5bb9\u3092\u751f\u6210\u3055\u308c\u3066\u306f\u56f0\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067\u3001RAG (Retrieval Augmented Generation; \u691c\u7d22\u62e1\u5f35\u751f\u6210) \u3068\u3044\u3046\u691c\u7d22\u6280\u8853\u3068\u751f\u6210AI\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u306e\u51fa\u756a\u3067\u3059\u3002\u5148\u306e\u4f8b\u3067\u8a00\u3048\u3070\u3001\u691c\u7d22\u3067\u5f97\u305f\u793e\u5185\u6587\u7ae0\u3092\u3082\u3068\u306b\u3001\u751f\u6210AI\u3067\u56de\u7b54\u3092\u4f5c\u6210\u3059\u308b\u306e\u3067\u3001\u6b63\u3057\u3044\u7b54\u3048\u3067\u3042\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u307e\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>RAG\u306b\u3064\u3044\u3066\u306f\u4ed6\u8a18\u4e8b\u3082\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.creationline.com\/tech-blog\/68030\" target=\"_blank\" rel=\"noreferrer noopener\">\u3010RAG\u304c\u308f\u304b\u308b\u3011\u793e\u5185\u52c9\u5f37\u4f1a\u306e\u5185\u5bb9\u3092\u7279\u5225\u516c\u958b\uff01<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.creationline.com\/tech-blog\/71848\" target=\"_blank\" rel=\"noreferrer noopener\">\u3010CL\u304f\u3093\u30d6\u30ed\u30b0\u3011Tokyo RAG user group Meetup \u3067\u5f0a\u793e\u30a8\u30f3\u30b8\u30cb\u30a2\u304c\u8b1b\u6f14\u3057\u307e\u3057\u305f\uff01<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.creationline.com\/tech-blog\/71715\" target=\"_blank\" rel=\"noreferrer noopener\">\u3010\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30baLLM\u3011\u793e\u5185\u30c7\u30fc\u30bf\u3092\u5143\u306b\u56de\u7b54\u3057\u3066\u304f\u308c\u308bChatGPT\u3092\u4f5c\u308b\u306b\u306f\uff1f RAG\u30fbLLM\u6280\u8853\u3092\u5229\u7528\u3057\u3066\u4fa1\u5024\u3042\u308b\u4f01\u696d\u72ec\u81ea\u306eAI\u3092\u4f5c\u308b\u305f\u3081\u306e\u30c6\u30af\u30cb\u30c3\u30af<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.creationline.com\/tech-blog\/74639\" target=\"_blank\" rel=\"noreferrer noopener\">Azure AI Search\u3067RAG\u3057\u3066\u307f\u3088\u3046\uff01 \u30c1\u30e3\u30c3\u30c8\u30d7\u30ec\u30a4\u30b0\u30e9\u30a6\u30f3\u30c9\u3068Web\u30a2\u30d7\u30ea\u7de8<\/a><\/li>\n<\/ul>\n\n\n\n<p>LLM\u3092\u4f7f\u7528\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u305f\u3081\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3042\u308bLangChain\u306e<a href=\"https:\/\/python.langchain.com\/docs\/tutorials\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/a>\u306b\u306f\u7c21\u5358\u306aRAG\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u672c\u8a18\u4e8b\u306b\u72ec\u81ea\u306e\u5185\u5bb9\u3082\u542b\u3081\u3066\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u524d\u63d0<\/h2>\n\n\n\n<p>\u672c\u7a3f\u3067\u306f\u6b21\u306e\u74b0\u5883\u3092\u524d\u63d0\u3068\u3057\u3066\u9032\u3081\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.python.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python<\/a> 3.13.2<\/li>\n\n\n\n<li><a href=\"https:\/\/www.langchain.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">LangChain<\/a> 0.3.14<\/li>\n\n\n\n<li><a href=\"https:\/\/www.langchain.com\/langgraph\" target=\"_blank\" rel=\"noreferrer noopener\">LangGraph<\/a> 0.3.25<\/li>\n<\/ul>\n\n\n\n<p>\u591a\u5c11\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u9055\u3044\u306f\u8aad\u307f\u66ff\u3048\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001\u6b21\u306e\u6709\u6599\u30ea\u30bd\u30fc\u30b9\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Azure OpenAI\n<ul class=\"wp-block-list\">\n<li>gpt-4o (2024-08-06)<\/li>\n\n\n\n<li>text-embedding-ada-002 (2)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u3061\u3089\u3082\u591a\u5c11\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u9055\u3044\u306f\u8aad\u307f\u66ff\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9f\u65bd<\/h2>\n\n\n\n<p>\u3067\u306f<a href=\"https:\/\/python.langchain.com\/docs\/tutorials\/rag\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/a>\u3092\u898b\u306a\u304c\u3089\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u7279\u5b9a\u306e\u30a6\u30a7\u30d6\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u306b\u57fa\u3044\u3066\u30011\u56de\u304d\u308a\u306e\u8cea\u7591\u5fdc\u7b54\u3092\u884c\u3046LangGraph\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002\u672c\u8a18\u4e8b\u306e\u72ec\u81ea\u8981\u7d20\u3068\u3057\u3066\u3001\u5f0a\u793e\u306e\u300c\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u300d\u306b\u5bfe\u3059\u308b\u8cea\u554f\u306b\u7b54\u3048\u3089\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u56de\u7b54\u306f\u5f0a\u793e Tech blog \u306e\u8a18\u4e8b\u300c<a href=\"https:\/\/www.creationline.com\/tech-blog\/76913\" target=\"_blank\" rel=\"noreferrer noopener\">\u307f\u3093\u306a\u3067\u80b2\u3080\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u30fb\u6b63\u5f0f\u5c0e\u5165\u3092\u6c7a\u5b9a\u3057\u307e\u3057\u305f<\/a>\u300d\u306b\u8a18\u8f09\u3055\u308c\u305f\u5185\u5bb9\u306b\u57fa\u3065\u304f\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e2\u30c7\u30eb\u306e\u8a2d\u5b9a<\/h3>\n\n\n\n<p>Azure OpenAI \u306e\u30e2\u30c7\u30eb\u306a\u3069\u306e\u5fc5\u8981\u8a2d\u5b9a\u9805\u76ee\u306f\u30cf\u30fc\u30c9\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u305b\u305a\u3001<a href=\"https:\/\/github.com\/theskumar\/python-dotenv\" target=\"_blank\" rel=\"noreferrer noopener\">python-dotenv<\/a> \u3092\u4f7f\u3063\u3066\u74b0\u5883\u5909\u6570\u7d4c\u7531\u3067\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import os\nfrom dotenv import load_dotenv\nload_dotenv()\n\nfrom langchain.chat_models import init_chat_model\n\nllm = init_chat_model(\n    model=os.getenv(\"AZURE_OPENAI_MODEL\"),\n    model_provider=\"azure_openai\",\n    azure_endpoint=os.getenv(\"AZURE_OPENAI_ENDPOINT\"),\n    api_key=os.getenv(\"AZURE_OPENAI_API_KEY\"),\n    api_version=os.getenv(\"AZURE_OPENAI_API_VERSION\"),\n)\n\nfrom langchain_openai import AzureOpenAIEmbeddings\n\nembeddings = AzureOpenAIEmbeddings(\n    model=os.getenv(\"AZURE_OPENAI_EMBEDDING_MODEL\"),\n    azure_endpoint=os.getenv(\"AZURE_OPENAI_ENDPOINT\"),\n    api_key=os.getenv(\"AZURE_OPENAI_API_KEY\"),\n    openai_api_version=os.getenv(\"AZURE_OPENAI_API_VERSION\"),\n)<\/pre>\n\n\n\n<p>Azure \u306e\u8a2d\u5b9a\u9805\u76ee\u306f\u3084\u3084\u3053\u3057\u3044\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002 <code>AZURE_OPENAI_MODEL<\/code> \u306f gpt-4o (2024-08-06) \u3092Azure\u306b\u30c7\u30d7\u30ed\u30a4\u3057\u305f\u969b\u306e\u540d\u524d\u3001 <code>AZURE_OPENAI_EMBEDDING_MODEL<\/code> \u306f text-embedding-ada-002 (2) \u3092Azure\u306b\u30c7\u30d7\u30ed\u30a4\u3057\u305f\u969b\u306e\u540d\u524d\u3067\u3059\u3002\u3069\u3061\u3089\u3082\u30e2\u30c7\u30eb\u540d\u3092\u5165\u308c\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u3055\u3089\u306b\u3001gpt-4o \u306e\u30d0\u30fc\u30b8\u30e7\u30f3(2024-08-06)\u3068 <code>AZURE_OPENAI_API_VERSION<\/code> \u306f\u7570\u306a\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f <a href=\"https:\/\/learn.microsoft.com\/ja-jp\/azure\/ai-services\/openai\/api-version-deprecation#latest-ga-api-release\" target=\"_blank\" rel=\"noreferrer noopener\">\u6700\u65b0\u306e GA API \u30ea\u30ea\u30fc\u30b9<\/a> \u3067\u793a\u3055\u308c\u3066\u3044\u308b <code>2024-10-21<\/code> \u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>AZURE_OPENAI_ENDPOINT<\/code> \u3068 <code>AZURE_OPENAI_API_KEY<\/code> \u306f\u4e21\u8005\u3067\u5171\u901a\u3067\u3059\u3002\u5225\u3005\u306b\u6e96\u5099\u3057\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d9\u30af\u30c8\u30eb\u30b9\u30c8\u30a2\u306e\u8a2d\u5b9a<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from langchain_core.vectorstores import InMemoryVectorStore\n\nvector_store = InMemoryVectorStore(embeddings)<\/pre>\n\n\n\n<p>\u3053\u3053\u3067\u306f\u4f8b\u3068\u3057\u3066\u3001\u30e1\u30e2\u30ea\u5185\u306b\u4e00\u6642\u4fdd\u5b58\u3059\u308b\u3060\u3051\u306e\u30d9\u30af\u30c8\u30eb\u30b9\u30c8\u30a2\u5b9f\u88c5\u3067\u3042\u308b <a href=\"https:\/\/python.langchain.com\/api_reference\/core\/vectorstores\/langchain_core.vectorstores.in_memory.InMemoryVectorStore.html\" target=\"_blank\" rel=\"noreferrer noopener\">InMemoryVectorStore<\/a>\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3057\u3066\u30a8\u30f3\u30d9\u30c7\u30a3\u30f3\u30b0\u3059\u308b\u969b\u306b\u7528\u3044\u308b\u95a2\u6570\u306f\u5148\u306e AzureOpenAIEmbeddings \u3067\u8a2d\u5b9a\u3057\u305f\u30e2\u30c7\u30eb\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u306e\u53d6\u5f97<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import bs4\nfrom langchain_community.document_loaders import WebBaseLoader\n\nloader = WebBaseLoader(\n    web_paths=(\"https:\/\/www.creationline.com\/tech-blog\/hr\/76913\",),\n    bs_kwargs=dict(\n        parse_only=bs4.SoupStrainer(\n            class_=(\"content_post\", \"tech_header\")\n        )\n    ),\n)\ndocs = loader.load()<\/pre>\n\n\n\n<p><a href=\"https:\/\/www.crummy.com\/software\/BeautifulSoup\/\" target=\"_blank\" rel=\"noreferrer noopener\">Beautiful Soup<\/a>\u3067\u53d6\u5f97\u3057\u305f\u3044\u5185\u5bb9\u306e\u307f\u3092\u6307\u5b9a\u3057\u3001LangChain\u306e<a href=\"https:\/\/python.langchain.com\/docs\/integrations\/document_loaders\/web_base\/\" target=\"_blank\" rel=\"noreferrer noopener\">WebBaseLoader<\/a>\u3067\u305d\u308c\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002\u30d8\u30c3\u30c0\u3084\u30d5\u30c3\u30bf\u3001\u30b5\u30a4\u30c9\u30ca\u30d3\u306a\u3069\u306e\u5171\u901a\u30d1\u30fc\u30c4\u306f\u9664\u5916\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c1\u30e3\u30f3\u30af\u5316\uff08\u30c1\u30e3\u30f3\u30ad\u30f3\u30b0\uff09<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from langchain_text_splitters import RecursiveCharacterTextSplitter\n\ntext_splitter = RecursiveCharacterTextSplitter.from_tiktoken_encoder(\n    separators=[\"\\n\\n\", \"\\n\", \"\u3002\"],\n    chunk_size=100, chunk_overlap=50\n)\nall_splits = text_splitter.split_documents(docs)<\/pre>\n\n\n\n<p>\u53d6\u5f97\u3057\u305f\u30d6\u30ed\u30b0\u8a18\u4e8b\u5168\u4f53\u3092 <a href=\"https:\/\/python.langchain.com\/docs\/how_to\/split_by_token\/\" target=\"_blank\" rel=\"noreferrer noopener\">RecursiveCharacterTextSplitter.from_tiktoken_encoder<\/a> \u3067\u30c1\u30e3\u30f3\u30af\u5316\uff08\u30c1\u30e3\u30f3\u30ad\u30f3\u30b0\uff09\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30c1\u30e3\u30f3\u30af\u5316\u306b\u306f\u30d0\u30a4\u30c8\u5bfe\u7b26\u53f7\u5316(BPE; Byte Pair Encoding)\u3068\u3057\u3066OpenAI\u306e<a href=\"https:\/\/github.com\/openai\/tiktoken\" target=\"_blank\" rel=\"noreferrer noopener\">tiktoken<\/a>\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u3067\u3059\u3002tiktoken\u306b\u3064\u3044\u3066\u306f\u904e\u53bb\u30d6\u30ed\u30b0\u300c<a href=\"https:\/\/www.creationline.com\/tech-blog\/71957\" target=\"_blank\" rel=\"noreferrer noopener\">ChatGPT\u3084Azure OpenAI Service\u306e\u8ab2\u91d1\u5358\u4f4d\u300c\u30c8\u30fc\u30af\u30f3\u300d\u3068\u306f\uff1f \u8a08\u7b97\u3057\u3066\u307f\u3088\u3046<\/a>\u300d\u3082\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u30c1\u30e3\u30f3\u30af\u306e\u533a\u5207\u308a\u304c\u6539\u884c\u3060\u3051\u306a\u306e\u3067\u3001\u65e5\u672c\u8a9e\u6587\u306b\u306f\u5411\u304d\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001 <code>separators=[\"\\n\\n\", \"\\n\", \"\u3002\"]<\/code> \u306b\u3088\u308a\u3001\u30c1\u30e3\u30f3\u30af\u306e\u533a\u5207\u308a\u3092\u6539\u884c\u3068\u53e5\u70b9\u300c\u3002\u300d\u3068\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>RecursiveCharacterTextSplitter\u3067\u306f\u3001tiktoken\u3067\u5272\u308a\u51fa\u3055\u308c\u305f\u30c8\u30fc\u30af\u30f3\u6570\u304c <code>chunk_size<\/code> \u3067\u6307\u5b9a\u3057\u305f\u6570\u3092\u4e0b\u56de\u308b\u307e\u3067\u30c1\u30e3\u30f3\u30af\u5316\u3057\u307e\u3059\u3002\u305d\u306e\u30c8\u30fc\u30af\u30f3\u6570\u3092\u3053\u3053\u3067\u306f <code>100<\/code> \u3068\u3057\u3066\u3044\u307e\u3059\u3002\u3055\u3089\u306b\u3001\u30c1\u30e3\u30f3\u30af\u306e\u524d\u5f8c\u3092\u6307\u5b9a\u306e\u30c8\u30fc\u30af\u30f3\u6570\u3060\u3051\u30c1\u30e3\u30f3\u30af\u306b\u542b\u3081\u308b\u3088\u3046\u306b\u3082\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u305d\u306e\u524d\u5f8c\u306e\u542b\u307f\u3092 <code>50<\/code> \u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30c1\u30e3\u30f3\u30af\u8a2d\u5b9a\u306f RAG \u306e\u7cbe\u5ea6\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u305f\u3081\u6307\u5b9a\u304c\u96e3\u3057\u3044\u3067\u3059\u3002\u65e2\u306b\u6319\u3052\u305f\u901a\u308a\u3001\u548c\u6587\u30fb\u82f1\u6587\u3067\u30c8\u30fc\u30af\u30f3\u5316\u30fb\u30c1\u30e3\u30f3\u30af\u5316\u306e\u8a2d\u5b9a\u304c\u7570\u306a\u3063\u305f\u308a\u3001\u53d6\u308a\u8fbc\u307f\u305f\u3044\u30c7\u30fc\u30bf\u306b\u3088\u3063\u3066\u3082\u305d\u306e\u6307\u5b9a\u304c\u7570\u306a\u308b\u3053\u3068\u3082\u6709\u308a\u5f97\u308b\u3067\u3057\u3087\u3046\u3002\u30d9\u30b9\u30c8\u306a\u6570\u5024\u4f8b\u3068\u3044\u3046\u3082\u306e\u306f\u96e3\u3057\u304f\u3001\u5b9f\u969b\u306b\u52d5\u304b\u3057\u3066\u898b\u6975\u3081\u3066\u3044\u304f\u3057\u304b\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u5b9f\u969b\u306b\u3053\u306e\u30b3\u30fc\u30c9\u304b\u3089\u5f97\u3089\u308c\u308b\u30c1\u30e3\u30f3\u30af\u5316\u306e\u7d50\u679c\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002\u5c11\u3057\u624b\u3067\u6574\u5f62\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[\n    Document(metadata={'source': 'https:\/\/www.creationline.com\/tech-blog\/hr\/76913'},\n    page_content='2025.03.25\\n\u307f\u3093\u306a\u3067\u80b2\u3080\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u30fb\u6b63\u5f0f\u5c0e\u5165\u3092\u6c7a\u5b9a\u3057\u307e\u3057\u305f\\n\\nCL HRn-ogasawara81'),\n    Document(metadata={'source': 'https:\/\/www.creationline.com\/tech-blog\/hr\/76913'},\n    page_content='\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\u306eCHRO\u306e\u5c0f\u7b20\u539f\u3067\u3059\u3002'),\n    Document(metadata={'source': 'https:\/\/www.creationline.com\/tech-blog\/hr\/76913'},\n    page_content='\\n2024\u5e747\u6708\u304b\u3089\u30c8\u30e9\u30a4\u30a2\u30eb\u904b\u7528\u3092\u59cb\u3081\u305f\u300c\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u300d\u306f\u3001\u30e1\u30f3\u30d0\u30fc\u4e00\u4eba\u3072\u3068\u308a\u306e\u30b9\u30ad\u30eb\u5411\u4e0a\u3084\u30c1\u30e3\u30ec\u30f3\u30b8\u3092\u5f8c\u62bc\u3057\u3059\u308b\u5236\u5ea6\u3068\u3057\u3066\u3001\u6709\u52b9\u306b\u6a5f\u80fd\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f'),\n    Document(metadata={'source': 'https:\/\/www.creationline.com\/tech-blog\/hr\/76913'},\n    page_content='\u3002\u307e\u305f\u3001\u30c8\u30e9\u30a4\u30a2\u30eb\u671f\u9593\u4e2d\u306b\u767a\u751f\u3057\u305f\u3055\u307e\u3056\u307e\u306a\u30b1\u30fc\u30b9\u306b\u3082\u3001\u30ea\u30fc\u30c0\u30fc\u9663\u304c\u4f1a\u793e\u5168\u4f53\u306e\u8996\u70b9\u304b\u3089\u8b70\u8ad6\u3092\u91cd\u306d\u3001\u67d4\u8edf\u306b\u5bfe\u5fdc\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002'),\n    &lt;snip>\n    Document(metadata={'source': 'https:\/\/www.creationline.com\/tech-blog\/hr\/76913'},\n    page_content='\u3002\u591a\u304f\u306e\u30e1\u30f3\u30d0\u30fc\u304c\u3053\u306e\u5236\u5ea6\u3092\u6d3b\u7528\u3057\u3001\u81ea\u3089\u306e\u30b9\u30ad\u30eb\u3092\u9ad8\u3081\u308b\u3053\u3068\u3067\u3001\u300c\u500b\u4eba\u306e\u6210\u9577\u304c\u3001\u4f1a\u793e\u306e\u6210\u9577\u306b\u3064\u306a\u304c\u308b\u300d\u2014\u2014\u305d\u3093\u306a\u597d\u5faa\u74b0\u3092\u751f\u307f\u51fa\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u8003\u3048\u3066\u3044\u307e\u3059'),\n    Document(metadata={'source': 'https:\/\/www.creationline.com\/tech-blog\/hr\/76913'},\n    page_content='\u3002'),\n    Document(metadata={'source': 'https:\/\/www.creationline.com\/tech-blog\/hr\/76913'},\n    page_content='\u4eca\u5f8c\u3082\u5236\u5ea6\u306e\u6d3b\u7528\u72b6\u6cc1\u3092\u898b\u306a\u304c\u3089\u67d4\u8edf\u306b\u3057\u304f\u307f\u3092\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u3001\u3088\u308a\u591a\u304f\u306e\u4eba\u304c\u6210\u9577\u3067\u304d\u308b\u4ed5\u7d44\u307f\u3092\u6574\u3048\u3066\u3044\u304d\u307e\u3059\u3002'),\n    Document(metadata={'source': 'https:\/\/www.creationline.com\/tech-blog\/hr\/76913'},\n    page_content='\u6700\u5f8c\u307e\u3067\u304a\u8aad\u307f\u3044\u305f\u3060\u304d\u3001\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\u3002')]\n]<\/pre>\n\n\n\n<p>\u304a\u304a\u3080\u306d\u65e5\u672c\u8a9e\u3068\u3057\u30661\u6587\uff1d1\u30c1\u30e3\u30f3\u30af\u3068\u3057\u3066\u51e6\u7406\u3067\u304d\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002\u3061\u306a\u307f\u306b\u5148\u306b\u6319\u3052\u305f\u30c1\u30e3\u30f3\u30af\u5316\u306e\u8a2d\u5b9a\u3084\u8abf\u6574\u3092\u884c\u308f\u306a\u3044\u5834\u5408\u3001\u8907\u6570\u306e\u6587\u306e\u584a\u304c1\u30c1\u30e3\u30f3\u30af\u3068\u306a\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c1\u30e3\u30f3\u30af\u306e\u30a8\u30f3\u30d9\u30c7\u30a3\u30f3\u30b0\u3068\u4fdd\u5b58<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">_ = vector_store.add_documents(documents=all_splits)<\/pre>\n\n\n\n<p>\u30c1\u30e3\u30f3\u30af\u3092\u30a8\u30f3\u30d9\u30c7\u30a3\u30f3\u30b0\u3057\u3001\u30d9\u30af\u30c8\u30eb\u30b9\u30c8\u30a2\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3068\u3053\u308d\u3067\u300c\u30a8\u30f3\u30d9\u30c7\u30a3\u30f3\u30b0\u300d\u3068\u300c\u30d9\u30af\u30c8\u30eb\u5316\u300d\u306f\u3069\u3046\u9055\u3046\u306e\u3067\u3057\u3087\u3046\u304b\uff1f \u300c\u30d9\u30af\u30c8\u30eb\u5316\u300d\u3068\u306f\u3001\u3042\u308b\u8981\u7d20\u3092\u884c\u5217\uff08\u30d9\u30af\u30c8\u30eb\uff09\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u3092\u8868\u3059\u4e00\u822c\u7684\u306a\u6982\u5ff5\u3067\u3059\u3002\u4e00\u65b9\u3067\u300c\u30a8\u30f3\u30d9\u30c7\u30a3\u30f3\u30b0\u300d\u306f\u3001\u3042\u308b\u8981\u7d20\u3092\u884c\u5217\uff08\u30d9\u30af\u30c8\u30eb\uff09\u306b\u5909\u63db\u3059\u308b\u969b\u3001\u305d\u306e\u610f\u5473\u3092\u53cd\u6620\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u8a00\u3044\u63db\u3048\u308b\u3068\u4f3c\u305f\u3082\u306e\u306f\u8fd1\u3044\u30d9\u30af\u30c8\u30eb\u306b\u306a\u308b\u3088\u3046\u306b\u5909\u63db\u3057\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u300c\u30a8\u30f3\u30d9\u30c7\u30a3\u30f3\u30b0\u300d\u306f\u300c\u30d9\u30af\u30c8\u30eb\u5316\u300d\u306e\u3044\u3061\u6982\u5ff5\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">RAG\u7528\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u8aad\u307f\u8fbc\u307f<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from langchain import hub\n\nprompt = hub.pull(\"rlm\/rag-prompt\")<\/pre>\n\n\n\n<p>LangSmith\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b<a href=\"https:\/\/smith.langchain.com\/hub\/rlm\/rag-prompt\" target=\"_blank\" rel=\"noreferrer noopener\">RAG\u7528\u30d7\u30ed\u30f3\u30d7\u30c8<\/a>\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question. If you don't know the answer, just say that you don't know. Use three sentences maximum and keep the answer concise.\n\nQuestion: {question} \nContext: {context} \nAnswer:<\/pre>\n\n\n\n<p>\u3053\u308c\u3092\u7ffb\u8a33\u3059\u308b\u3068\u3001<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u3042\u306a\u305f\u306f\u8cea\u554f\u56de\u7b54\u30bf\u30b9\u30af\u306e\u30a2\u30b7\u30b9\u30bf\u30f3\u30c8\u3067\u3059\u3002\u6b21\u306e\u53d6\u5f97\u3057\u305f\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u4f7f\u7528\u3057\u3066\u8cea\u554f\u306b\u7b54\u3048\u3066\u304f\u3060\u3055\u3044\u3002\u7b54\u3048\u304c\u308f\u304b\u3089\u306a\u3044\u5834\u5408\u306f\u3001\u308f\u304b\u3089\u306a\u3044\u3068\u3060\u3051\u8a00\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u6700\u59273\u3064\u306e\u6587\u3092\u4f7f\u7528\u3057\u3001\u7b54\u3048\u306f\u7c21\u6f54\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\n\u8cea\u554f: {question}\n\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8: {context}\n\u56de\u7b54:<\/pre>\n\n\n\n<p>\u3068\u306a\u308a\u307e\u3059\u3002\u300c\u53d6\u5f97\u3057\u305f\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u300d\u3068\u306f\u3001\u30d9\u30af\u30c8\u30eb\u30b9\u30c8\u30a2\u304b\u3089\u691c\u7d22\u3057\u3066\u5f97\u3089\u308c\u305f\u30c1\u30e3\u30f3\u30af\u306b\u306a\u308a\u307e\u3059\u3002\u691c\u7d22\u65b9\u6cd5\u306a\u3069\u306f\u5f8c\u8ff0\u3057\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u8cea\u554f\u6587\u306b\u300c\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u300d\u3068\u3057\u3066\u88dc\u8db3\u60c5\u5831\u3092\u4e0e\u3048\u308b\u3053\u3068\u3067\u3001\u56de\u7b54\u306e\u7cbe\u5ea6\u3092\u4e0a\u3052\u308b\u3068\u3044\u3046\u72d9\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u72b6\u614b<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from langchain_core.documents import Document\nfrom typing_extensions import List, TypedDict\n\nclass State(TypedDict):\n    question: str\n    context: List[Document]\n    answer: str<\/pre>\n\n\n\n<p>LangGraph\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c7\u30fc\u30bf\u3092\u5236\u5fa1\u3059\u308b\u72b6\u614b\u3067\u3059\u3002\u8cea\u554f\u30fb\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\uff08\u30c1\u30e3\u30f3\u30af\uff09\u30fb\u56de\u7b54\u304c\u305d\u308c\u306b\u5f53\u305f\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u53d6\u5f97\u30ce\u30fc\u30c9<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def retrieve(state: State):\n    retrieved_docs = vector_store.similarity_search(state[\"question\"])\n    return {\"context\": retrieved_docs}<\/pre>\n\n\n\n<p>\u3053\u3053\u3067\u306f\u30d9\u30af\u30c8\u30eb\u30b9\u30c8\u30a2\u304b\u3089\u7c21\u5358\u306a<a href=\"https:\/\/python.langchain.com\/docs\/concepts\/vectorstores\/#similarity-search\" target=\"_blank\" rel=\"noreferrer noopener\">\u985e\u4f3c\u691c\u7d22 (similarity_search)<\/a>\u3092\u7528\u3044\u3066\u30c1\u30e3\u30f3\u30af\u3092\u53d6\u308a\u51fa\u3057\u3066\u3044\u307e\u3059\u3002\u8cea\u554f\u6587(<code>state[\"question\"]<\/code>)\u3092\u30a8\u30f3\u30d9\u30c7\u30a3\u30f3\u30b0\u3057\u3001\u305d\u306e\u30d9\u30af\u30c8\u30eb\u306b\u985e\u4f3c\u3057\u305f\u30d9\u30af\u30c8\u30eb\u306e\u30c1\u30e3\u30f3\u30af\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4e0a\u4f4d4\u4ef6\u3092\u53d6\u308a\u51fa\u3057\u307e\u3059\u3002\u3061\u306a\u307f\u306b\u3053\u306e\u985e\u4f3c\u691c\u7d22\u306b\u304a\u3051\u308b\u4e0a\u4f4dn\u4ef6\u3092 <code>top_k<\/code> \u3068\u547c\u3073\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u751f\u6210\u30ce\u30fc\u30c9<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def generate(state: State):\n    docs_content = \"\\n\\n\".join(doc.page_content for doc in state[\"context\"])\n    messages = prompt.invoke({\"question\": state[\"question\"], \"context\": docs_content})\n    response = llm.invoke(messages)\n    return {\"answer\": response.content}<\/pre>\n\n\n\n<p>\u5148\u306b\u8aad\u307f\u8fbc\u3093\u3060RAG\u7528\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3068\u3057\u3066\u3001\u8cea\u554f\u6587(<code>state[\"question\"]<\/code>)\u3068\u30c1\u30e3\u30f3\u30af(<code>state[\"context\"]<\/code>)\u3092\u5f53\u3066\u8fbc\u3093\u3067 gpt-4o \u306b\u6295\u5165\u3057\u307e\u3059\u3002\u305d\u306e\u56de\u7b54\u6587\u304c <code>response.content<\/code> \u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b0\u30e9\u30d5\u306e\u69cb\u6210\u3068\u5b9f\u884c<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from langgraph.graph import START, StateGraph\n\ngraph_builder = StateGraph(State).add_sequence([retrieve, generate])\ngraph_builder.add_edge(START, \"retrieve\")\ngraph = graph_builder.compile()\n\nquestion=\"\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\u306e\u300c\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u300d\u3068\u306f\uff1f\"\nresult = graph.invoke({\"question\": question})\nprint(f'Context: {result[\"context\"]}\\n\\n')\nprint(f'Answer: {result[\"answer\"]}')<\/pre>\n\n\n\n<p>LangGraph\u306b\u3064\u3044\u3066\u306f\u904e\u53bb\u30d6\u30ed\u30b0\u300c<a href=\"https:\/\/www.creationline.com\/tech-blog\/75504\" target=\"_blank\" rel=\"noreferrer noopener\">LangGraph\u3092LLM\u306a\u3057\u3067\u3061\u3087\u3063\u3068\u89e6\u3063\u3066\u307f\u3088\u3046<\/a>\u300d\u300c<a href=\"https:\/\/www.creationline.com\/tech-blog\/75615\" target=\"_blank\" rel=\"noreferrer noopener\">LangGraph\u3068Azure OpenAI\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u307f\u3088\u3046<\/a>\u300d\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7d50\u679c<\/h3>\n\n\n\n<p>\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u4e00\u90e8\u51fa\u529b\u3092\u898b\u3084\u3059\u3044\u3088\u3046\u306b\u6574\u5f62\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">(langgraph) % .\/60_rag_tutorial.py \nContext: [\n    Document(id='cc2f4839-9b5d-4357-b04c-d589d9888b38',\n        metadata={'source': 'https:\/\/www.creationline.com\/tech-blog\/hr\/76913'},\n        page_content='\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u306b\u3064\u3044\u3066'),\n    Document(id='b8eabdce-00b2-4cc9-94f5-e070a2c2fcb1',\n        metadata={'source': 'https:\/\/www.creationline.com\/tech-blog\/hr\/76913'},\n        page_content='\u3010\u672c\u984c\u306b\u5165\u308b\u524d\u306b\u3011\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u3068\u306f\u4f55\u304b\uff1f'),\n    Document(id='abe2e444-4dda-4c2e-b21b-74337a083bf3',\n        metadata={'source': 'https:\/\/www.creationline.com\/tech-blog\/hr\/76913'},\n        page_content='\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u3068\u306f\u3001\u30b9\u30ad\u30eb\u958b\u767a\u8cbb\u7528\u306e\u4e00\u90e8\u3092\u4f1a\u793e\u304c\u8ca0\u62c5\u3059\u308b\u3053\u3068\u3067\u3001\u30e1\u30f3\u30d0\u30fc\u306e\u7686\u3055\u3093\u306e\u30b9\u30ad\u30eb\u958b\u767a\u3092\u5968\u52b1\u3059\u308b\u3053\u3068\u3092\u4e3b\u76ee\u7684\u3068\u3057\u305f\u5236\u5ea6\u3067\u3059'),\n    Document(id='f6c5ac02-c03a-45a3-8bb2-3d5fc82ffda0',\n        metadata={'source': 'https:\/\/www.creationline.com\/tech-blog\/hr\/76913'},\n        page_content='\\n2024\u5e747\u6708\u304b\u3089\u30c8\u30e9\u30a4\u30a2\u30eb\u904b\u7528\u3092\u59cb\u3081\u305f\u300c\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u300d\u306f\u3001\u30e1\u30f3\u30d0\u30fc\u4e00\u4eba\u3072\u3068\u308a\u306e\u30b9\u30ad\u30eb\u5411\u4e0a\u3084\u30c1\u30e3\u30ec\u30f3\u30b8\u3092\u5f8c\u62bc\u3057\u3059\u308b\u5236\u5ea6\u3068\u3057\u3066\u3001\u6709\u52b9\u306b\u6a5f\u80fd\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f')\n    ]\n\nAnswer: \u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\u306e\u300c\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u300d\u3068\u306f\u3001\u30b9\u30ad\u30eb\u958b\u767a\u8cbb\u7528\u306e\u4e00\u90e8\u3092\u4f1a\u793e\u304c\u8ca0\u62c5\u3057\u3001\u30e1\u30f3\u30d0\u30fc\u306e\u30b9\u30ad\u30eb\u5411\u4e0a\u3084\u30c1\u30e3\u30ec\u30f3\u30b8\u3092\u5968\u52b1\u3059\u308b\u5236\u5ea6\u3067\u3059\u30022024\u5e747\u6708\u304b\u3089\u30c8\u30e9\u30a4\u30a2\u30eb\u904b\u7528\u304c\u59cb\u307e\u308a\u307e\u3057\u305f\u3002\u3053\u306e\u5236\u5ea6\u306f\u30e1\u30f3\u30d0\u30fc\u500b\u3005\u306e\u30b9\u30ad\u30eb\u5411\u4e0a\u3092\u5f8c\u62bc\u3057\u3059\u308b\u3082\u306e\u3067\u3059\u3002<\/pre>\n\n\n\n<p>\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8(\u5f97\u3089\u308c\u305f\u30c1\u30e3\u30f3\u30af)\u3092\u5229\u7528\u3057\u3001\u3088\u308a\u78ba\u304b\u3089\u3057\u3044\u7b54\u3048\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u304c\u7a7a\u306e\u5834\u5408\u306f\u6b21\u306e\u7b54\u3048\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Answer: \u7533\u3057\u8a33\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\u306e\u300c\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u300d\u306b\u3064\u3044\u3066\u306e\u5177\u4f53\u7684\u306a\u60c5\u5831\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/pre>\n\n\n\n<p>\u691c\u7d22\u3057\u3066\u5f97\u3089\u308c\u305f\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u304c\u91cd\u8981\u306a\u610f\u5473\u3092\u6301\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5168\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># https:\/\/python.langchain.com\/docs\/tutorials\/rag\/\n\nimport os\nfrom dotenv import load_dotenv\nload_dotenv()\n\nfrom langchain.chat_models import init_chat_model\n\nllm = init_chat_model(\n    model=os.getenv(\"AZURE_OPENAI_MODEL\"),\n    model_provider=\"azure_openai\",\n    azure_endpoint=os.getenv(\"AZURE_OPENAI_ENDPOINT\"),\n    api_key=os.getenv(\"AZURE_OPENAI_API_KEY\"),\n    api_version=os.getenv(\"AZURE_OPENAI_API_VERSION\"),\n)\n\n#-----\n\nfrom langchain_openai import AzureOpenAIEmbeddings\n\nembeddings = AzureOpenAIEmbeddings(\n    model=os.getenv(\"AZURE_OPENAI_EMBEDDING_MODEL\"),\n    azure_endpoint=os.getenv(\"AZURE_OPENAI_ENDPOINT\"),\n    api_key=os.getenv(\"AZURE_OPENAI_API_KEY\"),\n    openai_api_version=os.getenv(\"AZURE_OPENAI_API_VERSION\"),\n)\n\n#-----\n\nfrom langchain_core.vectorstores import InMemoryVectorStore\n\nvector_store = InMemoryVectorStore(embeddings)\n\n#-----\n\nimport bs4\nfrom langchain_community.document_loaders import WebBaseLoader\n\nloader = WebBaseLoader(\n    web_paths=(\"https:\/\/www.creationline.com\/tech-blog\/hr\/76913\",),\n    bs_kwargs=dict(\n        parse_only=bs4.SoupStrainer(\n            class_=(\"content_post\", \"tech_header\")\n        )\n    ),\n)\ndocs = loader.load()\n\n#-----\n\nfrom langchain_text_splitters import RecursiveCharacterTextSplitter\n\ntext_splitter = RecursiveCharacterTextSplitter.from_tiktoken_encoder(\n    separators=[\"\\n\\n\", \"\\n\", \"\u3002\"],\n    chunk_size=100, chunk_overlap=50\n)\nall_splits = text_splitter.split_documents(docs)\n\n#-----\n\n_ = vector_store.add_documents(documents=all_splits)\n\n#-----\n\nfrom langchain import hub\n\nprompt = hub.pull(\"rlm\/rag-prompt\")\n\n#-----\n\nfrom langchain_core.documents import Document\nfrom typing_extensions import List, TypedDict\n\n# Define state for application\nclass State(TypedDict):\n    question: str\n    context: List[Document]\n    answer: str\n\ndef retrieve(state: State):\n    retrieved_docs = vector_store.similarity_search(state[\"question\"])\n    return {\"context\": retrieved_docs}\n\ndef generate(state: State):\n    docs_content = \"\\n\\n\".join(doc.page_content for doc in state[\"context\"])\n    messages = prompt.invoke({\"question\": state[\"question\"], \"context\": docs_content})\n    response = llm.invoke(messages)\n    return {\"answer\": response.content}\n\n#-----\n\nfrom langgraph.graph import START, StateGraph\n\ngraph_builder = StateGraph(State).add_sequence([retrieve, generate])\ngraph_builder.add_edge(START, \"retrieve\")\ngraph = graph_builder.compile()\n\nquestion=\"\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\u306e\u300c\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u300d\u3068\u306f\uff1f\"\nresult = graph.invoke({\"question\": question})\nprint(f'Context: {result[\"context\"]}\\n\\n')\nprint(f'Answer: {result[\"answer\"]}')<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u672c\u7a3f\u3067\u306f <a href=\"https:\/\/www.langchain.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">LangChain<\/a> \u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb <a href=\"https:\/\/python.langchain.com\/docs\/tutorials\/rag\/\" target=\"_blank\" rel=\"noreferrer noopener\">Build a Retrieval Augmented Generation (RAG) App: Part 1<\/a> \u3092 <a href=\"https:\/\/azure.microsoft.com\/ja-jp\/products\/ai-services\/openai-service\" target=\"_blank\" rel=\"noreferrer noopener\">Azure OpenAI<\/a> \u3092\u4f7f\u3063\u3066\u5b9f\u65bd\u3057\u3066\u307f\u307e\u3057\u305f\u3002\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u5185\u5bb9\u3092\u305d\u306e\u307e\u307e\u4f7f\u3046\u306e\u3067\u306f\u306a\u304f\u3001\u5f0a\u793e Tech blog \u306e\u8a18\u4e8b\u300c<a href=\"https:\/\/www.creationline.com\/tech-blog\/76913\" target=\"_blank\" rel=\"noreferrer noopener\">\u307f\u3093\u306a\u3067\u80b2\u3080\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u30fb\u6b63\u5f0f\u5c0e\u5165\u3092\u6c7a\u5b9a\u3057\u307e\u3057\u305f<\/a>\u300d\u306b\u8a18\u8f09\u3055\u308c\u305f\u5185\u5bb9\u306b\u57fa\u3065\u3044\u3066\u3001\u300c\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u652f\u63f4\u5236\u5ea6\u300d\u306b\u3064\u3044\u3066\u7b54\u3048\u3089\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>RAG (Retrieval Augmented Generation; \u691c\u7d22\u62e1\u5f35\u751f\u6210) \u3068\u3044\u3046\u691c\u7d22\u6280\u8853\u3068\u751f\u6210AI\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u306b\u3088\u308a\u3001\u751f\u6210AI\u304c\u77e5\u3089\u306a\u3044\u5185\u5bb9\u306b\u3064\u3044\u3066\u3082\u5225\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3092\u691c\u7d22\u3057\u3001\u56de\u7b54\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u306e\u683c\u7d0d\u3068\u691c\u7d22\u306b\u306f\u3001\u30c1\u30e3\u30f3\u30af\u5316\uff08\u30c1\u30e3\u30f3\u30ad\u30f3\u30b0\uff09\u3084\u3001\u30a8\u30f3\u30d9\u30c7\u30a3\u30f3\u30b0\u3068\u3044\u3046\u30d9\u30af\u30c8\u30eb\u5316\u306e\u4e00\u7a2e\u3068\u3044\u3063\u305f\u6280\u8853\u304c\u7528\u3044\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u904e\u53bb\u306e\u8a18\u4e8b\uff08<a href=\"https:\/\/www.creationline.com\/tech-blog\/74639\" target=\"_blank\" rel=\"noreferrer noopener\">Azure AI Search\u3067RAG\u3057\u3066\u307f\u3088\u3046\uff01 \u30c1\u30e3\u30c3\u30c8\u30d7\u30ec\u30a4\u30b0\u30e9\u30a6\u30f3\u30c9\u3068Web\u30a2\u30d7\u30ea\u7de8<\/a>\uff09\u3067\u306f\u610f\u8b58\u305b\u305a\u306b\u4f7f\u3063\u3066\u3044\u305f\u8981\u7d20\u3092\u672c\u7a3f\u3067\u306f\u3088\u308a\u8a73\u3057\u304f\u898b\u3066\u307f\u305f\u306e\u3067\u3001\u4ee5\u524d\u3088\u308aRAG\u306b\u3064\u3044\u3066\u306e\u7406\u89e3\u304c\u6df1\u307e\u3063\u305f\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f1\u56de\u304d\u308a\u306e\u8cea\u7591\u5fdc\u7b54\u3060\u3063\u305f\u306e\u3067\u3001\u6b21\u56de\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb <a href=\"https:\/\/python.langchain.com\/docs\/tutorials\/qa_chat_history\/\">Part 2<\/a>\u3067\u306f\u3001\u5185\u5bb9\u3092\u5f15\u304d\u7d99\u3044\u3060\u72b6\u614b\u3067\u7e70\u308a\u8fd4\u3057\u8cea\u7591\u5fdc\u7b54\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u6539\u826f\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f LangChain \u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb Build a Retrieval Augmented Generation (RAG) App: Part 1 \u3092 Azure OpenAI \u3092\u4f7f\u3063\u3066\u5b9f\u65bd\u3057\u3066\u307f [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":77105,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[779,58,817,31,1004,323],"tags":[],"class_list":["post-77039","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-azure","category-chatgpt-ai","category-higuchi","category-llm","category-python"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>LangChain\u306eRAG\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3084\u3063\u3066\u307f\u305f\uff08\u524d\u7de8\uff09 #langchain #langgraph #rag #azure #openai - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3<\/title>\n<meta name=\"description\" content=\"AI, Azure, ChatGPT\uff06AI, d-higuchi, LLM, Python |\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f LangChain \u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb Build a Retrieval Augmented Generation (RAG) App:\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LangChain\u306eRAG\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3084\u3063\u3066\u307f\u305f\uff08\u524d\u7de8\uff09 #langchain #langgraph #rag #azure #openai - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\" \/>\n<meta property=\"og:description\" content=\"AI, Azure, ChatGPT\uff06AI, d-higuchi, LLM, Python |\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f LangChain \u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb Build a Retrieval Augmented Generation (RAG) App:\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039\" \/>\n<meta property=\"og:site_name\" content=\"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/creationline\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-10T01:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-26T09:52:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2025\/04\/rag_retrieval_generation-1046_part1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"844\" \/>\n\t<meta property=\"og:image:height\" content=\"433\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Daisuke Higuchi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@creationline\" \/>\n<meta name=\"twitter:site\" content=\"@creationline\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daisuke Higuchi\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"5\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77039#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77039\"},\"author\":{\"name\":\"Daisuke Higuchi\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\"},\"headline\":\"LangChain\u306eRAG\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3084\u3063\u3066\u307f\u305f\uff08\u524d\u7de8\uff09 #langchain #langgraph #rag #azure #openai\",\"datePublished\":\"2025-04-10T01:00:00+00:00\",\"dateModified\":\"2026-05-26T09:52:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77039\"},\"wordCount\":144,\"image\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77039#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/rag_retrieval_generation-1046_part1.png\",\"articleSection\":[\"AI\",\"Azure\",\"ChatGPT\uff06AI\",\"d-higuchi\",\"LLM\",\"Python\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77039\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77039\",\"name\":\"LangChain\u306eRAG\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3084\u3063\u3066\u307f\u305f\uff08\u524d\u7de8\uff09 #langchain #langgraph #rag #azure #openai - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77039#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77039#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/rag_retrieval_generation-1046_part1.png\",\"datePublished\":\"2025-04-10T01:00:00+00:00\",\"dateModified\":\"2026-05-26T09:52:04+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\"},\"description\":\"AI, Azure, ChatGPT\uff06AI, d-higuchi, LLM, Python |\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f LangChain \u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb Build a Retrieval Augmented Generation (RAG) App:\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77039#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77039\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77039#primaryimage\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/rag_retrieval_generation-1046_part1.png\",\"contentUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/rag_retrieval_generation-1046_part1.png\",\"width\":844,\"height\":433},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77039#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"HOME\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8457\u8005\uff08Author\uff09\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"d-higuchi\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"LangChain\u306eRAG\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3084\u3063\u3066\u307f\u305f\uff08\u524d\u7de8\uff09 #langchain #langgraph #rag #azure #openai\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/\",\"name\":\"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\",\"description\":\"\u30a2\u30b8\u30e3\u30a4\u30eb\uff06DevOps\u3001\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\u3001AI\uff06LLM\u306e\u5148\u7aef\u6280\u8853\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\",\"name\":\"Daisuke Higuchi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/pngout-25-230x230.png\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/pngout-25-230x230.png\",\"contentUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/pngout-25-230x230.png\",\"caption\":\"Daisuke Higuchi\"},\"description\":\"\u306f\u3084\u308a\u306e\u6280\u8853\u8981\u7d20\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8b70\u306e\u9032\u3081\u65b9\u30fb\u6587\u7ae0\u306e\u66f8\u304d\u65b9\u306a\u3069\u306e\u696d\u52d9\u6539\u5584\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u3044\u307e\u3059\u3002\u300cChef\u6d3b\u7528\u30ac\u30a4\u30c9\u300d\u5171\u8457\u306e\u307b\u304b\u3001Debian Official Developer\u3082\u3084\u3063\u3066\u3044\u307e\u3059\u3002\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"LangChain\u306eRAG\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3084\u3063\u3066\u307f\u305f\uff08\u524d\u7de8\uff09 #langchain #langgraph #rag #azure #openai - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","description":"AI, Azure, ChatGPT\uff06AI, d-higuchi, LLM, Python |\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f LangChain \u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb Build a Retrieval Augmented Generation (RAG) App:","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039","og_locale":"ja_JP","og_type":"article","og_title":"LangChain\u306eRAG\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3084\u3063\u3066\u307f\u305f\uff08\u524d\u7de8\uff09 #langchain #langgraph #rag #azure #openai - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","og_description":"AI, Azure, ChatGPT\uff06AI, d-higuchi, LLM, Python |\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f LangChain \u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb Build a Retrieval Augmented Generation (RAG) App:","og_url":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039","og_site_name":"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","article_publisher":"https:\/\/www.facebook.com\/creationline","article_published_time":"2025-04-10T01:00:00+00:00","article_modified_time":"2026-05-26T09:52:04+00:00","og_image":[{"width":844,"height":433,"url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2025\/04\/rag_retrieval_generation-1046_part1.png","type":"image\/png"}],"author":"Daisuke Higuchi","twitter_card":"summary_large_image","twitter_creator":"@creationline","twitter_site":"@creationline","twitter_misc":{"\u57f7\u7b46\u8005":"Daisuke Higuchi","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"5\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039#article","isPartOf":{"@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039"},"author":{"name":"Daisuke Higuchi","@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206"},"headline":"LangChain\u306eRAG\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3084\u3063\u3066\u307f\u305f\uff08\u524d\u7de8\uff09 #langchain #langgraph #rag #azure #openai","datePublished":"2025-04-10T01:00:00+00:00","dateModified":"2026-05-26T09:52:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039"},"wordCount":144,"image":{"@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039#primaryimage"},"thumbnailUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2025\/04\/rag_retrieval_generation-1046_part1.png","articleSection":["AI","Azure","ChatGPT\uff06AI","d-higuchi","LLM","Python"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039","url":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039","name":"LangChain\u306eRAG\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3084\u3063\u3066\u307f\u305f\uff08\u524d\u7de8\uff09 #langchain #langgraph #rag #azure #openai - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","isPartOf":{"@id":"https:\/\/www.creationline.com\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039#primaryimage"},"image":{"@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039#primaryimage"},"thumbnailUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2025\/04\/rag_retrieval_generation-1046_part1.png","datePublished":"2025-04-10T01:00:00+00:00","dateModified":"2026-05-26T09:52:04+00:00","author":{"@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206"},"description":"AI, Azure, ChatGPT\uff06AI, d-higuchi, LLM, Python |\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f LangChain \u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb Build a Retrieval Augmented Generation (RAG) App:","breadcrumb":{"@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039#primaryimage","url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2025\/04\/rag_retrieval_generation-1046_part1.png","contentUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2025\/04\/rag_retrieval_generation-1046_part1.png","width":844,"height":433},{"@type":"BreadcrumbList","@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77039#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"HOME","item":"https:\/\/www.creationline.com\/tech-blog"},{"@type":"ListItem","position":2,"name":"\u8457\u8005\uff08Author\uff09","item":"https:\/\/www.creationline.com\/tech-blog\/author"},{"@type":"ListItem","position":3,"name":"d-higuchi","item":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi"},{"@type":"ListItem","position":4,"name":"LangChain\u306eRAG\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3084\u3063\u3066\u307f\u305f\uff08\u524d\u7de8\uff09 #langchain #langgraph #rag #azure #openai"}]},{"@type":"WebSite","@id":"https:\/\/www.creationline.com\/tech-blog\/#website","url":"https:\/\/www.creationline.com\/tech-blog\/","name":"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","description":"\u30a2\u30b8\u30e3\u30a4\u30eb\uff06DevOps\u3001\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\u3001AI\uff06LLM\u306e\u5148\u7aef\u6280\u8853","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.creationline.com\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206","name":"Daisuke Higuchi","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2026\/05\/pngout-25-230x230.png","url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2026\/05\/pngout-25-230x230.png","contentUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2026\/05\/pngout-25-230x230.png","caption":"Daisuke Higuchi"},"description":"\u306f\u3084\u308a\u306e\u6280\u8853\u8981\u7d20\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8b70\u306e\u9032\u3081\u65b9\u30fb\u6587\u7ae0\u306e\u66f8\u304d\u65b9\u306a\u3069\u306e\u696d\u52d9\u6539\u5584\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u3044\u307e\u3059\u3002\u300cChef\u6d3b\u7528\u30ac\u30a4\u30c9\u300d\u5171\u8457\u306e\u307b\u304b\u3001Debian Official Developer\u3082\u3084\u3063\u3066\u3044\u307e\u3059\u3002","url":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi"}]}},"_links":{"self":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/77039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=77039"}],"version-history":[{"count":5,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/77039\/revisions"}],"predecessor-version":[{"id":83874,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/77039\/revisions\/83874"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/media\/77105"}],"wp:attachment":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=77039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=77039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=77039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}