{"id":101851,"date":"2026-09-07T17:41:12","date_gmt":"2026-09-07T09:41:12","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/101851.html"},"modified":"2026-09-07T17:41:12","modified_gmt":"2026-09-07T09:41:12","slug":"gpt-6-%e4%b8%8e-langchain-%e9%9b%86%e6%88%90%e5%ae%9e%e6%88%98%ef%bc%9a%e6%9e%84%e5%bb%ba%e4%bc%81%e4%b8%9a%e7%ba%a7-rag-%e9%97%ae%e7%ad%94%e7%b3%bb%e7%bb%9f%e7%9a%84%e5%ae%8c%e6%95%b4%e6%95%99","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/101851.html","title":{"rendered":"GPT-6 \u4e0e LangChain \u96c6\u6210\u5b9e\u6218\uff1a\u6784\u5efa\u4f01\u4e1a\u7ea7 RAG \u95ee\u7b54\u7cfb\u7edf\u7684\u5b8c\u6574\u6559\u7a0b"},"content":{"rendered":"<h3>\u4e00\u3001\u4e3a\u4ec0\u4e48\u9009\u62e9 RAG \u67b6\u6784<\/h3>\n<p>GPT-6 \u867d\u7136\u62e5\u6709\u5f3a\u5927\u7684\u901a\u7528\u80fd\u529b&#xff0c;\u4f46\u4f01\u4e1a\u79c1\u6709\u77e5\u8bc6\u5e93\u4e2d\u7684\u4e1a\u52a1\u6570\u636e\u5f80\u5f80\u4e0d\u5728\u6a21\u578b\u8bad\u7ec3\u8303\u56f4\u5185\u3002RAG&#xff08;\u68c0\u7d22\u589e\u5f3a\u751f\u6210&#xff09;\u901a\u8fc7\u300c\u5148\u68c0\u7d22\u3001\u540e\u751f\u6210\u300d\u7684\u65b9\u5f0f&#xff0c;\u628a\u4f01\u4e1a\u6587\u6863\u3001\u6570\u636e\u5e93\u4e2d\u7684\u5185\u5bb9\u5b9e\u65f6\u6ce8\u5165\u63d0\u793a\u8bcd&#xff0c;\u8ba9\u6a21\u578b\u57fa\u4e8e\u771f\u5b9e\u4e1a\u52a1\u8d44\u6599\u4f5c\u7b54&#xff0c;\u65e2\u89e3\u51b3\u4e86\u77e5\u8bc6\u65f6\u6548\u6027\u95ee\u9898&#xff0c;\u4e5f\u964d\u4f4e\u4e86\u5e7b\u89c9\u98ce\u9669\u3002<\/p>\n<p>\u76f8\u6bd4\u76f4\u63a5\u5fae\u8c03&#xff0c;RAG \u5177\u5907\u4e09\u4e2a\u660e\u663e\u4f18\u52bf&#xff1a;\u4e00\u662f\u77e5\u8bc6\u66f4\u65b0\u6210\u672c\u4f4e&#xff0c;\u66ff\u6362\u7d22\u5f15\u5373\u53ef\u751f\u6548&#xff1b;\u4e8c\u662f\u53ef\u8ffd\u6eaf\u6027\u5f3a&#xff0c;\u6bcf\u4e2a\u56de\u7b54\u90fd\u80fd\u5b9a\u4f4d\u5230\u6765\u6e90\u6587\u6863&#xff1b;\u4e09\u662f\u90e8\u7f72\u95e8\u69db\u4f4e&#xff0c;\u65e0\u9700\u6602\u8d35\u7684\u8bad\u7ec3\u7b97\u529b\u3002\u56e0\u6b64&#xff0c;RAG \u6210\u4e3a\u4f01\u4e1a\u843d\u5730\u5927\u6a21\u578b\u5e94\u7528\u7684\u9996\u9009\u67b6\u6784\u3002<\/p>\n<h3>\u4e8c\u3001\u6574\u4f53\u67b6\u6784\u8bbe\u8ba1<\/h3>\n<p>\u4e00\u4e2a\u5b8c\u6574\u7684\u4f01\u4e1a\u7ea7 RAG \u7cfb\u7edf\u5305\u542b\u56db\u4e2a\u6838\u5fc3\u73af\u8282&#xff1a;\u6587\u6863\u52a0\u8f7d\u3001\u5411\u91cf\u5316\u5b58\u50a8\u3001\u68c0\u7d22\u53ec\u56de\u3001\u751f\u6210\u56de\u7b54\u3002\u4e0b\u9762\u7528\u4e00\u5f20\u6d41\u7a0b\u56fe\u5c55\u793a\u6574\u4f53\u94fe\u8def\u3002<\/p>\n<p>flowchart TD<br \/>\n    A[\u4f01\u4e1a\u6587\u6863] &#8211;&gt; B[\u6587\u6863\u52a0\u8f7d\u4e0e\u5207\u5206]<br \/>\n    B &#8211;&gt; C[\u5411\u91cf\u5316 Embedding]<br \/>\n    C &#8211;&gt; D[\u5411\u91cf\u6570\u636e\u5e93\u5b58\u50a8]<br \/>\n    E[\u7528\u6237\u63d0\u95ee] &#8211;&gt; F[\u95ee\u9898\u5411\u91cf\u5316]<br \/>\n    F &#8211;&gt; G[\u76f8\u4f3c\u5ea6\u68c0\u7d22]<br \/>\n    D &#8211;&gt; G<br \/>\n    G &#8211;&gt; H[\u62fc\u63a5\u4e0a\u4e0b\u6587\u4e0e\u95ee\u9898]<br \/>\n    H &#8211;&gt; I[GPT-6 \u751f\u6210\u56de\u7b54]<br \/>\n    I &#8211;&gt; J[\u8fd4\u56de\u7ed3\u679c\u5e76\u9644\u6765\u6e90]<\/p>\n<p>\u5176\u4e2d&#xff0c;\u6587\u6863\u5207\u5206\u8d28\u91cf\u3001\u5411\u91cf\u6a21\u578b\u9009\u62e9\u3001\u68c0\u7d22\u7b56\u7565\u548c\u63d0\u793a\u8bcd\u8bbe\u8ba1&#xff0c;\u662f\u51b3\u5b9a\u7cfb\u7edf\u6548\u679c\u7684\u5173\u952e\u56e0\u7d20\u3002\u4e0b\u9762\u9010\u4e00\u5c55\u5f00\u3002<\/p>\n<h3>\u4e09\u3001\u73af\u5883\u51c6\u5907\u4e0e\u4f9d\u8d56\u5b89\u88c5<\/h3>\n<p>\u672c\u6559\u7a0b\u4f7f\u7528 Python 3.10 \u53ca\u4ee5\u4e0a\u7248\u672c&#xff0c;\u6838\u5fc3\u4f9d\u8d56\u5305\u62ec LangChain\u3001OpenAI SDK\u3001\u5411\u91cf\u6570\u636e\u5e93\u548c\u6587\u6863\u89e3\u6790\u5e93\u3002\u5efa\u8bae\u4f7f\u7528\u865a\u62df\u73af\u5883\u9694\u79bb\u9879\u76ee\u4f9d\u8d56\u3002<\/p>\n<p>pip install langchain langchain-openai openai chromadb pypdf<\/p>\n<p>\u63a5\u4e0b\u6765\u5728\u9879\u76ee\u4e2d\u914d\u7f6e GPT-6 \u7684 API \u5bc6\u94a5\u3002\u63a8\u8350\u4f7f\u7528\u73af\u5883\u53d8\u91cf\u7ba1\u7406\u5bc6\u94a5&#xff0c;\u907f\u514d\u786c\u7f16\u7801\u6cc4\u9732\u3002<\/p>\n<p>import os<br \/>\nfrom langchain_openai import ChatOpenAI, OpenAIEmbeddings<br \/>\nos.environ[&#034;OPENAI_API_KEY&#034;] &#061; &#034;your-api-key&#034;<br \/>\n\u521d\u59cb\u5316 GPT-6 \u5bf9\u8bdd\u6a21\u578b<br \/>\nllm &#061; ChatOpenAI(<br \/>\nmodel&#061;&#034;gpt-6&#034;,<br \/>\ntemperature&#061;0.2,<br \/>\nmax_tokens&#061;2048<br \/>\n)<br \/>\n\u521d\u59cb\u5316\u5411\u91cf\u5316\u6a21\u578b<br \/>\nembeddings &#061; OpenAIEmbeddings(model&#061;&#034;text-embedding-3-large&#034;)<\/p>\n<h3>\u56db\u3001\u6587\u6863\u52a0\u8f7d\u4e0e\u667a\u80fd\u5207\u5206<\/h3>\n<p>\u4f01\u4e1a\u6587\u6863\u683c\u5f0f\u591a\u6837&#xff0c;\u5e38\u89c1\u7684\u6709 PDF\u3001Word\u3001Markdown \u7b49\u3002LangChain \u63d0\u4f9b\u4e86\u7edf\u4e00\u7684\u52a0\u8f7d\u5668\u63a5\u53e3&#xff0c;\u8fd9\u91cc\u4ee5 PDF \u4e3a\u4f8b\u6f14\u793a\u52a0\u8f7d\u6d41\u7a0b\u3002<\/p>\n<p>from langchain_community.document_loaders import PyPDFLoader<br \/>\nloader &#061; PyPDFLoader(&#034;enterprise_manual.pdf&#034;)<br \/>\ndocuments &#061; loader.load()<br \/>\nprint(f&#034;\u5171\u52a0\u8f7d {len(documents)} \u9875\u6587\u6863&#034;)<\/p>\n<p>\u6587\u6863\u5207\u5206\u662f\u5f71\u54cd\u68c0\u7d22\u8d28\u91cf\u7684\u6838\u5fc3\u73af\u8282\u3002\u5207\u5206\u8fc7\u5927&#xff0c;\u4e0a\u4e0b\u6587\u566a\u58f0\u591a\u3001\u6210\u672c\u9ad8&#xff1b;\u5207\u5206\u8fc7\u5c0f&#xff0c;\u8bed\u4e49\u4e0d\u5b8c\u6574\u3001\u53ec\u56de\u4e0d\u51c6\u3002\u63a8\u8350\u6309\u7ae0\u8282\u7ed3\u6784\u4f18\u5148\u5207\u5206&#xff0c;\u518d\u7ed3\u5408\u56fa\u5b9a\u957f\u5ea6\u515c\u5e95\u3002<\/p>\n<p>from langchain.text_splitter import RecursiveCharacterTextSplitter<br \/>\ntext_splitter &#061; RecursiveCharacterTextSplitter(<br \/>\nchunk_size&#061;800,<br \/>\nchunk_overlap&#061;120,<br \/>\nseparators&#061;[&#034;\\\\n\\\\n&#034;, &#034;\\\\n&#034;, &#034;\u3002&#034;, &#034;&#xff01;&#034;, &#034;&#xff1f;&#034;, &#034;&#xff1b;&#034;, &#034; &#034;, &#034;&#034;]<br \/>\n)<br \/>\nchunks &#061; text_splitter.split_documents(documents)<br \/>\nprint(f&#034;\u5207\u5206\u540e\u5171 {len(chunks)} \u4e2a\u6587\u672c\u5757&#034;)<\/p>\n<h3>\u4e94\u3001\u5411\u91cf\u5316\u5b58\u50a8\u4e0e\u7d22\u5f15\u6784\u5efa<\/h3>\n<p>\u5207\u5206\u5b8c\u6210\u540e&#xff0c;\u9700\u8981\u628a\u6bcf\u4e2a\u6587\u672c\u5757\u5411\u91cf\u5316\u5e76\u5199\u5165\u5411\u91cf\u6570\u636e\u5e93\u3002\u8fd9\u91cc\u4f7f\u7528 Chroma \u4f5c\u4e3a\u672c\u5730\u5411\u91cf\u5e93&#xff0c;\u4fbf\u4e8e\u5feb\u901f\u9a8c\u8bc1&#xff1b;\u751f\u4ea7\u73af\u5883\u53ef\u66ff\u6362\u4e3a Milvus \u6216 Elasticsearch\u3002<\/p>\n<p>from langchain_chroma import Chroma<br \/>\nvector_store &#061; Chroma.from_documents(<br \/>\ndocuments&#061;chunks,<br \/>\nembedding&#061;embeddings,<br \/>\npersist_directory&#061;&#034;.\/chroma_db&#034;<br \/>\n)<br \/>\nprint(&#034;\u5411\u91cf\u7d22\u5f15\u6784\u5efa\u5b8c\u6210&#034;)<\/p>\n<p>\u6784\u5efa\u7d22\u5f15\u65f6\u9700\u8981\u6ce8\u610f\u4e24\u70b9&#xff1a;\u4e00\u662f\u4e3a\u6bcf\u4e2a\u6587\u672c\u5757\u4fdd\u7559\u6765\u6e90\u5143\u6570\u636e&#xff0c;\u4fbf\u4e8e\u56de\u7b54\u65f6\u8ffd\u6eaf&#xff1b;\u4e8c\u662f\u5b9a\u671f\u91cd\u5efa\u7d22\u5f15&#xff0c;\u4fdd\u8bc1\u65b0\u589e\u6587\u6863\u80fd\u53ca\u65f6\u88ab\u68c0\u7d22\u5230\u3002<\/p>\n<h3>\u516d\u3001\u68c0\u7d22\u7b56\u7565\u4e0e\u91cd\u6392\u5e8f\u4f18\u5316<\/h3>\n<p>\u57fa\u7840\u68c0\u7d22\u4f7f\u7528\u5411\u91cf\u76f8\u4f3c\u5ea6\u53ec\u56de Top-K \u6587\u672c\u5757\u3002\u4f46\u4f01\u4e1a\u573a\u666f\u4e0b&#xff0c;\u5355\u7eaf\u4f9d\u8d56\u5411\u91cf\u68c0\u7d22\u5f80\u5f80\u4e0d\u591f\u7cbe\u51c6&#xff0c;\u5efa\u8bae\u5f15\u5165\u91cd\u6392\u5e8f\u6a21\u578b\u5bf9\u53ec\u56de\u7ed3\u679c\u4e8c\u6b21\u6253\u5206\u3002<\/p>\n<p>from langchain.retrievers import ContextualCompressionRetriever<br \/>\nfrom langchain.retrievers.document_compressors import CrossEncoderReranker<br \/>\nfrom langchain_community.cross_encoders import HuggingFaceCrossEncoder<br \/>\nbase_retriever &#061; vector_store.as_retriever(search_kwargs&#061;{&#034;k&#034;: 8})<br \/>\nreranker &#061; CrossEncoderReranker(<br \/>\nmodel&#061;HuggingFaceCrossEncoder(model_name&#061;&#034;BAAI\/bge-reranker-v2-m3&#034;),<br \/>\ntop_n&#061;4<br \/>\n)<br \/>\ncompression_retriever &#061; ContextualCompressionRetriever(<br \/>\nbase_compressor&#061;reranker,<br \/>\nbase_retriever&#061;base_retriever<br \/>\n)<\/p>\n<p>\u7ecf\u8fc7\u91cd\u6392\u5e8f\u540e&#xff0c;\u7cfb\u7edf\u53ea\u4fdd\u7559\u4e0e\u95ee\u9898\u6700\u76f8\u5173\u7684 4 \u4e2a\u6587\u672c\u5757\u9001\u5165\u751f\u6210\u73af\u8282&#xff0c;\u65e2\u63d0\u5347\u4e86\u56de\u7b54\u51c6\u786e\u7387&#xff0c;\u4e5f\u63a7\u5236\u4e86 Token \u6d88\u8017\u3002<\/p>\n<h3>\u4e03\u3001\u63d0\u793a\u8bcd\u8bbe\u8ba1\u4e0e\u95ee\u7b54\u94fe\u8def<\/h3>\n<p>\u63d0\u793a\u8bcd\u662f\u8fde\u63a5\u68c0\u7d22\u7ed3\u679c\u4e0e\u6a21\u578b\u751f\u6210\u7684\u6865\u6881\u3002\u597d\u7684\u63d0\u793a\u8bcd\u5e94\u660e\u786e\u8981\u6c42\u6a21\u578b\u53ea\u4f9d\u636e\u7ed9\u5b9a\u4e0a\u4e0b\u6587\u4f5c\u7b54&#xff0c;\u5e76\u5728\u4fe1\u606f\u4e0d\u8db3\u65f6\u5982\u5b9e\u8bf4\u660e\u3002<\/p>\n<p>from langchain_core.prompts import ChatPromptTemplate<br \/>\nprompt &#061; ChatPromptTemplate.from_messages([<br \/>\n(&#034;system&#034;, &#034;\u4f60\u662f\u4e00\u4e2a\u4f01\u4e1a\u77e5\u8bc6\u5e93\u95ee\u7b54\u52a9\u624b\u3002\u8bf7\u4e25\u683c\u4f9d\u636e\u63d0\u4f9b\u7684\u4e0a\u4e0b\u6587\u56de\u7b54\u7528\u6237\u95ee\u9898\u3002&#034;<br \/>\n&#034;\u5982\u679c\u4e0a\u4e0b\u6587\u4e2d\u6ca1\u6709\u76f8\u5173\u4fe1\u606f&#xff0c;\u8bf7\u660e\u786e\u56de\u7b54&#039;\u77e5\u8bc6\u5e93\u4e2d\u672a\u627e\u5230\u76f8\u5173\u5185\u5bb9&#039;&#xff0c;\u4e0d\u8981\u7f16\u9020\u7b54\u6848\u3002&#034;<br \/>\n&#034;\u56de\u7b54\u672b\u5c3e\u8bf7\u6807\u6ce8\u4fe1\u606f\u6765\u6e90\u3002&#034;),<br \/>\n(&#034;human&#034;, &#034;\u4e0a\u4e0b\u6587&#xff1a;\\\\n{context}\\\\n\\\\n\u95ee\u9898&#xff1a;{question}&#034;)<br \/>\n])<\/p>\n<p>\u6700\u540e&#xff0c;\u628a\u68c0\u7d22\u5668\u3001\u63d0\u793a\u8bcd\u548c GPT-6 \u6a21\u578b\u4e32\u8054\u6210\u5b8c\u6574\u7684\u95ee\u7b54\u94fe\u8def\u3002<\/p>\n<p>from langchain_core.runnables import RunnablePassthrough<br \/>\nfrom langchain_core.output_parsers import StrOutputParser<br \/>\ndef format_docs(docs):<br \/>\nreturn &#034;\\\\n\\\\n&#034;.join(f&#034;\u3010\u6765\u6e90&#xff1a;{doc.metadata.get(&#039;source&#039;, &#039;\u672a\u77e5&#039;)}\u3011\\\\n{doc.page_content}&#034; for doc in docs)<br \/>\nrag_chain &#061; (<br \/>\n{&#034;context&#034;: compression_retriever | format_docs, &#034;question&#034;: RunnablePassthrough()}<br \/>\n| prompt<br \/>\n| llm<br \/>\n| StrOutputParser()<br \/>\n)<br \/>\n\u6d4b\u8bd5\u95ee\u7b54<br \/>\nresult &#061; rag_chain.invoke(&#034;\u516c\u53f8\u5e74\u5047\u653f\u7b56\u662f\u4ec0\u4e48&#xff1f;&#034;)<br \/>\nprint(result)<\/p>\n<h3>\u516b\u3001\u6548\u679c\u8bc4\u4f30\u4e0e\u8c03\u4f18\u5efa\u8bae<\/h3>\n<p>\u7cfb\u7edf\u4e0a\u7ebf\u524d&#xff0c;\u5efa\u8bae\u51c6\u5907\u4e00\u7ec4\u8986\u76d6\u5e38\u89c1\u4e1a\u52a1\u95ee\u9898\u7684\u6d4b\u8bd5\u96c6&#xff0c;\u4ece\u53ec\u56de\u51c6\u786e\u7387\u3001\u56de\u7b54\u6b63\u786e\u7387\u3001\u6765\u6e90\u53ef\u8ffd\u6eaf\u6027\u4e09\u4e2a\u7ef4\u5ea6\u8bc4\u4f30\u6548\u679c\u3002\u5e38\u89c1\u95ee\u9898\u4e0e\u8c03\u4f18\u65b9\u5411\u5982\u4e0b&#xff1a;<\/p>\n<table>\n<tr>\u95ee\u9898\u73b0\u8c61\u53ef\u80fd\u539f\u56e0\u8c03\u4f18\u65b9\u5411<\/tr>\n<tbody>\n<tr>\n<td>\u56de\u7b54\u4e0e\u95ee\u9898\u65e0\u5173<\/td>\n<td>\u68c0\u7d22\u53ec\u56de\u4e0d\u51c6\u786e<\/td>\n<td>\u8c03\u6574\u5207\u5206\u7c92\u5ea6\u3001\u589e\u52a0\u91cd\u6392\u5e8f\u3001\u4f18\u5316\u5411\u91cf\u6a21\u578b<\/td>\n<\/tr>\n<tr>\n<td>\u56de\u7b54\u5185\u5bb9\u8fc7\u65f6<\/td>\n<td>\u7d22\u5f15\u672a\u53ca\u65f6\u66f4\u65b0<\/td>\n<td>\u5efa\u7acb\u6587\u6863\u589e\u91cf\u66f4\u65b0\u673a\u5236<\/td>\n<\/tr>\n<tr>\n<td>\u56de\u7b54\u7f3a\u4e4f\u4f9d\u636e<\/td>\n<td>\u4e0a\u4e0b\u6587\u62fc\u63a5\u4e0d\u5b8c\u6574<\/td>\n<td>\u589e\u5927 Top-K \u6570\u91cf\u3001\u4f18\u5316\u63d0\u793a\u8bcd\u7ea6\u675f<\/td>\n<\/tr>\n<tr>\n<td>\u54cd\u5e94\u5ef6\u8fdf\u8fc7\u9ad8<\/td>\n<td>\u68c0\u7d22\u94fe\u8def\u8fc7\u957f<\/td>\n<td>\u7cbe\u7b80\u53ec\u56de\u6570\u91cf\u3001\u5f15\u5165\u7f13\u5b58\u673a\u5236<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6b64\u5916&#xff0c;\u5efa\u8bae\u5728\u7cfb\u7edf\u4e2d\u52a0\u5165\u65e5\u5fd7\u8bb0\u5f55&#xff0c;\u6c89\u6dc0\u7528\u6237\u771f\u5b9e\u95ee\u9898&#xff0c;\u6301\u7eed\u8fed\u4ee3\u68c0\u7d22\u7b56\u7565\u548c\u63d0\u793a\u8bcd\u6a21\u677f\u3002<\/p>\n<h3>\u4e5d\u3001\u603b\u7ed3<\/h3>\n<p>\u672c\u6587\u4ece\u67b6\u6784\u8bbe\u8ba1\u3001\u73af\u5883\u642d\u5efa\u3001\u6587\u6863\u5207\u5206\u3001\u5411\u91cf\u5b58\u50a8\u3001\u68c0\u7d22\u4f18\u5316\u5230\u63d0\u793a\u8bcd\u7f16\u6392&#xff0c;\u5b8c\u6574\u6f14\u793a\u4e86\u57fa\u4e8e GPT-6 \u4e0e LangChain \u6784\u5efa\u4f01\u4e1a\u7ea7 RAG \u95ee\u7b54\u7cfb\u7edf\u7684\u5168\u8fc7\u7a0b\u3002\u6838\u5fc3\u8981\u70b9\u53ef\u4ee5\u6982\u62ec\u4e3a&#xff1a;\u5207\u5206\u8d28\u91cf\u51b3\u5b9a\u53ec\u56de\u4e0a\u9650&#xff0c;\u91cd\u6392\u5e8f\u51b3\u5b9a\u7cbe\u5ea6&#xff0c;\u63d0\u793a\u8bcd\u51b3\u5b9a\u751f\u6210\u8d28\u91cf\u3002<\/p>\n<p>\u8bfb\u8005\u53ef\u4ee5\u5728\u6b64\u57fa\u7840\u4e0a&#xff0c;\u7ed3\u5408\u81ea\u8eab\u4e1a\u52a1\u6587\u6863\u66ff\u6362\u6570\u636e\u6e90&#xff0c;\u5e76\u9010\u6b65\u5f15\u5165\u6743\u9650\u63a7\u5236\u3001\u591a\u8f6e\u5bf9\u8bdd\u548c\u6d41\u5f0f\u8f93\u51fa\u7b49\u4f01\u4e1a\u7ea7\u80fd\u529b&#xff0c;\u6253\u9020\u771f\u6b63\u53ef\u843d\u5730\u7684\u667a\u80fd\u95ee\u7b54\u7cfb\u7edf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u4e3a\u4ec0\u4e48\u9009\u62e9 RAG \u67b6\u6784GPT-6 \u867d\u7136\u62e5\u6709\u5f3a\u5927\u7684\u901a\u7528\u80fd\u529b&#xff0c;\u4f46\u4f01\u4e1a\u79c1\u6709\u77e5\u8bc6\u5e93\u4e2d\u7684\u4e1a\u52a1\u6570\u636e\u5f80\u5f80\u4e0d\u5728\u6a21\u578b\u8bad\u7ec3\u8303\u56f4\u5185\u3002RAG&#xff08;\u68c0\u7d22\u589e\u5f3a\u751f\u6210&#xff09;\u901a\u8fc7\u300c\u5148\u68c0\u7d22\u3001\u540e\u751f\u6210\u300d\u7684\u65b9\u5f0f&#xff0c;\u628a\u4f01\u4e1a\u6587\u6863\u3001\u6570\u636e\u5e93\u4e2d\u7684\u5185\u5bb9\u5b9e\u65f6\u6ce8\u5165\u63d0\u793a\u8bcd&#xff0c;\u8ba9\u6a21\u578b\u57fa\u4e8e\u771f\u5b9e\u4e1a\u52a1\u8d44\u6599\u4f5c\u7b54&#xff0c;\u65e2\u89e3\u51b3\u4e86\u77e5\u8bc6\u65f6\u6548\u6027\u95ee\u9898&#xff0c;\u4e5f\u964d\u4f4e\u4e86\u5e7b\u89c9\u98ce\u9669\u3002\u76f8\u6bd4\u76f4\u63a5\u5fae\u8c03&#xff0c;RAG \u5177\u5907\u4e09\u4e2a\u660e\u663e\u4f18\u52bf&#xff1a;\u4e00\u662f\u77e5\u8bc6\u66f4\u65b0\u6210\u672c\u4f4e&#xff0c;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9098,1646,997,604],"topic":[],"class_list":["post-101851","post","type-post","status-publish","format-standard","hentry","category-server","tag-it","tag-gpt","tag-langchain","tag-oracle"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GPT-6 \u4e0e LangChain \u96c6\u6210\u5b9e\u6218\uff1a\u6784\u5efa\u4f01\u4e1a\u7ea7 RAG \u95ee\u7b54\u7cfb\u7edf\u7684\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\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.wsisp.com\/helps\/101851.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GPT-6 \u4e0e LangChain \u96c6\u6210\u5b9e\u6218\uff1a\u6784\u5efa\u4f01\u4e1a\u7ea7 RAG \u95ee\u7b54\u7cfb\u7edf\u7684\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u4e3a\u4ec0\u4e48\u9009\u62e9 RAG \u67b6\u6784GPT-6 \u867d\u7136\u62e5\u6709\u5f3a\u5927\u7684\u901a\u7528\u80fd\u529b&#xff0c;\u4f46\u4f01\u4e1a\u79c1\u6709\u77e5\u8bc6\u5e93\u4e2d\u7684\u4e1a\u52a1\u6570\u636e\u5f80\u5f80\u4e0d\u5728\u6a21\u578b\u8bad\u7ec3\u8303\u56f4\u5185\u3002RAG&#xff08;\u68c0\u7d22\u589e\u5f3a\u751f\u6210&#xff09;\u901a\u8fc7\u300c\u5148\u68c0\u7d22\u3001\u540e\u751f\u6210\u300d\u7684\u65b9\u5f0f&#xff0c;\u628a\u4f01\u4e1a\u6587\u6863\u3001\u6570\u636e\u5e93\u4e2d\u7684\u5185\u5bb9\u5b9e\u65f6\u6ce8\u5165\u63d0\u793a\u8bcd&#xff0c;\u8ba9\u6a21\u578b\u57fa\u4e8e\u771f\u5b9e\u4e1a\u52a1\u8d44\u6599\u4f5c\u7b54&#xff0c;\u65e2\u89e3\u51b3\u4e86\u77e5\u8bc6\u65f6\u6548\u6027\u95ee\u9898&#xff0c;\u4e5f\u964d\u4f4e\u4e86\u5e7b\u89c9\u98ce\u9669\u3002\u76f8\u6bd4\u76f4\u63a5\u5fae\u8c03&#xff0c;RAG \u5177\u5907\u4e09\u4e2a\u660e\u663e\u4f18\u52bf&#xff1a;\u4e00\u662f\u77e5\u8bc6\u66f4\u65b0\u6210\u672c\u4f4e&#xff0c;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/101851.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-07T09:41:12+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/101851.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/101851.html\",\"name\":\"GPT-6 \u4e0e LangChain \u96c6\u6210\u5b9e\u6218\uff1a\u6784\u5efa\u4f01\u4e1a\u7ea7 RAG \u95ee\u7b54\u7cfb\u7edf\u7684\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-07T09:41:12+00:00\",\"dateModified\":\"2026-09-07T09:41:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/101851.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/101851.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/101851.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GPT-6 \u4e0e LangChain \u96c6\u6210\u5b9e\u6218\uff1a\u6784\u5efa\u4f01\u4e1a\u7ea7 RAG \u95ee\u7b54\u7cfb\u7edf\u7684\u5b8c\u6574\u6559\u7a0b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GPT-6 \u4e0e LangChain \u96c6\u6210\u5b9e\u6218\uff1a\u6784\u5efa\u4f01\u4e1a\u7ea7 RAG \u95ee\u7b54\u7cfb\u7edf\u7684\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/101851.html","og_locale":"zh_CN","og_type":"article","og_title":"GPT-6 \u4e0e LangChain \u96c6\u6210\u5b9e\u6218\uff1a\u6784\u5efa\u4f01\u4e1a\u7ea7 RAG \u95ee\u7b54\u7cfb\u7edf\u7684\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u4e3a\u4ec0\u4e48\u9009\u62e9 RAG \u67b6\u6784GPT-6 \u867d\u7136\u62e5\u6709\u5f3a\u5927\u7684\u901a\u7528\u80fd\u529b&#xff0c;\u4f46\u4f01\u4e1a\u79c1\u6709\u77e5\u8bc6\u5e93\u4e2d\u7684\u4e1a\u52a1\u6570\u636e\u5f80\u5f80\u4e0d\u5728\u6a21\u578b\u8bad\u7ec3\u8303\u56f4\u5185\u3002RAG&#xff08;\u68c0\u7d22\u589e\u5f3a\u751f\u6210&#xff09;\u901a\u8fc7\u300c\u5148\u68c0\u7d22\u3001\u540e\u751f\u6210\u300d\u7684\u65b9\u5f0f&#xff0c;\u628a\u4f01\u4e1a\u6587\u6863\u3001\u6570\u636e\u5e93\u4e2d\u7684\u5185\u5bb9\u5b9e\u65f6\u6ce8\u5165\u63d0\u793a\u8bcd&#xff0c;\u8ba9\u6a21\u578b\u57fa\u4e8e\u771f\u5b9e\u4e1a\u52a1\u8d44\u6599\u4f5c\u7b54&#xff0c;\u65e2\u89e3\u51b3\u4e86\u77e5\u8bc6\u65f6\u6548\u6027\u95ee\u9898&#xff0c;\u4e5f\u964d\u4f4e\u4e86\u5e7b\u89c9\u98ce\u9669\u3002\u76f8\u6bd4\u76f4\u63a5\u5fae\u8c03&#xff0c;RAG \u5177\u5907\u4e09\u4e2a\u660e\u663e\u4f18\u52bf&#xff1a;\u4e00\u662f\u77e5\u8bc6\u66f4\u65b0\u6210\u672c\u4f4e&#xff0c;","og_url":"https:\/\/www.wsisp.com\/helps\/101851.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-07T09:41:12+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/101851.html","url":"https:\/\/www.wsisp.com\/helps\/101851.html","name":"GPT-6 \u4e0e LangChain \u96c6\u6210\u5b9e\u6218\uff1a\u6784\u5efa\u4f01\u4e1a\u7ea7 RAG \u95ee\u7b54\u7cfb\u7edf\u7684\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-07T09:41:12+00:00","dateModified":"2026-09-07T09:41:12+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/101851.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/101851.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/101851.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"GPT-6 \u4e0e LangChain \u96c6\u6210\u5b9e\u6218\uff1a\u6784\u5efa\u4f01\u4e1a\u7ea7 RAG \u95ee\u7b54\u7cfb\u7edf\u7684\u5b8c\u6574\u6559\u7a0b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/101851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=101851"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/101851\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=101851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=101851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=101851"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=101851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}