{"id":73729,"date":"2026-02-08T10:09:29","date_gmt":"2026-02-08T02:09:29","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/73729.html"},"modified":"2026-02-08T10:09:29","modified_gmt":"2026-02-08T02:09:29","slug":"%e5%a4%a7%e6%a8%a1%e5%9e%8b%e5%ae%9e%e6%88%98%ef%bc%9a%e8%ae%a9-agent-%e5%ad%a6%e4%bc%9a%e5%8f%8d%e6%80%9d","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/73729.html","title":{"rendered":"\u5927\u6a21\u578b\u5b9e\u6218\uff1a\u8ba9 Agent \u5b66\u4f1a\u53cd\u601d"},"content":{"rendered":"<\/p>\n<p>\u524d\u9762\u5df2\u7ecf\u642d\u597d\u4e86&#xff1a;<\/p>\n<ul>\n<li>\u80fd\u7528 RAG \u68c0\u7d22\u6587\u6863\u7684\u95ee\u7b54\u94fe\u8def&#xff1b;<\/li>\n<li>\u591a Agent \u7684\u201c\u5bb6\u65cf\u5206\u5de5\u201d\u548c\u8c03\u5ea6\u5668&#xff1b;<\/li>\n<li>\u8c03\u7528\u76d1\u63a7\u3001Trace\u3001A\/B \u5b9e\u9a8c\u7b49\u5de5\u7a0b\u80fd\u529b\u3002<\/li>\n<\/ul>\n<p>\u4f46\u5728\u771f\u5b9e\u4f7f\u7528\u4e2d&#xff0c;\u4f60\u4e00\u5b9a\u5df2\u7ecf\u9047\u5230\u8fc7\u8fd9\u79cd\u60c5\u51b5&#xff1a;<\/p>\n<ul>\n<li>\u660e\u660e\u6587\u6863\u91cc\u6ca1\u6709\u5199&#xff0c;Agent \u5374\u4e00\u672c\u6b63\u7ecf\u5730\u201c\u7f16\u201d\u51fa\u4e00\u6bb5\u5185\u5bb9&#xff1b;<\/li>\n<li>\u6570\u5b66\u9898\u3001\u903b\u8f91\u9898\u5076\u5c14\u7ed9\u9519&#xff0c;\u8fd8\u5199\u5f97\u975e\u5e38\u81ea\u4fe1&#xff1b;<\/li>\n<li>\u95ee\u201c\u4e3a\u4ec0\u4e48\u201d\u65f6&#xff0c;\u5b83\u4f1a\u51ed\u611f\u89c9\u80e1\u4e71\u63a8\u65ad\u4e00\u4e2a\u7406\u7531\u3002<\/li>\n<\/ul>\n<p>\u6839\u672c\u539f\u56e0\u662f&#xff1a;<\/p>\n<p>\u6211\u4eec\u73b0\u5728\u7684\u5927\u90e8\u5206 Agent&#xff0c;\u53ea\u6709\u201c\u6b63\u5411\u751f\u6210\u201d\u7684\u672c\u4e8b&#xff0c;<br \/>\n\u6ca1\u6709\u201c\u53cd\u5411\u68c0\u67e5\u201d\u548c\u201c\u81ea\u6211\u6000\u7591\u201d\u7684\u673a\u5236\u3002<\/p>\n<p>\u4e13\u95e8\u505a\u4e00\u4ef6\u4e8b&#xff1a;<\/p>\n<p>\u5728\u73b0\u6709\u7684 Agent \u4f53\u7cfb\u4e4b\u4e0a&#xff0c;\u52a0\u4e00\u5c42\u81ea\u6211\u53cd\u601d&#xff08;Self-Reflection&#xff09;\u80fd\u529b&#xff0c;<br \/>\n\u8ba9 Agent \u5728\u7ed9\u7528\u6237\u7b54\u6848\u4e4b\u524d&#xff0c;\u5148\u5ba1\u67e5\u4e00\u4e0b\u81ea\u5df1\u6709\u6ca1\u6709\u80e1\u8bf4\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u5148\u6f84\u6e05&#xff1a;\u6211\u4eec\u8981\u7684\u201c\u81ea\u6211\u53cd\u601d\u201d\u5230\u5e95\u662f\u4ec0\u4e48&#xff1f;<\/h3>\n<p>\u8fd9\u91cc\u7684\u201c\u81ea\u6211\u53cd\u601d\u201d&#xff0c;\u4e0d\u662f\u54f2\u5b66\u4e0a\u7684\u90a3\u4e00\u5957&#xff0c;\u800c\u662f\u5f88\u5de5\u7a0b\u5316\u7684\u4e1c\u897f&#xff0c;\u53ef\u4ee5\u7406\u89e3\u4e3a&#xff1a;<\/p>\n<p>\u5728\u8f93\u51fa\u4e4b\u524d&#xff0c;\u5f3a\u5236\u518d\u8dd1\u4e00\u904d**\u201c\u6162\u601d\u8003&#xff08;\u5ba1\u7a3f\u4eba\u6a21\u5f0f&#xff09;\u201d**&#xff0c;<br \/>\n\u5bf9\u521a\u624d\u7684\u7b54\u6848\u505a\u4e00\u6b21\u7ed3\u6784\u5316\u7684\u68c0\u67e5\u548c\u4fee\u8ba2\u3002<\/p>\n<p>\u5b83\u81f3\u5c11\u5305\u62ec\u4e09\u7c7b\u68c0\u67e5&#xff1a;<\/p>\n<li>\n<p>\u4e8b\u5b9e\u68c0\u67e5<\/p>\n<ul>\n<li>\u8fd9\u53e5\u8bdd\u5728\u6587\u6863\u91cc\u6709\u6ca1\u6709\u4f9d\u636e&#xff1f;<\/li>\n<li>\u6570\u5b57\/\u65e5\u671f\/\u540d\u79f0\u662f\u5426\u548c\u4e0a\u4e0b\u6587\u4e00\u81f4&#xff1f;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u903b\u8f91\u68c0\u67e5<\/p>\n<ul>\n<li>\u524d\u540e\u6709\u6ca1\u6709\u81ea\u76f8\u77db\u76fe&#xff1f;<\/li>\n<li>\u63a8\u7406\u94fe\u6761\u6709\u6ca1\u6709\u65ad\u6863&#xff1f;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8bed\u6c14\u4e0e\u7f6e\u4fe1\u5ea6\u68c0\u67e5<\/p>\n<ul>\n<li>\u662f\u4e0d\u662f\u7528\u4e86\u201c\u80af\u5b9a\u201d\u201c\u5fc5\u987b\u201d\u201c\u4e00\u5b9a\u201d\u7b49\u7edd\u5bf9\u5316\u8868\u8ff0&#xff1f;<\/li>\n<li>\u660e\u660e\u6ca1\u8bc1\u636e&#xff0c;\u5374\u8868\u73b0\u5f97\u5f88\u81ea\u4fe1&#xff1f;<\/li>\n<\/ul>\n<\/li>\n<p>\u5927\u81f4\u6d41\u7a0b\u53ef\u4ee5\u60f3\u8c61\u6210&#xff1a;<\/p>\n<p>\u7528\u6237\u95ee\u9898 \u2192&#xff08;\u5feb\u601d\u8003&#xff09;\u751f\u6210\u521d\u7a3f \u2192&#xff08;\u6162\u601d\u8003&#xff09;\u81ea\u6211\u5ba1\u67e5 \u2192 \u4fee\u8ba2\u7248 \u2192 \u8fd4\u56de\u7528\u6237<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u4e24\u79cd\u5b9e\u7528\u67b6\u6784&#xff1a;\u9009\u4e00\u4e2a\u5c31\u80fd\u843d\u5730<\/h3>\n<p>\u6839\u636e\u4f60\u73b0\u5728\u7684\u7cfb\u7edf\u5f62\u6001\u548c\u9884\u7b97&#xff0c;\u53ef\u4ee5\u8003\u8651\u4e24\u79cd\u4e3b\u8981\u6a21\u5f0f&#xff1a;<\/p>\n<h4>2.1 \u5355 Agent \u53cc\u9636\u6bb5\u6a21\u5f0f&#xff08;\u8f7b\u91cf\u7248&#xff09;<\/h4>\n<p>\u4e00\u4e2a Agent \u5185\u90e8\u5305\u542b\u4e24\u4e2a\u9636\u6bb5&#xff1a;<\/p>\n<li>\u9636\u6bb51&#xff1a;\u50cf\u73b0\u5728\u4e00\u6837&#xff0c;\u76f4\u63a5\u751f\u6210\u7b54\u6848&#xff1b;<\/li>\n<li>\u9636\u6bb52&#xff1a;\u7528\u53e6\u4e00\u4e2a Prompt&#xff0c;\u8ba9\u5b83\u201c\u5207\u6362\u4eba\u683c\u201d&#xff0c;\u5f53\u6210\u5ba1\u7a3f\u4eba\u6765\u6311\u81ea\u5df1\u6bdb\u75c5&#xff1b;<\/li>\n<li>\u5982\u679c\u53d1\u73b0\u95ee\u9898&#xff0c;\u518d\u8ba9\u5b83\u81ea\u5df1\u6309\u53cd\u9988\u6539\u4e00\u7248\u7b54\u6848\u3002<\/li>\n<p>\u7279\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u6539\u9020\u91cf\u5c0f&#xff0c;\u4e0d\u9700\u8981\u65b0\u5efa Agent \u7c7b&#xff1b;<\/li>\n<li>\u6210\u672c\u589e\u52a0\u6709\u9650&#xff08;Prompt \u957f\u4e00\u70b9&#xff0c;\u591a\u4e00\u8f6e\u751f\u6210&#xff09;\u3002<\/li>\n<\/ul>\n<h4>2.2 \u53cc Agent \u6a21\u5f0f&#xff08;\u63a8\u8350&#xff09;<\/h4>\n<p>\u628a\u89d2\u8272\u62c6\u5f00&#xff1a;<\/p>\n<ul>\n<li>\u751f\u6210 Agent&#xff1a;\u53ea\u7ba1\u201c\u600e\u4e48\u7b54\u201d&#xff0c;\u4e0d\u8d1f\u8d23\u4e25\u683c\u5ba1\u67e5&#xff0c;\u4fdd\u6301\u81ea\u7136\u6d41\u7545&#xff1b;<\/li>\n<li>\u5ba1\u6838 Agent&#xff1a;\u53ea\u7ba1\u201c\u7b54\u5f97\u5bf9\u4e0d\u5bf9\u201d&#xff0c;\u5b8c\u5168\u4ee5\u5ba1\u7a3f\u4eba\u5fc3\u6001\u5de5\u4f5c\u3002<\/li>\n<\/ul>\n<p>\u7279\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u804c\u8d23\u6e05\u6670&#xff0c;\u4ee3\u7801\u7ed3\u6784\u66f4\u5e72\u51c0&#xff1b;<\/li>\n<li>\u5ba1\u6838 Agent \u53ef\u4ee5\u7528\u4e0d\u540c\u6a21\u578b\/\u4e0d\u540c Prompt&#xff0c;\u505a\u66f4\u4e25\u82db\u7684\u68c0\u67e5\u3002<\/li>\n<\/ul>\n<p>\u4e0b\u9762\u6211\u7528\u53cc Agent \u6a21\u5f0f\u4f5c\u4e3a\u4e3b\u7ebf\u6765\u8bb2\u89e3&#xff0c;\u6700\u540e\u518d\u7ed9\u4e00\u4e2a\u5355 Agent \u7248\u672c\u7684\u8f7b\u91cf\u5b9e\u73b0\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u6838\u5fc3\u63a5\u53e3\u8bbe\u8ba1&#xff1a;\u4e00\u4e2a\u201c\u81ea\u6211\u53cd\u601d Agent\u201d<\/h3>\n<p>\u6211\u4eec\u5148\u62bd\u8c61\u4e00\u4e2a\u201c\u5e26\u81ea\u6211\u53cd\u601d\u80fd\u529b\u7684 Agent\u201d&#xff1a;<\/p>\n<p>from typing import Dict, Any, List<br \/>\nimport json<\/p>\n<p>class SelfReflectingAgent:<br \/>\n    &#034;&#034;&#034;<br \/>\n    \u53ccAgent\u67b6\u6784&#xff1a;<br \/>\n    &#8211; generator_llm: \u8d1f\u8d23\u751f\u6210\u7b54\u6848<br \/>\n    &#8211; reviewer_llm: \u8d1f\u8d23\u5ba1\u67e5\u7b54\u6848<br \/>\n    &#034;&#034;&#034;<br \/>\n    def __init__(self, generator_llm, reviewer_llm, max_reflection: int &#061; 2):<br \/>\n        self.generator &#061; generator_llm<br \/>\n        self.reviewer &#061; reviewer_llm<br \/>\n        self.max_reflection &#061; max_reflection<\/p>\n<p>    # &#8212; \u5feb\u601d\u8003&#xff1a;\u751f\u6210\u521d\u7a3f &#8212;<br \/>\n    def generate_answer(self, question: str) -&gt; str:<br \/>\n        prompt &#061; f&#034;\u8bf7\u76f4\u63a5\u3001\u7b80\u660e\u5730\u56de\u7b54\u8fd9\u4e2a\u95ee\u9898&#xff1a;\\\\n{question}&#034;<br \/>\n        return self.generator(prompt)<\/p>\n<p>    # &#8212; \u6162\u601d\u8003&#xff1a;\u7ed3\u6784\u5316\u5ba1\u67e5 &#8212;<br \/>\n    def review_answer(self, question: str, answer: str, docs: List[str]) -&gt; Dict[str, Any]:<br \/>\n        review_prompt &#061; self._build_review_prompt(question, answer, docs)<br \/>\n        resp &#061; self.reviewer(review_prompt)<br \/>\n        try:<br \/>\n            data &#061; json.loads(resp)<br \/>\n        except json.JSONDecodeError:<br \/>\n            data &#061; {<br \/>\n                &#034;valid&#034;: False,<br \/>\n                &#034;issues&#034;: [{&#034;type&#034;: &#034;\u683c\u5f0f\u9519\u8bef&#034;, &#034;description&#034;: &#034;\u5ba1\u6838\u8f93\u51fa\u975eJSON&#034;, &#034;location&#034;: &#034;&#034;}],<br \/>\n                &#034;corrections&#034;: [],<br \/>\n                &#034;confidence&#034;: 0.0<br \/>\n            }<br \/>\n        return data<\/p>\n<p>    # &#8212; \u5e94\u7528\u5ba1\u7a3f\u5efa\u8bae&#xff1a;\u7b80\u5355\u7248\u672c\u7528\u66ff\u6362 &#8212;<br \/>\n    def apply_corrections(self, answer: str, corrections: List[Dict[str, str]]) -&gt; str:<br \/>\n        for c in corrections:<br \/>\n            answer &#061; answer.replace(c.get(&#034;original&#034;, &#034;&#034;), c.get(&#034;corrected&#034;, &#034;&#034;))<br \/>\n        return answer<\/p>\n<p>    # &#8212; \u6574\u4f53\u5165\u53e3 &#8212;<br \/>\n    def run(self, question: str, docs: List[str]) -&gt; Dict[str, Any]:<br \/>\n        &#034;&#034;&#034;<br \/>\n        \u8fd4\u56de\u7ed3\u6784&#xff1a;<br \/>\n        {<br \/>\n          &#034;final_answer&#034;: str,<br \/>\n          &#034;review&#034;: {&#8230;},<br \/>\n          &#034;iterations&#034;: int,<br \/>\n          &#034;status&#034;: &#034;success|failure&#034;<br \/>\n        }<br \/>\n        &#034;&#034;&#034;<br \/>\n        answer &#061; self.generate_answer(question)<\/p>\n<p>        review &#061; {}<br \/>\n        for i in range(self.max_reflection):<br \/>\n            review &#061; self.review_answer(question, answer, docs)<\/p>\n<p>            # \u6ee1\u8db3\u201c\u5ba1\u6838\u901a\u8fc7\u201d\u7684\u6761\u4ef6\u76f4\u63a5\u8fd4\u56de<br \/>\n            if review.get(&#034;valid&#034;) and review.get(&#034;confidence&#034;, 0.0) &gt;&#061; 0.9:<br \/>\n                return {<br \/>\n                    &#034;final_answer&#034;: answer,<br \/>\n                    &#034;review&#034;: review,<br \/>\n                    &#034;iterations&#034;: i &#043; 1,<br \/>\n                    &#034;status&#034;: &#034;success&#034;<br \/>\n                }<\/p>\n<p>            # \u6709\u660e\u786e\u7684 corrections&#xff0c;\u5c1d\u8bd5\u81ea\u52a8\u4fee\u6b63<br \/>\n            if review.get(&#034;corrections&#034;):<br \/>\n                answer &#061; self.apply_corrections(answer, review[&#034;corrections&#034;])<br \/>\n            else:<br \/>\n                # \u6ca1\u6cd5\u4fee&#xff0c;\u8bf4\u660e\u95ee\u9898\u6bd4\u8f83\u5927<br \/>\n                return {<br \/>\n                    &#034;final_answer&#034;: &#034;\u5f53\u524d\u65e0\u6cd5\u751f\u6210\u53ef\u9760\u7b54\u6848&#xff0c;\u8bf7\u7a0d\u540e\u518d\u8bd5&#xff0c;\u6216\u4ea4\u7531\u4eba\u5de5\u5904\u7406\u3002&#034;,<br \/>\n                    &#034;review&#034;: review,<br \/>\n                    &#034;iterations&#034;: i &#043; 1,<br \/>\n                    &#034;status&#034;: &#034;failure&#034;<br \/>\n                }<\/p>\n<p>        # \u8fbe\u5230\u6700\u5927\u53cd\u601d\u8f6e\u6570\u4ecd\u7136\u4e0d\u8fc7\u5ba1<br \/>\n        return {<br \/>\n            &#034;final_answer&#034;: &#034;\u7ecf\u8fc7\u591a\u8f6e\u68c0\u67e5\u4ecd\u65e0\u6cd5\u786e\u8ba4\u7b54\u6848\u53ef\u9760&#xff0c;\u5efa\u8bae\u4eba\u5de5\u590d\u6838\u3002&#034;,<br \/>\n            &#034;review&#034;: review,<br \/>\n            &#034;iterations&#034;: self.max_reflection,<br \/>\n            &#034;status&#034;: &#034;failure&#034;<br \/>\n        }<\/p>\n<hr \/>\n<h3>\u56db\u3001\u5173\u952e\u70b9&#xff1a;\u5ba1\u6838 Prompt \u4e00\u5b9a\u8981\u201c\u7ed3\u6784\u5316\u201d<\/h3>\n<p>\u81ea\u6211\u53cd\u601d\u80fd\u4e0d\u80fd\u843d\u5730&#xff0c;\u5f88\u5927\u7a0b\u5ea6\u4e0a\u53d6\u51b3\u4e8e\u5ba1\u6838 Prompt \u5199\u5f97\u597d\u4e0d\u597d\u3002<\/p>\n<h4>4.1 \u5ba1\u6838 Prompt \u7684\u601d\u8def<\/h4>\n<p>\u5bf9\u5ba1\u6838 Agent \u6765\u8bf4&#xff0c;\u4f60\u8981\u544a\u8bc9\u5b83&#xff1a;<\/p>\n<li>\u4e0a\u4e0b\u6587\u6709\u54ea\u4e9b&#xff08;\u6587\u6863\/\u68c0\u7d22\u7ed3\u679c&#xff09;&#xff1b;<\/li>\n<li>\u95ee\u9898\u662f\u4ec0\u4e48&#xff1b;<\/li>\n<li>\u5f85\u5ba1\u6838\u7b54\u6848\u662f\u4ec0\u4e48&#xff1b;<\/li>\n<li>\u4f60\u8981\u5b83\u68c0\u67e5\u4ec0\u4e48&#xff1b;<\/li>\n<li>\u7528\u4ec0\u4e48\u683c\u5f0f\u8f93\u51fa\u3002<\/li>\n<p>\u4e00\u4e2a\u5b9e\u7528\u7684\u5b9e\u73b0&#xff1a;<\/p>\n<p>class ReviewPromptBuilder:<br \/>\n    def __init__(self, max_docs: int &#061; 5):<br \/>\n        self.max_docs &#061; max_docs<\/p>\n<p>    def build(self, question: str, answer: str, docs: List[str]) -&gt; str:<br \/>\n        doc_block &#061; &#034;\\\\n&#034;.join(<br \/>\n            [f&#034;[\u6587\u6863{i&#043;1}]\\\\n{d[:300]}&#8230;&#034; for i, d in enumerate(docs[:self.max_docs])]<br \/>\n        )<\/p>\n<p>        return f&#034;&#034;&#034;<br \/>\n\u4f60\u662f\u4e00\u4e2a\u4e25\u683c\u7684\u5ba1\u7a3f\u4eba&#xff0c;\u9700\u8981\u6839\u636e\u7ed9\u5b9a\u7684\u6587\u6863\u5ba1\u67e5\u4e00\u4e2a\u7b54\u6848\u662f\u5426\u53ef\u9760\u3002<\/p>\n<p># \u95ee\u9898<br \/>\n{question}<\/p>\n<p># \u53c2\u8003\u6587\u6863&#xff08;\u622a\u65ad\u663e\u793a&#xff09;<br \/>\n{doc_block}<\/p>\n<p># \u5f85\u5ba1\u6838\u7b54\u6848<br \/>\n{answer}<\/p>\n<p># \u5ba1\u67e5\u4efb\u52a1&#xff08;\u8bf7\u9010\u6761\u68c0\u67e5&#xff09;<br \/>\n1. \u6587\u6863\u5f15\u7528\u662f\u5426\u51c6\u786e&#xff1f;<br \/>\n   &#8211; \u6bcf\u6761\u4e8b\u5b9e\u6027\u9648\u8ff0\u662f\u5426\u80fd\u5728\u4e0a\u8ff0\u6587\u6863\u4e2d\u627e\u5230\u652f\u6301&#xff1f;<br \/>\n   &#8211; \u662f\u5426\u5f15\u7528\u4e86\u6587\u6863\u4e2d\u4e0d\u5b58\u5728\u7684\u5185\u5bb9&#xff1f;<\/p>\n<p>2. \u662f\u5426\u5b58\u5728\u4e8b\u5b9e\u6027\u9519\u8bef&#xff1f;<br \/>\n   &#8211; \u6570\u5b57\u3001\u65e5\u671f\u3001\u540d\u79f0\u662f\u5426\u4e0e\u6587\u6863\u4e00\u81f4&#xff1f;<br \/>\n   &#8211; \u63a8\u8bba\u662f\u5426\u4e0e\u6587\u6863\u63cf\u8ff0\u77db\u76fe&#xff1f;<\/p>\n<p>3. \u903b\u8f91\u662f\u5426\u81ea\u6d3d&#xff1f;<br \/>\n   &#8211; \u540c\u4e00\u7b54\u6848\u5185\u90e8\u6709\u65e0\u77db\u76fe&#xff1f;<br \/>\n   &#8211; \u662f\u5426\u6709\u660e\u663e\u7684\u903b\u8f91\u6f0f\u6d1e&#xff1f;<\/p>\n<p>4. \u8bed\u6c14\u662f\u5426\u5408\u7406&#xff1f;<br \/>\n   &#8211; \u662f\u5426\u6709\u201c\u80af\u5b9a\/\u5fc5\u987b\/\u7edd\u5bf9\u201d\u7b49\u8fc7\u5ea6\u81ea\u4fe1\u7684\u8868\u8fbe&#xff0c;\u5728\u6ca1\u6709\u6587\u6863\u652f\u6301\u7684\u60c5\u51b5\u4e0b\u4f7f\u7528&#xff1f;<\/p>\n<p># \u8f93\u51fa\u8981\u6c42<br \/>\n\u4ec5\u8f93\u51fa\u4e00\u6bb5 JSON \u6587\u672c&#xff0c;\u683c\u5f0f\u5982\u4e0b&#xff1a;<br \/>\n{{<br \/>\n  &#034;valid&#034;: true\/false,<br \/>\n  &#034;issues&#034;: [<br \/>\n    {{<br \/>\n      &#034;type&#034;: &#034;\u5f15\u7528\u9519\u8bef|\u4e8b\u5b9e\u9519\u8bef|\u903b\u8f91\u9519\u8bef|\u8fc7\u5ea6\u81ea\u4fe1&#034;,<br \/>\n      &#034;description&#034;: &#034;\u95ee\u9898\u63cf\u8ff0&#034;,<br \/>\n      &#034;location&#034;: &#034;\u76f8\u5173\u53e5\u5b50\u6216\u7247\u6bb5&#034;<br \/>\n    }}<br \/>\n  ],<br \/>\n  &#034;corrections&#034;: [<br \/>\n    {{<br \/>\n      &#034;type&#034;: &#034;\u5f15\u7528\u4fee\u6b63|\u4e8b\u5b9e\u4fee\u6b63|\u903b\u8f91\u4fee\u6b63|\u8bed\u6c14\u4fee\u6b63&#034;,<br \/>\n      &#034;original&#034;: &#034;\u539f\u53e5\u5b50&#034;,<br \/>\n      &#034;corrected&#034;: &#034;\u4fee\u6b63\u540e\u7684\u53e5\u5b50&#034;<br \/>\n    }}<br \/>\n  ],<br \/>\n  &#034;confidence&#034;: 0.0-1.0,<br \/>\n  &#034;reasoning&#034;: &#034;\u7b80\u8981\u8bf4\u660e\u4f60\u505a\u51fa\u4e0a\u8ff0\u5224\u65ad\u7684\u539f\u56e0&#034;<br \/>\n}}<\/p>\n<p>\u4e0d\u8981\u8f93\u51fa\u4efb\u4f55\u591a\u4f59\u89e3\u91ca\u3002<br \/>\n&#034;&#034;&#034;<\/p>\n<p>\u7136\u540e\u5728 SelfReflectingAgent \u4e2d\u7528\u5b83&#xff1a;<\/p>\n<p>class SelfReflectingAgent:<br \/>\n    def __init__(&#8230;, &#8230;):<br \/>\n        &#8230;<br \/>\n        self.prompt_builder &#061; ReviewPromptBuilder()<\/p>\n<p>    def _build_review_prompt(self, question, answer, docs):<br \/>\n        return self.prompt_builder.build(question, answer, docs)<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u8f7b\u91cf\u7248&#xff1a;\u5728\u4e00\u4e2a Agent \u91cc\u52a0\u201c\u81ea\u95ee\u81ea\u7b54\u201d\u53cd\u601d<\/h3>\n<p>\u5982\u679c\u4f60\u6682\u65f6\u4e0d\u60f3\u4e0a\u201c\u53cc Agent \u6a21\u5f0f\u201d&#xff0c;\u6216\u8005\u53ea\u60f3\u5728\u90e8\u5206\u573a\u666f\u91cc\u505a\u4e2a\u8bd5\u70b9&#xff0c;\u53ef\u4ee5\u7528\u5355 Agent &#043; \u53cc\u9636\u6bb5 Prompt\u7684\u505a\u6cd5\u3002<\/p>\n<h4>5.1 \u903b\u8f91\u6d41\u7a0b<\/h4>\n<li>Prompt1&#xff1a;\u6b63\u5e38\u56de\u7b54\u95ee\u9898&#xff1b;<\/li>\n<li>Prompt2&#xff1a;\u4ee5\u201c\u5ba1\u7a3f\u4eba\u89d2\u8272\u201d\u68c0\u67e5 Prompt1 \u7684\u56de\u7b54&#xff1b;<\/li>\n<li>\u5982\u679c\u53d1\u73b0\u95ee\u9898&#xff0c;Prompt3&#xff1a;\u6839\u636e\u5ba1\u7a3f\u7ed3\u679c\u4fee\u6b63\u81ea\u5df1\u7684\u56de\u7b54\u3002<\/li>\n<h4>5.2 \u6781\u7b80\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p>def self_reflecting_answer(llm, question: str, docs: List[str]) -&gt; str:<br \/>\n    # \u7b2c\u4e00\u8f6e&#xff1a;\u6b63\u5e38\u56de\u7b54<br \/>\n    context &#061; &#034;\\\\n\\\\n&#034;.join(docs[:3])<br \/>\n    answer_prompt &#061; f&#034;&#034;&#034;<br \/>\n\u4f60\u662f\u4e00\u4e2a\u95ee\u7b54\u52a9\u624b&#xff0c;\u8bf7\u57fa\u4e8e\u4ee5\u4e0b\u4e0a\u4e0b\u6587\u56de\u7b54\u95ee\u9898&#xff1a;<\/p>\n<p>\u4e0a\u4e0b\u6587&#xff1a;<br \/>\n{context}<\/p>\n<p>\u95ee\u9898&#xff1a;<br \/>\n{question}<\/p>\n<p>\u8bf7\u76f4\u63a5\u7ed9\u51fa\u7b54\u6848&#xff0c;\u4e0d\u8981\u89e3\u91ca\u63a8\u7406\u8fc7\u7a0b\u3002<br \/>\n&#034;&#034;&#034;<br \/>\n    answer &#061; llm(answer_prompt)<\/p>\n<p>    # \u7b2c\u4e8c\u8f6e&#xff1a;\u81ea\u6211\u68c0\u67e5<br \/>\n    review_prompt &#061; f&#034;&#034;&#034;<br \/>\n\u4f60\u73b0\u5728\u5207\u6362\u6210\u4e00\u4e2a\u4e25\u683c\u7684\u5ba1\u7a3f\u4eba\u3002<\/p>\n<p>\u95ee\u9898&#xff1a;{question}<br \/>\n\u4f60\u7684\u56de\u7b54&#xff1a;{answer}<br \/>\n\u53c2\u8003\u4e0a\u4e0b\u6587&#xff1a;{context}<\/p>\n<p>\u8bf7\u68c0\u67e5\u4f60\u7684\u56de\u7b54\u662f\u5426\u5b58\u5728\u4ee5\u4e0b\u95ee\u9898&#xff1a;<br \/>\n1. \u5f15\u7528\u4e86\u4e0a\u4e0b\u6587\u4e2d\u4e0d\u5b58\u5728\u7684\u5185\u5bb9&#xff1f;<br \/>\n2. \u6570\u5b57\/\u540d\u79f0\/\u65e5\u671f\u7b49\u4e8b\u5b9e\u6027\u5185\u5bb9\u662f\u5426\u6709\u9519\u8bef&#xff1f;<br \/>\n3. \u662f\u5426\u5b58\u5728\u660e\u663e\u7684\u903b\u8f91\u77db\u76fe&#xff1f;<br \/>\n4. \u662f\u5426\u6709\u65e0\u4f9d\u636e\u7684\u7edd\u5bf9\u5316\u8868\u8ff0&#xff1f;<\/p>\n<p>\u5982\u679c\u6709\u95ee\u9898&#xff0c;\u8bf7\u7528\u81ea\u7136\u8bed\u8a00\u8bf4\u660e\u95ee\u9898&#xff0c;\u5e76\u7ed9\u51fa\u4e00\u4e2a\u201c\u4fee\u6b63\u5efa\u8bae\u201d&#xff1b;\u5982\u679c\u6ca1\u6709\u95ee\u9898&#xff0c;\u8bf7\u53ea\u56de\u7b54\u201c\u6ca1\u6709\u95ee\u9898\u201d\u3002<br \/>\n&#034;&#034;&#034;<br \/>\n    review &#061; llm(review_prompt)<\/p>\n<p>    # \u7b2c\u4e09\u8f6e&#xff1a;\u5982\u679c\u6709\u95ee\u9898&#xff0c;\u6839\u636e\u53cd\u9988\u4fee\u6b63<br \/>\n    if &#034;\u6ca1\u6709\u95ee\u9898&#034; in review:<br \/>\n        return answer<br \/>\n    else:<br \/>\n        revise_prompt &#061; f&#034;&#034;&#034;<br \/>\n\u4f60\u521a\u624d\u7684\u56de\u7b54\u5b58\u5728\u95ee\u9898&#xff0c;\u5177\u4f53\u53cd\u9988\u5982\u4e0b&#xff1a;<br \/>\n{review}<\/p>\n<p>\u8bf7\u6839\u636e\u8fd9\u4e9b\u53cd\u9988&#xff0c;\u91cd\u65b0\u7ed9\u51fa\u4e00\u4e2a\u66f4\u51c6\u786e\u3001\u66f4\u8c28\u614e\u7684\u7b54\u6848\u3002<br \/>\n\u95ee\u9898&#xff1a;{question}<br \/>\n\u4e0a\u4e0b\u6587&#xff1a;{context}<br \/>\n&#034;&#034;&#034;<br \/>\n        final_answer &#061; llm(revise_prompt)<br \/>\n        return final_answer<\/p>\n<p>\u8fd9\u4e2a\u7248\u672c\u5b9e\u73b0\u6210\u672c\u5f88\u4f4e&#xff0c;\u800c\u4e14\u5bf9\u4f60\u73b0\u6709\u4ee3\u7801\u6539\u52a8\u6700\u5c0f&#xff0c;\u5b8c\u5168\u53ef\u4ee5\u5148\u5728\u4e00\u4e2a\u5173\u952e\u573a\u666f\u8bd5\u70b9&#xff1a;<br \/>\n\u6bd4\u5982\u300c\u91cd\u8981\u7684\u5236\u5ea6\u95ee\u7b54\u3001\u5408\u540c\u6761\u6b3e\u89e3\u91ca\u300d\u7b49&#xff0c;\u518d\u6839\u636e\u6548\u679c\u51b3\u5b9a\u662f\u5426\u5347\u7ea7\u5230\u201c\u53cc Agent \u6a21\u5f0f\u300d\u3002<\/p>\n<hr \/>\n<h3>\u516d\u3001\u600e\u4e48\u9a8c\u8bc1\u201c\u81ea\u6211\u53cd\u601d\u201d\u6709\u6ca1\u6709\u7528&#xff1f;<\/h3>\n<p>\u65e2\u7136\u4f60\u524d\u9762\u5df2\u7ecf\u6709&#xff1a;<\/p>\n<ul>\n<li>\u8c03\u7528\u7ea7\u65e5\u5fd7&#xff08;LLMCallLog&#xff09;&#xff1b;<\/li>\n<li>\u5de5\u4f5c\u6d41 Trace&#xff1b;<\/li>\n<li>\u7b80\u5355 A\/B \u6846\u67b6\u3002<\/li>\n<\/ul>\n<p>\u90a3\u9a8c\u8bc1\u8fd9\u5957\u201c\u81ea\u6211\u53cd\u601d\u201d\u80fd\u529b\u662f\u4e0d\u662f\u503c\u5f97\u4fdd\u7559&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u505a\u4e00\u4e2a\u5c0f\u5b9e\u9a8c&#xff1a;<\/p>\n<li>\u9009\u4e00\u6279\u6709\u6807\u51c6\u7b54\u6848\u7684\u95ee\u7b54\u6837\u672c&#xff08;\u6bd4\u5982 50&#xff5e;200 \u6761&#xff09;&#xff1b;<\/li>\n<li>\u5bf9\u6bd4\u4e24\u79cd\u6a21\u5f0f&#xff1a;\n<ul>\n<li>\u6a21\u5f0f A&#xff1a;\u666e\u901a Agent&#xff1b;<\/li>\n<li>\u6a21\u5f0f B&#xff1a;\u542f\u7528\u81ea\u6211\u53cd\u601d\u7684 Agent&#xff1b;<\/li>\n<\/ul>\n<\/li>\n<li>\u5bf9\u6bcf\u6761\u6837\u672c\u6253\u6807\u7b7e&#xff1a;\n<ul>\n<li>\u662f\u5426\u56de\u7b54\u6b63\u786e&#xff1b;<\/li>\n<li>\u662f\u5426\u5f15\u7528\u4e86\u4e0d\u5b58\u5728\u7684\u5185\u5bb9&#xff1b;<\/li>\n<li>\u662f\u5426\u8fc7\u5ea6\u81ea\u4fe1\u3002<\/li>\n<\/ul>\n<\/li>\n<p>\u4f60\u8981\u91cd\u70b9\u5173\u6ce8\u7684\u662f&#xff1a;<\/p>\n<ul>\n<li>\u4e8b\u5b9e\u6027\u9519\u8bef\u51cf\u5c11\u4e86\u591a\u5c11&#xff1b;<\/li>\n<li>\u201c\u7f16\u9020\u5185\u5bb9\u201d\u7684\u9891\u7387\u4e0b\u964d\u4e86\u591a\u5c11&#xff1b;<\/li>\n<li>\u589e\u52a0\u7684\u5ef6\u8fdf\u548c\u6210\u672c&#xff08;\u591a\u8c03\u7528\u4e00\u6b21\u6a21\u578b&#xff09;\u4f60\u662f\u5426\u53ef\u4ee5\u63a5\u53d7\u3002<\/li>\n<\/ul>\n<p>\u5728\u76d1\u63a7\u7cfb\u7edf\u91cc\u53ef\u4ee5\u52a0\u4e24\u7c7b\u6307\u6807&#xff1a;<\/p>\n<ul>\n<li>self_reflection_trigger_rate&#xff1a;\u6bcf 100 \u6b21\u8c03\u7528\u91cc\u6709\u591a\u5c11\u6b21\u89e6\u53d1\u4e86\u53cd\u601d&#xff1b;<\/li>\n<li>self_reflection_fix_rate&#xff1a;\u5728\u89e6\u53d1\u53cd\u601d\u7684\u8c03\u7528\u4e2d&#xff0c;\u6709\u591a\u5c11\u6b21\u6700\u7ec8\u7b54\u6848\u53d1\u751f\u4e86\u5b9e\u8d28\u6027\u53d8\u5316\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u4f60\u5728\u5b9e\u9a8c\u91cc\u770b\u5230&#xff1a;<\/p>\n<ul>\n<li>\u9519\u8bef\u7387\u660e\u663e\u4e0b\u964d&#xff08;\u4f8b\u5982\u4ece 10% \u964d\u5230 3\u20135%&#xff09;&#xff1b;<\/li>\n<li>\u5ef6\u8fdf\u4ece 1s \u589e\u52a0\u5230 1.3\u20131.5s&#xff0c;\u8fd8\u5728\u53ef\u63a5\u53d7\u8303\u56f4\u5185&#xff1b;<\/li>\n<\/ul>\n<p>\u90a3\u8fd9\u5957\u201c\u81ea\u6211\u53cd\u601d\u80fd\u529b\u201d\u5c31\u975e\u5e38\u503c\u5f97\u5728\u5173\u952e\u4e1a\u52a1\u573a\u666f\u91cc\u63a8\u5e7f\u3002<\/p>\n<hr \/>\n<h3>\u4e03\u3001\u5982\u4f55\u63a5\u5230\u4f60\u73b0\u6709\u7684\u591a Agent \/ \u5de5\u4f5c\u6d41\u4f53\u7cfb\u91cc&#xff1f;<\/h3>\n<p>\u63a8\u8350\u4e00\u4e2a\u5c3d\u91cf\u201c\u65e0\u75db\u201d\u7684\u63a5\u6cd5&#xff1a;<\/p>\n<li>\n<p>\u53ea\u66ff\u6362\u5173\u952e\u8282\u70b9<\/p>\n<ul>\n<li>\u4e0d\u8981\u6539\u6574\u4e2a\u7cfb\u7edf&#xff1b;<\/li>\n<li>\u53ea\u628a\u539f\u6765\u7684 RAG_QA_Agent \u66ff\u6362\u6210 SelfReflectingAgent \u5c01\u88c5\u7684\u8282\u70b9\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u4fdd\u6301\u5916\u90e8\u63a5\u53e3\u4e0d\u53d8<\/p>\n<ul>\n<li>\u5bf9\u4e0a\u5c42 Coordinator \u6765\u8bf4&#xff0c;handle(question, state) -&gt; answer \u7b7e\u540d\u4e0d\u53d8&#xff1b;<\/li>\n<li>\u53ea\u662f\u5728\u8282\u70b9\u5185\u90e8\u591a\u8dd1\u4e86\u4e00\u8f6e\u201c\u5feb\u601d\u8003 &#043; \u6162\u601d\u8003\u201d\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5148\u7070\u5ea6\u90e8\u5206\u6d41\u91cf<\/p>\n<ul>\n<li>\u6bd4\u5982\u4ec5\u5bf9 10% \u7528\u6237\u8bf7\u6c42\u542f\u7528\u81ea\u6211\u53cd\u601d&#xff1b;<\/li>\n<li>\u6216\u8005\u4ec5\u5bf9\u201c\u547d\u4e2d\u7279\u5b9a\u610f\u56fe\/\u9886\u57df\u201d\u7684\u8bf7\u6c42\u542f\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u628a\u53cd\u601d\u8fc7\u7a0b\u7684\u5173\u952e\u4fe1\u606f\u5199\u8fdb Trace<\/p>\n<ul>\n<li>\u5ba1\u6838\u662f\u5426\u901a\u8fc7&#xff1b;<\/li>\n<li>\u53cd\u601d\u8f6e\u6570&#xff1b;<\/li>\n<li>\u662f\u5426\u53d1\u751f\u4e86\u4fee\u6b63&#xff1b;<\/li>\n<li>\u5ba1\u7a3f Agent \u7684\u7f6e\u4fe1\u5ea6\u3002<\/li>\n<\/ul>\n<\/li>\n<p>\u8fd9\u56db\u70b9\u5b8c\u6210\u540e&#xff0c;\u4f60\u7684 Agent \u7cfb\u7edf\u5c31\u4ece&#xff1a;<\/p>\n<p>\u201c\u4f1a\u56de\u7b54\u95ee\u9898&#xff0c;\u4f46\u81ea\u5df1\u4e0d\u68c0\u67e5\u201d<\/p>\n<p>\u5347\u7ea7\u6210&#xff1a;<\/p>\n<p>\u201c\u65e2\u4f1a\u56de\u7b54\u95ee\u9898&#xff0c;\u53c8\u4f1a\u5148\u68c0\u67e5\u81ea\u5df1\u8bf4\u7684\u9760\u4e0d\u9760\u8c31\u201d\u3002<\/p>\n<hr \/>\n<h3>\u516b\u3001\u5c0f\u7ed3<\/h3>\n<p>\u8fd9\u4e00\u7bc7\u505a\u7684\u4e8b\u60c5\u662f&#xff1a;\u5728\u4f60\u5df2\u7ecf\u6709\u7684 Agent \u5bb6\u65cf &#043; \u5de5\u4f5c\u6d41 &#043; \u76d1\u63a7 \u57fa\u7840\u4e4b\u4e0a&#xff0c;\u518d\u5f80\u524d\u8fc8\u4e00\u6b65\u2014\u2014\u8ba9 Agent \u62e5\u6709\u4e00\u4e2a\u7b80\u5355\u4f46\u975e\u5e38\u5b9e\u7528\u7684\u80fd\u529b&#xff1a;<\/p>\n<p>\u5728\u5f20\u53e3\u4e4b\u524d&#xff0c;\u5148\u95ee\u95ee\u81ea\u5df1&#xff1a;<br \/>\n\u201c\u6211\u8bf4\u7684\u6709\u4f9d\u636e\u5417&#xff1f;\u6709\u6ca1\u6709\u53ef\u80fd\u5728\u778e\u7f16&#xff1f;\u201d<\/p>\n<p>\u843d\u5730\u4e0a&#xff0c;\u4f60\u53ef\u4ee5&#xff1a;<\/p>\n<ul>\n<li>\u5148\u7528\u5355 Agent \u53cc\u9636\u6bb5\u7684\u8f7b\u91cf\u65b9\u6848&#xff0c;\u5728\u4e00\u4e2a\u573a\u666f\u8bd5\u6c34&#xff1b;<\/li>\n<li>\u518d\u5347\u7ea7\u5230\u53cc Agent \u6a21\u5f0f&#xff0c;\u4e13\u95e8\u7528\u4e00\u4e2a\u201c\u5ba1\u7a3f Agent\u201d\u76ef\u4e8b\u5b9e\u3001\u903b\u8f91\u548c\u8bed\u6c14&#xff1b;<\/li>\n<li>\u7528\u4f60\u73b0\u6709\u7684\u8bc4\u4f30\u4e0e\u76d1\u63a7\u4f53\u7cfb&#xff0c;\u91cf\u5316\u201c\u9519\u8bef\u7387\u4e0b\u964d\u201d\u548c\u201c\u5ef6\u8fdf\u589e\u52a0\u201d\u7684 tradeoff\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u9762\u5df2\u7ecf\u642d\u597d\u4e86&#xff1a;\u80fd\u7528 RAG \u68c0\u7d22\u6587\u6863\u7684\u95ee\u7b54\u94fe\u8def&#xff1b;\u591a Agent \u7684\u201c\u5bb6\u65cf\u5206\u5de5\u201d\u548c\u8c03\u5ea6\u5668&#xff1b;\u8c03\u7528\u76d1\u63a7\u3001Trace\u3001A\/B \u5b9e\u9a8c\u7b49\u5de5\u7a0b\u80fd\u529b\u3002\u4f46\u5728\u771f\u5b9e\u4f7f\u7528\u4e2d&#xff0c;\u4f60\u4e00\u5b9a\u5df2\u7ecf\u9047\u5230\u8fc7\u8fd9\u79cd\u60c5\u51b5&#xff1a;\u660e\u660e\u6587\u6863\u91cc\u6ca1\u6709\u5199&#xff0c;Agent \u5374\u4e00\u672c\u6b63\u7ecf\u5730\u201c\u7f16\u201d\u51fa\u4e00\u6bb5\u5185\u5bb9&#xff1b;\u6570\u5b66\u9898\u3001\u903b\u8f91\u9898\u5076\u5c14\u7ed9\u9519&#xff0c;\u8fd8\u5199\u5f97\u975e\u5e38\u81ea\u4fe1&#xff1b;\u95ee\u201c\u4e3a\u4ec0\u4e48\u201d\u65f6&#xff0c;\u5b83\u4f1a\u51ed\u611f\u89c9\u80e1\u4e71\u63a8\u65ad\u4e00\u4e2a\u7406\u7531\u3002\u6839\u672c\u539f\u56e0\u662f&amp;#xf<\/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":[74,4119,50],"topic":[],"class_list":["post-73729","post","type-post","status-publish","format-standard","hentry","category-server","tag-agent","tag-rag","tag-50"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5927\u6a21\u578b\u5b9e\u6218\uff1a\u8ba9 Agent \u5b66\u4f1a\u53cd\u601d - \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\/73729.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5927\u6a21\u578b\u5b9e\u6218\uff1a\u8ba9 Agent \u5b66\u4f1a\u53cd\u601d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u524d\u9762\u5df2\u7ecf\u642d\u597d\u4e86&#xff1a;\u80fd\u7528 RAG \u68c0\u7d22\u6587\u6863\u7684\u95ee\u7b54\u94fe\u8def&#xff1b;\u591a Agent \u7684\u201c\u5bb6\u65cf\u5206\u5de5\u201d\u548c\u8c03\u5ea6\u5668&#xff1b;\u8c03\u7528\u76d1\u63a7\u3001Trace\u3001A\/B \u5b9e\u9a8c\u7b49\u5de5\u7a0b\u80fd\u529b\u3002\u4f46\u5728\u771f\u5b9e\u4f7f\u7528\u4e2d&#xff0c;\u4f60\u4e00\u5b9a\u5df2\u7ecf\u9047\u5230\u8fc7\u8fd9\u79cd\u60c5\u51b5&#xff1a;\u660e\u660e\u6587\u6863\u91cc\u6ca1\u6709\u5199&#xff0c;Agent \u5374\u4e00\u672c\u6b63\u7ecf\u5730\u201c\u7f16\u201d\u51fa\u4e00\u6bb5\u5185\u5bb9&#xff1b;\u6570\u5b66\u9898\u3001\u903b\u8f91\u9898\u5076\u5c14\u7ed9\u9519&#xff0c;\u8fd8\u5199\u5f97\u975e\u5e38\u81ea\u4fe1&#xff1b;\u95ee\u201c\u4e3a\u4ec0\u4e48\u201d\u65f6&#xff0c;\u5b83\u4f1a\u51ed\u611f\u89c9\u80e1\u4e71\u63a8\u65ad\u4e00\u4e2a\u7406\u7531\u3002\u6839\u672c\u539f\u56e0\u662f&amp;#xf\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/73729.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-08T02:09:29+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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/73729.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/73729.html\",\"name\":\"\u5927\u6a21\u578b\u5b9e\u6218\uff1a\u8ba9 Agent \u5b66\u4f1a\u53cd\u601d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-08T02:09:29+00:00\",\"dateModified\":\"2026-02-08T02:09:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/73729.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/73729.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/73729.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5927\u6a21\u578b\u5b9e\u6218\uff1a\u8ba9 Agent \u5b66\u4f1a\u53cd\u601d\"}]},{\"@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":"\u5927\u6a21\u578b\u5b9e\u6218\uff1a\u8ba9 Agent \u5b66\u4f1a\u53cd\u601d - \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\/73729.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5927\u6a21\u578b\u5b9e\u6218\uff1a\u8ba9 Agent \u5b66\u4f1a\u53cd\u601d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u524d\u9762\u5df2\u7ecf\u642d\u597d\u4e86&#xff1a;\u80fd\u7528 RAG \u68c0\u7d22\u6587\u6863\u7684\u95ee\u7b54\u94fe\u8def&#xff1b;\u591a Agent \u7684\u201c\u5bb6\u65cf\u5206\u5de5\u201d\u548c\u8c03\u5ea6\u5668&#xff1b;\u8c03\u7528\u76d1\u63a7\u3001Trace\u3001A\/B \u5b9e\u9a8c\u7b49\u5de5\u7a0b\u80fd\u529b\u3002\u4f46\u5728\u771f\u5b9e\u4f7f\u7528\u4e2d&#xff0c;\u4f60\u4e00\u5b9a\u5df2\u7ecf\u9047\u5230\u8fc7\u8fd9\u79cd\u60c5\u51b5&#xff1a;\u660e\u660e\u6587\u6863\u91cc\u6ca1\u6709\u5199&#xff0c;Agent \u5374\u4e00\u672c\u6b63\u7ecf\u5730\u201c\u7f16\u201d\u51fa\u4e00\u6bb5\u5185\u5bb9&#xff1b;\u6570\u5b66\u9898\u3001\u903b\u8f91\u9898\u5076\u5c14\u7ed9\u9519&#xff0c;\u8fd8\u5199\u5f97\u975e\u5e38\u81ea\u4fe1&#xff1b;\u95ee\u201c\u4e3a\u4ec0\u4e48\u201d\u65f6&#xff0c;\u5b83\u4f1a\u51ed\u611f\u89c9\u80e1\u4e71\u63a8\u65ad\u4e00\u4e2a\u7406\u7531\u3002\u6839\u672c\u539f\u56e0\u662f&amp;#xf","og_url":"https:\/\/www.wsisp.com\/helps\/73729.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-08T02:09:29+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/73729.html","url":"https:\/\/www.wsisp.com\/helps\/73729.html","name":"\u5927\u6a21\u578b\u5b9e\u6218\uff1a\u8ba9 Agent \u5b66\u4f1a\u53cd\u601d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-08T02:09:29+00:00","dateModified":"2026-02-08T02:09:29+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/73729.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/73729.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/73729.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5927\u6a21\u578b\u5b9e\u6218\uff1a\u8ba9 Agent \u5b66\u4f1a\u53cd\u601d"}]},{"@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\/73729","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=73729"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/73729\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=73729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=73729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=73729"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=73729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}