{"id":86122,"date":"2026-07-28T06:16:49","date_gmt":"2026-07-27T22:16:49","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/86122.html"},"modified":"2026-07-28T06:16:49","modified_gmt":"2026-07-27T22:16:49","slug":"ai%e5%b7%a5%e5%85%b7%e9%93%be7%e6%9c%88%e9%80%89%e5%9e%8b%e6%80%bb%e7%bb%93%ef%bc%9alangchain%e3%80%81%e5%90%91%e9%87%8f%e6%95%b0%e6%8d%ae%e5%ba%93%e4%b8%8ellmops%e5%b7%a5%e5%85%b7%e7%94%9f%e6%80%81","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/86122.html","title":{"rendered":"AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3\uff1aLangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001"},"content":{"rendered":"<h2>AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3&#xff1a;LangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001<\/h2>\n<h3>\u4e00\u3001\u9009\u578b\u573a\u666f&#xff1a;\u4ece\u5b9e\u9a8c\u5230\u751f\u4ea7<\/h3>\n<p>7\u6708\u56e2\u961f\u9762\u4e34\u4e00\u4e2a\u5173\u952e\u8282\u70b9&#xff1a;AI\u529f\u80fd\u4ece&#034;\u5185\u90e8\u5b9e\u9a8c&#034;\u8d70\u5411&#034;\u751f\u4ea7\u4ea4\u4ed8&#034;\u3002\u4e4b\u524d\u7684\u539f\u578b\u9636\u6bb5\u53ef\u4ee5\u7528Jupyter Notebook&#043;\u624b\u52a8\u811a\u672c\u5b8c\u6210\u3002\u4f46\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u9700\u8981\u4e00\u5957\u5b8c\u6574\u7684\u5de5\u5177\u94fe&#xff1a;\u4ece\u6a21\u578b\u8c03\u7528\u5230\u6570\u636e\u7ba1\u7406\u3001\u4ece\u8bc4\u4f30\u5230\u76d1\u63a7\u3002<\/p>\n<p>\u6211\u57287\u6708\u7cfb\u7edf\u5730\u8bc4\u4f30\u4e86AI\u5de5\u5177\u94fe\u7684\u4e09\u4e2a\u6838\u5fc3\u73af\u8282&#xff1a;\u6846\u67b6\u5c42&#xff08;LangChain\/LlamaIndex&#xff09;\u3001\u5b58\u50a8\u5c42&#xff08;\u5411\u91cf\u6570\u636e\u5e93&#xff09;\u3001\u8fd0\u7ef4\u5c42&#xff08;LLMOps&#xff09;\u3002<\/p>\n<p>\u672c\u6587\u662f\u8bc4\u4f30\u7ed3\u679c\u7684\u6708\u5ea6\u603b\u7ed3\u3002<\/p>\n<h3>\u4e8c\u3001\u6846\u67b6\u5c42&#xff1a;LangChain vs LlamaIndex vs \u539f\u751f<\/h3>\n<p>\u8bc4\u4f30\u6807\u51c6&#xff1a;\u5f00\u53d1\u6548\u7387\u3001\u751f\u4ea7\u7a33\u5b9a\u6027\u3001\u5b66\u4e60\u6210\u672c\u3001\u751f\u6001\u6210\u719f\u5ea6\u3002<\/p>\n<p>LangChain\u7684\u53d6\u820d&#xff1a;<\/p>\n<p>LangChain\u4ecd\u7136\u662f\u4f7f\u7528\u6700\u5e7f\u6cdb\u7684LLM\u6846\u67b6\u3002\u4f467\u6708\u7684\u4f7f\u7528\u4f53\u9a8c\u8bc1\u5b9e\u4e86\u793e\u533a\u7684\u4e00\u4e2a\u6279\u8bc4&#xff1a;LangChain\u8fc7\u5ea6\u62bd\u8c61\u3002<\/p>\n<p># LangChain\u7684\u62bd\u8c61\u5c42\u6b21&#xff08;\u7b80\u5316\u6982\u5ff5\u6a21\u578b&#xff09;<br \/>\nfrom langchain_core.runnables import RunnablePassthrough<br \/>\nfrom langchain_core.prompts import ChatPromptTemplate<br \/>\nfrom langchain_core.output_parsers import StrOutputParser<\/p>\n<p># \u94fe\u5f0f\u8c03\u7528 &#8211; LangChain\u7684\u6838\u5fc3\u6a21\u5f0f<br \/>\ndef build_qa_chain(llm, retriever):<br \/>\n    &#034;&#034;&#034;\u6784\u5efa\u95ee\u7b54\u94fe&#034;&#034;&#034;<br \/>\n    template &#061; &#034;&#034;&#034;\u57fa\u4e8e\u4ee5\u4e0b\u4e0a\u4e0b\u6587\u56de\u7b54\u95ee\u9898&#xff1a;<\/p>\n<p>    \u4e0a\u4e0b\u6587&#xff1a;{context}<\/p>\n<p>    \u95ee\u9898&#xff1a;{question}<\/p>\n<p>    \u56de\u7b54&#xff1a;&#034;&#034;&#034;<\/p>\n<p>    prompt &#061; ChatPromptTemplate.from_template(template)<\/p>\n<p>    chain &#061; (<br \/>\n        {&#034;context&#034;: retriever, &#034;question&#034;: RunnablePassthrough()}<br \/>\n        | prompt<br \/>\n        | llm<br \/>\n        | StrOutputParser()<br \/>\n    )<\/p>\n<p>    return chain<\/p>\n<p>LangChain\u7684\u4f18\u52bf&#xff1a;<\/p>\n<ul>\n<li>\u751f\u6001\u4e30\u5bcc&#xff1a;600&#043;\u96c6\u6210&#xff0c;\u8986\u76d6\u51e0\u4e4e\u6240\u6709\u6a21\u578b\u548c\u5de5\u5177\u3002<\/li>\n<li>\u62bd\u8c61\u5b8c\u5584&#xff1a;Chains\u3001Agents\u3001Tools\u7b49\u6a21\u5f0f\u6210\u719f\u3002<\/li>\n<li>\u793e\u533a\u6d3b\u8dc3&#xff1a;\u9047\u5230\u95ee\u9898\u5bb9\u6613\u627e\u5230\u89e3\u51b3\u65b9\u6848\u3002<\/li>\n<\/ul>\n<p>LangChain\u7684\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>\u7248\u672c\u5347\u7ea7\u9891\u7e41\u4e14\u4e0d\u517c\u5bb9&#xff08;0.x\u21921.x\u6539\u52a8\u5de8\u5927&#xff09;\u3002<\/li>\n<li>\u8fc7\u5ea6\u62bd\u8c61\u5bfc\u81f4\u8c03\u8bd5\u56f0\u96be&#xff08;\u4e00\u4e2a\u9519\u8bef\u53ef\u80fd\u7a7f\u900f5\u5c42\u62bd\u8c61&#xff09;\u3002<\/li>\n<li>\u5b66\u4e60\u66f2\u7ebf\u9661\u5ced\u3002<\/li>\n<\/ul>\n<p>LlamaIndex\u7684\u5b9a\u4f4d&#xff1a;<\/p>\n<p>\u5982\u679cLangChain\u662f&#034;\u901a\u7528\u6846\u67b6&#034;&#xff0c;LlamaIndex\u5c31\u662f&#034;\u6570\u636e\u5bc6\u96c6\u578bAI\u5e94\u7528\u7684\u745e\u58eb\u519b\u5200&#034;\u3002\u5b83\u7684\u6838\u5fc3\u4f18\u52bf\u5728\u6570\u636e\u5904\u7406\u7ba1\u9053\u4e0a\u3002<\/p>\n<p># LlamaIndex\u7684\u6570\u636e\u5904\u7406\u7ba1\u9053<br \/>\nfrom llama_index.core import (<br \/>\n    VectorStoreIndex, SimpleDirectoryReader,<br \/>\n    Settings, StorageContext<br \/>\n)<br \/>\nfrom llama_index.embeddings.openai import OpenAIEmbedding<\/p>\n<p># \u6570\u636e\u6444\u5165 \u2192 \u7d22\u5f15\u6784\u5efa \u2192 \u67e5\u8be2<br \/>\nclass DocumentPipeline:<br \/>\n    &#034;&#034;&#034;\u6587\u6863\u5904\u7406\u7ba1\u9053&#034;&#034;&#034;<\/p>\n<p>    def __init__(self):<br \/>\n        Settings.embed_model &#061; OpenAIEmbedding(model&#061;&#034;text-embedding-3-small&#034;)<\/p>\n<p>    def index_documents(self, doc_dir: str):<br \/>\n        &#034;&#034;&#034;\u4ece\u76ee\u5f55\u6784\u5efa\u7d22\u5f15&#034;&#034;&#034;<br \/>\n        documents &#061; SimpleDirectoryReader(doc_dir).load_data()<br \/>\n        index &#061; VectorStoreIndex.from_documents(<br \/>\n            documents,<br \/>\n            show_progress&#061;True,<br \/>\n            # \u81ea\u5b9a\u4e49\u5206\u5757\u7b56\u7565<br \/>\n            transformations&#061;[<br \/>\n                SentenceSplitter(chunk_size&#061;512, chunk_overlap&#061;50),<br \/>\n            ]<br \/>\n        )<br \/>\n        return index<\/p>\n<p>    def query(self, index, question: str):<br \/>\n        &#034;&#034;&#034;\u67e5\u8be2\u7d22\u5f15&#034;&#034;&#034;<br \/>\n        query_engine &#061; index.as_query_engine(<br \/>\n            response_mode&#061;&#034;tree_summarize&#034;,<br \/>\n            similarity_top_k&#061;5<br \/>\n        )<br \/>\n        return query_engine.query(question)<\/p>\n<p>\u9009\u578b\u7ed3\u8bba&#xff1a;<\/p>\n<table>\n<tr>\u573a\u666f\u63a8\u8350\u65b9\u6848\u7406\u7531<\/tr>\n<tbody>\n<tr>\n<td>\u7b80\u5355LLM\u8c03\u7528<\/td>\n<td>\u539f\u751fSDK(openai\/anthropic)<\/td>\n<td>\u65e0\u6846\u67b6\u5f00\u9500&#xff0c;\u4ee3\u7801\u53ef\u63a7<\/td>\n<\/tr>\n<tr>\n<td>\u590d\u6742Agent\u5de5\u4f5c\u6d41<\/td>\n<td>LangChain &#043; LangGraph<\/td>\n<td>Agent\u6a21\u5f0f\u6700\u6210\u719f<\/td>\n<\/tr>\n<tr>\n<td>\u6587\u6863\/RAG\u5bc6\u96c6\u578b<\/td>\n<td>LlamaIndex<\/td>\n<td>\u6570\u636e\u7ba1\u9053\u6700\u5b8c\u5584<\/td>\n<\/tr>\n<tr>\n<td>\u5185\u90e8\u5de5\u5177\u5feb\u901f\u642d\u5efa<\/td>\n<td>Dify\/Coze<\/td>\n<td>\u4f4e\u4ee3\u7801&#xff0c;\u975e\u6280\u672f\u56e2\u961f\u53ef\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6838\u5fc3\u539f\u5219&#xff1a;\u80fd\u7528\u539f\u751fSDK\u89e3\u51b3\u7684\u4e0d\u4e0a\u6846\u67b6\u3002\u6846\u67b6\u5f15\u5165\u7684\u62bd\u8c61\u6210\u672c\u9700\u8981\u6709\u8db3\u591f\u7684\u590d\u6742\u5ea6\u6765\u652f\u4ed8\u3002<\/p>\n<h3>\u4e09\u3001\u5b58\u50a8\u5c42&#xff1a;\u5411\u91cf\u6570\u636e\u5e93\u9009\u578b<\/h3>\n<p>\u5411\u91cf\u6570\u636e\u5e93\u662fRAG\u7cfb\u7edf\u7684\u6838\u5fc3\u57fa\u7840\u8bbe\u65bd\u3002<\/p>\n<p>Milvus&#xff1a;\u6027\u80fd\u738b\u8005&#xff0c;\u4f46\u8fd0\u7ef4\u6210\u672c\u9ad8\u3002\u9700\u8981\u72ec\u7acb\u90e8\u7f72K8s\u96c6\u7fa4&#xff0c;\u5185\u5b58\u5360\u7528\u57fa\u7840\u5c31\u89818GB&#043;\u3002<\/p>\n<p>Chroma&#xff1a;\u8f7b\u91cf\u7ea7\u5d4c\u5165\u5f0f\u65b9\u6848&#xff0c;\u9002\u5408\u539f\u578b\u548c\u4f4e\u8d1f\u8f7d\u3002<\/p>\n<p>pgvector&#xff1a;PostgreSQL\u6269\u5c55&#xff0c;\u96f6\u8fd0\u7ef4\u589e\u91cf\u3002<\/p>\n<p>&#8212; pgvector\u7684\u4f7f\u7528&#xff08;\u751f\u4ea7\u7ea7\u793a\u4f8b&#xff09;<br \/>\nCREATE EXTENSION vector;<\/p>\n<p>&#8212; \u521b\u5efa\u5e26\u5411\u91cf\u5217\u7684\u8868<br \/>\nCREATE TABLE documents (<br \/>\n    id SERIAL PRIMARY KEY,<br \/>\n    content TEXT,<br \/>\n    embedding vector(1536),  &#8212; OpenAI text-embedding-3-small\u7ef4\u5ea6<br \/>\n    metadata JSONB,<br \/>\n    created_at TIMESTAMPTZ DEFAULT NOW()<br \/>\n);<\/p>\n<p>&#8212; HNSW\u7d22\u5f15&#xff08;\u751f\u4ea7\u63a8\u8350&#xff09;<br \/>\nCREATE INDEX ON documents<br \/>\nUSING hnsw (embedding vector_cosine_ops)<br \/>\nWITH (m &#061; 16, ef_construction &#061; 200);<\/p>\n<p>&#8212; \u8bed\u4e49\u641c\u7d22<br \/>\nSELECT id, content,<br \/>\n       1 &#8211; (embedding &lt;&#061;&gt; query_embedding) AS similarity<br \/>\nFROM documents<br \/>\nWHERE 1 &#8211; (embedding &lt;&#061;&gt; query_embedding) &gt; 0.7<br \/>\nORDER BY embedding &lt;&#061;&gt; query_embedding<br \/>\nLIMIT 10;<\/p>\n<p>\u9009\u578b\u5efa\u8bae&#xff08;\u6309\u6570\u636e\u89c4\u6a21&#xff09;&#xff1a;<\/p>\n<table>\n<tr>\u6570\u636e\u89c4\u6a21\u5411\u91cf\u6570\u63a8\u8350\u65b9\u6848\u6708\u6210\u672c<\/tr>\n<tbody>\n<tr>\n<td>\u539f\u578b\/\u5c0f\u89c4\u6a21<\/td>\n<td>&lt;10\u4e07<\/td>\n<td>Chroma\/SQLite-vec<\/td>\n<td>$0<\/td>\n<\/tr>\n<tr>\n<td>\u4e2d\u5c0f\u89c4\u6a21<\/td>\n<td>10\u4e07-100\u4e07<\/td>\n<td>pgvector<\/td>\n<td>PostgreSQL\u589e\u91cf<\/td>\n<\/tr>\n<tr>\n<td>\u4e2d\u5927\u89c4\u6a21<\/td>\n<td>100\u4e07-1000\u4e07<\/td>\n<td>Qdrant\/Milvus Lite<\/td>\n<td>$50-200<\/td>\n<\/tr>\n<tr>\n<td>\u5927\u89c4\u6a21<\/td>\n<td>&gt;1000\u4e07<\/td>\n<td>Milvus\u96c6\u7fa4<\/td>\n<td>$500&#043;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e2a\u4eba\u9009\u62e9&#xff1a;\u56e2\u961f\u9009\u62e9\u4e86pgvector &#043; PostgreSQL\u3002\u7406\u7531&#xff1a;<\/p>\n<ul>\n<li>\u5df2\u6709PostgreSQL&#xff0c;\u96f6\u8fd0\u7ef4\u589e\u91cf\u3002<\/li>\n<li>\u6570\u636e\u91cf\u5728100\u4e07\u4ee5\u4e0b&#xff0c;pgvector\u5b8c\u5168\u6ee1\u8db3\u3002<\/li>\n<li>\u5411\u91cf\u6570\u636e\u548c\u975e\u5411\u91cf\u6570\u636e\u5728\u540c\u4e00\u4e8b\u52a1\u5185\u67e5\u8be2&#xff0c;\u6570\u636e\u4e00\u81f4\u6027\u6709\u4fdd\u8bc1\u3002<\/li>\n<\/ul>\n<h3>\u56db\u3001\u8fd0\u7ef4\u5c42&#xff1a;LLMOps\u5de5\u5177\u8bc4\u4f30<\/h3>\n<p>\u751f\u4ea7\u73af\u5883\u9700\u8981\u7684\u4e09\u4e2a\u6838\u5fc3\u8fd0\u7ef4\u80fd\u529b&#xff1a;LLM\u8c03\u7528\u76d1\u63a7\u3001\u6210\u672c\u8ffd\u8e2a\u3001\u8d28\u91cf\u8bc4\u4f30\u3002<\/p>\n<p>LangSmith&#xff08;\u53ef\u89c2\u6d4b\u6027&#xff09;&#xff1a;<\/p>\n<p># LangSmith\u8ffd\u8e2a\u96c6\u6210<br \/>\nimport os<br \/>\nos.environ[&#034;LANGCHAIN_TRACING_V2&#034;] &#061; &#034;true&#034;<br \/>\nos.environ[&#034;LANGCHAIN_PROJECT&#034;] &#061; &#034;production-qa-bot&#034;<\/p>\n<p>from langsmith import Client<\/p>\n<p>client &#061; Client()<\/p>\n<p># \u67e5\u8be2\u4e0a\u5468\u7684\u6027\u80fd\u6570\u636e<br \/>\nruns &#061; client.list_runs(<br \/>\n    project_name&#061;&#034;production-qa-bot&#034;,<br \/>\n    start_time&#061;datetime.now() &#8211; timedelta(days&#061;7),<br \/>\n    error&#061;True  # \u53ea\u770b\u5931\u8d25\u7684<br \/>\n)<\/p>\n<p># \u6309\u5ef6\u8fdf\u5206\u5e03\u5206\u6790<br \/>\nstats &#061; client.read_project_stats(<br \/>\n    project_ids&#061;[&#034;production-qa-bot&#034;]<br \/>\n)<\/p>\n<p>LangSmith\u7684\u4f18\u52bf&#xff1a;\u4e0eLangChain\u6df1\u5ea6\u96c6\u6210&#xff0c;\u96f6\u4fb5\u5165\u8ffd\u8e2a\u3002\u95ee\u9898&#xff1a;\u5b9a\u4ef7\u4e0d\u900f\u660e&#xff0c;\u6708\u8d39\u7528\u968f\u8c03\u7528\u91cf\u7ebf\u6027\u589e\u957f\u3002<\/p>\n<p>DeepEval&#xff08;\u8bc4\u4f30\u6846\u67b6&#xff09;&#xff1a;<\/p>\n<p>from deepeval import evaluate<br \/>\nfrom deepeval.metrics import (<br \/>\n    AnswerRelevancyMetric,<br \/>\n    FaithfulnessMetric,<br \/>\n    ContextualRecallMetric<br \/>\n)<br \/>\nfrom deepeval.test_case import LLMTestCase<\/p>\n<p># \u5b9a\u4e49\u8bc4\u4f30\u7528\u4f8b<br \/>\ntest_cases &#061; [<br \/>\n    LLMTestCase(<br \/>\n        input&#061;&#034;\u9000\u6b3e\u653f\u7b56\u662f\u4ec0\u4e48&#xff1f;&#034;,<br \/>\n        actual_output&#061;&#034;\u60a8\u53ef\u4ee5\u5728\u8d2d\u4e70\u540e30\u5929\u5185\u7533\u8bf7\u5168\u989d\u9000\u6b3e\u3002&#034;,<br \/>\n        expected_output&#061;&#034;30\u5929\u5185\u53ef\u7533\u8bf7\u5168\u989d\u9000\u6b3e&#034;,<br \/>\n        retrieval_context&#061;[&#034;\u9000\u6b3e\u653f\u7b56:30\u5929\u5168\u989d\u9000\u6b3e&#034;,&#034;\u9700\u4fdd\u7559\u539f\u5305\u88c5&#034;]<br \/>\n    ),<br \/>\n    # &#8230; \u66f4\u591a\u7528\u4f8b<br \/>\n]<\/p>\n<p># \u591a\u7ef4\u5ea6\u8bc4\u4f30<br \/>\nmetrics &#061; [<br \/>\n    AnswerRelevancyMetric(threshold&#061;0.7),<br \/>\n    FaithfulnessMetric(threshold&#061;0.8),<br \/>\n    ContextualRecallMetric(threshold&#061;0.7),<br \/>\n]<\/p>\n<p>results &#061; evaluate(test_cases, metrics)<br \/>\nprint(f&#034;\u6574\u4f53\u901a\u8fc7\u7387: {results.score}&#034;)<\/p>\n<p>\u6210\u672c\u76d1\u63a7\u4f53\u7cfb&#xff1a;<\/p>\n<p>class LLMCostTracker:<br \/>\n    &#034;&#034;&#034;LLM\u8c03\u7528\u6210\u672c\u8ffd\u8e2a\u5668&#034;&#034;&#034;<\/p>\n<p>    # \u5404\u6a21\u578b\u5b9a\u4ef7 (per 1K tokens)<br \/>\n    PRICING &#061; {<br \/>\n        &#039;gpt-4o&#039;: {&#039;input&#039;: 0.0025, &#039;output&#039;: 0.01},<br \/>\n        &#039;gpt-4o-mini&#039;: {&#039;input&#039;: 0.00015, &#039;output&#039;: 0.0006},<br \/>\n        &#039;claude-3.5-sonnet&#039;: {&#039;input&#039;: 0.003, &#039;output&#039;: 0.015},<br \/>\n    }<\/p>\n<p>    def __init__(self):<br \/>\n        self.daily_cost &#061; defaultdict(float)<br \/>\n        self.total_tokens &#061; defaultdict(lambda: {&#039;input&#039;: 0, &#039;output&#039;: 0})<\/p>\n<p>    def track(self, model: str, input_tokens: int, output_tokens: int):<br \/>\n        &#034;&#034;&#034;\u8bb0\u5f55\u4e00\u6b21\u8c03\u7528\u7684\u6210\u672c&#034;&#034;&#034;<br \/>\n        price &#061; self.PRICING.get(model, {})<br \/>\n        cost &#061; (<br \/>\n            input_tokens \/ 1000 * price.get(&#039;input&#039;, 0) &#043;<br \/>\n            output_tokens \/ 1000 * price.get(&#039;output&#039;, 0)<br \/>\n        )<\/p>\n<p>        today &#061; datetime.now().strftime(&#039;%Y-%m-%d&#039;)<br \/>\n        self.daily_cost[today] &#043;&#061; cost<br \/>\n        self.total_tokens[model][&#039;input&#039;] &#043;&#061; input_tokens<br \/>\n        self.total_tokens[model][&#039;output&#039;] &#043;&#061; output_tokens<\/p>\n<p>        if self.daily_cost[today] &gt; 50:  # \u65e5\u6210\u672c\u8d85\u8fc7$50\u544a\u8b66<br \/>\n            self._alert(f&#034;Daily LLM cost exceeded: ${self.daily_cost[today]:.2f}&#034;)<\/p>\n<h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<p>\u6838\u5fc3\u6280\u672f\u63d0\u70bc&#xff1a;<\/p>\n<li>\u6846\u67b6\u9009\u578b\u539f\u5219&#xff1a;\u7b80\u5355LLM\u8c03\u7528\u2192\u539f\u751fSDK&#xff0c;\u590d\u6742Agent\u2192LangChain&#043;LangGraph&#xff0c;\u6587\u6863\u5bc6\u96c6\u578b\u2192LlamaIndex\u3002  \u6982\u62ec&#xff1a;\u590d\u6742\u5ea6\u51b3\u5b9a\u6846\u67b6\u5c42\u6b21&#xff0c;\u80fd\u7528\u539f\u751f\u7edd\u4e0d\u7528\u6846\u67b6\u3002<\/li>\n<li>\u5411\u91cf\u6570\u636e\u5e93\u56db\u9636\u68af&#xff1a;&lt;10\u4e07\u2192Chroma\/SQLite-vec\u3001&lt;100\u4e07\u2192pgvector\u3001&lt;1000\u4e07\u2192Milvus Lite\u3001&gt;1000\u4e07\u2192Milvus\u96c6\u7fa4\u3002  \u5927\u591a\u6570\u56e2\u961f&lt;100\u4e07\u7ea7\u522b&#xff0c;pgvector\u662f\u6700\u4f4e\u6469\u64e6\u65b9\u6848\u3002<\/li>\n<li>LLMOps\u4e09\u4ef6\u5957&#xff1a;LangSmith(\u8ffd\u8e2a&#043;\u8c03\u8bd5) &#043; DeepEval(\u8bc4\u4f30&#043;\u56de\u5f52) &#043; \u81ea\u5efa\u6210\u672c\u8ffd\u8e2a\u3002  \u4e09\u8005\u7684\u7ec4\u5408\u8986\u76d6\u4e8690%\u7684\u751f\u4ea7\u8fd0\u7ef4\u9700\u6c42\u3002<\/li>\n<li>\u6210\u672c\u662fLLMOps\u7684\u7b2c\u4e00\u6307\u6807&#xff1a;\u65e5\u6210\u672c\u8ffd\u8e2a&#043;\u544a\u8b66\u4f53\u7cfb\u5fc5\u987b\u7b2c\u4e00\u5929\u5c31\u5efa\u7acb\u3002  API\u8c03\u7528\u7684\u6210\u672c\u5931\u63a7\u901f\u5ea6\u8fdc\u8d85\u4f20\u7edf\u57fa\u7840\u8bbe\u65bd\u3002<\/li>\n<li>\u5de5\u5177\u94fe\u7684&#034;\u591f\u7528&#034;\u539f\u5219&#xff1a;\u4e0d\u8981\u5728\u4e00\u4e2a\u6708\u5185\u5f15\u5165\u8d85\u8fc73\u4e2a\u65b0\u5de5\u5177\u3002  \u6bcf\u4e2a\u65b0\u5de5\u5177\u7684\u8fd0\u7ef4\u6210\u672c\u548c\u8ba4\u77e5\u6210\u672c\u90fd\u4f1a\u53e0\u52a0\u3002<\/li>\n","protected":false},"excerpt":{"rendered":"<p>AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3&#xff1a;LangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001<br \/>\n\u4e00\u3001\u9009\u578b\u573a\u666f&#xff1a;\u4ece\u5b9e\u9a8c\u5230\u751f\u4ea7<br \/>\n7\u6708\u56e2\u961f\u9762\u4e34\u4e00\u4e2a\u5173\u952e\u8282\u70b9&#xff1a;AI\u529f\u80fd\u4ece\\&#8221;\u5185\u90e8\u5b9e\u9a8c\\&#8221;\u8d70\u5411\\&#8221;\u751f\u4ea7\u4ea4\u4ed8\\&#8221;\u3002\u4e4b\u524d\u7684\u539f\u578b\u9636\u6bb5\u53ef\u4ee5\u7528Jupyter Notebook\u624b\u52a8\u811a\u672c\u5b8c\u6210\u3002\u4f46\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u9700\u8981\u4e00\u5957\u5b8c\u6574\u7684\u5de5\u5177\u94fe&#xff1a;\u4ece\u6a21\u578b\u8c03\u7528\u5230\u6570\u636e\u7ba1\u7406\u3001\u4ece\u8bc4\u4f30\u5230\u76d1\u63a7\u3002<br \/>\n\u6211\u57287\u6708\u7cfb\u7edf\u5730\u8bc4\u4f30\u4e86AI\u5de5\u5177\u94fe\u7684\u4e09\u4e2a\u6838\u5fc3\u73af\u8282&#xff1a;\u6846\u67b6\u5c42&#xff08;LangChain\/Llama<\/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":[9152,58,219],"topic":[],"class_list":["post-86122","post","type-post","status-publish","format-standard","hentry","category-server","tag-9152","tag-linux","tag-219"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3\uff1aLangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001 - \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\/86122.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3\uff1aLangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3&#xff1a;LangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001 \u4e00\u3001\u9009\u578b\u573a\u666f&#xff1a;\u4ece\u5b9e\u9a8c\u5230\u751f\u4ea7 7\u6708\u56e2\u961f\u9762\u4e34\u4e00\u4e2a\u5173\u952e\u8282\u70b9&#xff1a;AI\u529f\u80fd\u4ece&quot;\u5185\u90e8\u5b9e\u9a8c&quot;\u8d70\u5411&quot;\u751f\u4ea7\u4ea4\u4ed8&quot;\u3002\u4e4b\u524d\u7684\u539f\u578b\u9636\u6bb5\u53ef\u4ee5\u7528Jupyter Notebook\u624b\u52a8\u811a\u672c\u5b8c\u6210\u3002\u4f46\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u9700\u8981\u4e00\u5957\u5b8c\u6574\u7684\u5de5\u5177\u94fe&#xff1a;\u4ece\u6a21\u578b\u8c03\u7528\u5230\u6570\u636e\u7ba1\u7406\u3001\u4ece\u8bc4\u4f30\u5230\u76d1\u63a7\u3002 \u6211\u57287\u6708\u7cfb\u7edf\u5730\u8bc4\u4f30\u4e86AI\u5de5\u5177\u94fe\u7684\u4e09\u4e2a\u6838\u5fc3\u73af\u8282&#xff1a;\u6846\u67b6\u5c42&#xff08;LangChain\/Llama\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/86122.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-27T22:16:49+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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86122.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/86122.html\",\"name\":\"AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3\uff1aLangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-27T22:16:49+00:00\",\"dateModified\":\"2026-07-27T22:16:49+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/86122.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/86122.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86122.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3\uff1aLangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001\"}]},{\"@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":"AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3\uff1aLangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001 - \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\/86122.html","og_locale":"zh_CN","og_type":"article","og_title":"AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3\uff1aLangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3&#xff1a;LangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001 \u4e00\u3001\u9009\u578b\u573a\u666f&#xff1a;\u4ece\u5b9e\u9a8c\u5230\u751f\u4ea7 7\u6708\u56e2\u961f\u9762\u4e34\u4e00\u4e2a\u5173\u952e\u8282\u70b9&#xff1a;AI\u529f\u80fd\u4ece\"\u5185\u90e8\u5b9e\u9a8c\"\u8d70\u5411\"\u751f\u4ea7\u4ea4\u4ed8\"\u3002\u4e4b\u524d\u7684\u539f\u578b\u9636\u6bb5\u53ef\u4ee5\u7528Jupyter Notebook\u624b\u52a8\u811a\u672c\u5b8c\u6210\u3002\u4f46\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u9700\u8981\u4e00\u5957\u5b8c\u6574\u7684\u5de5\u5177\u94fe&#xff1a;\u4ece\u6a21\u578b\u8c03\u7528\u5230\u6570\u636e\u7ba1\u7406\u3001\u4ece\u8bc4\u4f30\u5230\u76d1\u63a7\u3002 \u6211\u57287\u6708\u7cfb\u7edf\u5730\u8bc4\u4f30\u4e86AI\u5de5\u5177\u94fe\u7684\u4e09\u4e2a\u6838\u5fc3\u73af\u8282&#xff1a;\u6846\u67b6\u5c42&#xff08;LangChain\/Llama","og_url":"https:\/\/www.wsisp.com\/helps\/86122.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-27T22:16:49+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/86122.html","url":"https:\/\/www.wsisp.com\/helps\/86122.html","name":"AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3\uff1aLangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-27T22:16:49+00:00","dateModified":"2026-07-27T22:16:49+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/86122.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/86122.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/86122.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"AI\u5de5\u5177\u94fe7\u6708\u9009\u578b\u603b\u7ed3\uff1aLangChain\u3001\u5411\u91cf\u6570\u636e\u5e93\u4e0eLLMOps\u5de5\u5177\u751f\u6001"}]},{"@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\/86122","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=86122"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/86122\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=86122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=86122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=86122"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=86122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}