{"id":58,"date":"2026-06-29T10:20:03","date_gmt":"2026-06-29T02:20:03","guid":{"rendered":"https:\/\/genetop.top\/index.php\/2026\/06\/29\/agent-design-tradeoffs-no-framework\/"},"modified":"2026-06-29T10:20:03","modified_gmt":"2026-06-29T02:20:03","slug":"agent-design-tradeoffs-no-framework","status":"publish","type":"post","link":"https:\/\/genetop.top\/index.php\/2026\/06\/29\/agent-design-tradeoffs-no-framework\/","title":{"rendered":"\u8bbe\u8ba1\u53d6\u820d\uff1a\u4e3a\u4ec0\u4e48 Hermes\uff08\u4ee5\u53ca\u5f88\u591a\u6d41\u884c agent\uff09\u4e0d\u7528 LangChain \/ LangGraph"},"content":{"rendered":"<blockquote>\n<p>\u8bf4\u660e\uff1aHermes \u4ed3\u5e93\u91cc<strong>\u6ca1\u6709<\/strong>\u4e00\u53e5\u660e\u786e\u5199\u4e0b\u300c\u6211\u4eec\u4e0d\u7528 LangChain \u56e0\u4e3a\u2026\u2026\u300d\u7684\u58f0\u660e\u3002<br \/>\n\u672c\u6587\u5206\u4e24\u5c42\uff1a<strong>\u884c\u4e1a\u5c42\u9762\u7684\u666e\u904d\u539f\u56e0<\/strong>\uff08\u901a\u7528\u5206\u6790\uff09\u4e0e <strong>Hermes \u4ee3\u7801\u4e2d\u53ef\u5b9e\u8bc1\u770b\u5230\u7684\u53d6\u5411<\/strong>\uff08\u6709\u6e90\u7801\u4f9d\u636e\uff0c\u6807\u6ce8\u51fa\u5904\uff09\u3002<\/p>\n<\/blockquote>\n<h2 id=\"1-agent\">1. \u524d\u63d0\uff1aagent \u5faa\u73af\u7684\u5185\u6838\u5176\u5b9e\u5f88\u7b80\u5355<\/h2>\n<p>\u5f88\u591a\u4eba\u4ee5\u4e3a\u7f16\u6392 agent \u5fc5\u987b\u4f9d\u8d56\u4e00\u4e2a\u300c\u6846\u67b6\u300d\uff0c\u4f46\u6838\u5fc3\u5faa\u73af\u672c\u8d28\u4e0a\u53ea\u662f\u4e00\u4e2a while\uff1a<\/p>\n<pre><code class=\"language-text\">while \u672a\u8fbe\u7ec8\u6b62\u6761\u4ef6:\n    resp = llm(messages, tools)\n    if resp.tool_calls:\n        \u6267\u884c\u5de5\u5177\uff0c\u628a\u7ed3\u679c append \u56de messages\n    else:\n        return resp.content\n<\/code><\/pre>\n<p>Hermes \u7684 <code>run_conversation<\/code>\uff08<code>agent\/conversation_loop.py<\/code>\uff09\u672c\u8d28\u5c31\u662f\u8fd9\u4e2a\u3002<\/p>\n<p><strong>\u771f\u6b63\u96be\u7684\u4e0d\u662f\u8fd9\u4e2a\u5faa\u73af\u672c\u8eab\uff0c\u800c\u662f\u5b83\u5468\u8fb9\u7684\u5de5\u7a0b\u7ec6\u8282<\/strong>\uff1a\u6d41\u5f0f\u8f93\u51fa\u3001\u4e2d\u65ad\u3001\u9884\u7b97\u63a7\u5236\u3001\u4e0a\u4e0b\u6587\u538b\u7f29\u3001prompt \u7f13\u5b58\u3001provider \u6545\u969c\u5207\u6362\u3001\u5e76\u53d1\u5de5\u5177\u6267\u884c\u3001\u9519\u8bef\u5206\u7c7b\u4e0e\u91cd\u8bd5\u2026\u2026\u800c\u8fd9\u4e9b\u6070\u6070\u662f\u901a\u7528\u6846\u67b6\u62bd\u8c61\u5f97\u6700\u6d45\u3001\u6700\u5bb9\u6613\u300c\u6321\u8def\u300d\u7684\u5730\u65b9\u3002\u8fd9\u662f\u7406\u89e3\u300c\u4e3a\u4ec0\u4e48\u5f88\u591a\u9879\u76ee\u4e0d\u7528\u6846\u67b6\u300d\u7684\u5173\u952e\u3002<\/p>\n<h2 id=\"2-agent\">2. \u884c\u4e1a\u5c42\u9762\uff1a\u6d41\u884c agent \u9879\u76ee\u5e38\u7ed5\u5f00\u6846\u67b6\u7684\u666e\u904d\u539f\u56e0<\/h2>\n<p>\u9002\u7528\u4e8e\u591a\u6570\u81ea\u7814\u5faa\u73af\u7684\u9879\u76ee\uff08Hermes\u3001OpenHands\u3001Aider\u3001Codex CLI\u3001Claude Code \u7b49\uff09\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u62bd\u8c61\u4e0e\u63a7\u5236\u6743\u9519\u914d<\/strong>\u3002\u6846\u67b6\u628a LLM \u8c03\u7528 \/ \u6d88\u606f \/ \u8bb0\u5fc6 \/ \u5de5\u5177\u5c01\u88c5\u6210\u5bf9\u8c61\uff08Chain \/ Runnable \/ Graph \u8282\u70b9\uff09\u3002\u4f46\u751f\u4ea7\u7ea7 agent \u9700\u8981\u5bf9\u300c\u53d1\u7ed9\u6a21\u578b\u7684\u6bcf\u4e00\u4e2a byte\u300d\u7cbe\u786e\u63a7\u5236\u2014\u2014\u4f8b\u5982 Anthropic \u7684 <code>cache_control<\/code> \u6253\u5728\u54ea\u6761\u6d88\u606f\u3001reasoning content \u5982\u4f55\u5b58\u3001\u62a5\u9519\u65f6\u600e\u6837\u964d\u7ea7\u5230 fallback \u6a21\u578b\u3002\u6846\u67b6\u62bd\u8c61\u8ba9\u8fd9\u300c\u6700\u540e\u4e00\u516c\u91cc\u300d\u66f4\u96be\u505a\uff0c\u5e38\u88ab\u8feb\u7ed5\u8fc7\u6846\u67b6 monkey-patch\u3002\u6253\u4e2a\u6bd4\u65b9\uff1a\u6846\u67b6\u50cf\u4e00\u53f0\u4e07\u80fd\u9065\u63a7\u5668\uff0c\u5e38\u89c1\u7535\u5668\u90fd\u80fd\u63a7\uff0c\u4f46\u4f60\u5bb6\u90a3\u53f0\u5e26\u6700\u65b0\u529f\u80fd\u7684\u673a\u5668\u5b83\u504f\u504f\u5c11\u4e86\u4e00\u4e2a\u952e\uff0c\u4f60\u53ea\u80fd\u62c6\u5f00\u540e\u76d6\u76f4\u63a5\u63a5\u7ebf\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u591a provider \u7684 API \u5f62\u6001\u5dee\u5f02<\/strong>\u3002\u9700\u8981\u540c\u65f6\u652f\u6301 OpenAI chat.completions\u3001Anthropic Messages\u3001Bedrock\u3001Codex Responses \u7b49\u4e0d\u540c API \u5f62\u6001\u65f6\uff0c\u6846\u67b6\u7684\u300c\u7edf\u4e00 LLM \u63a5\u53e3\u300d\u5f80\u5f80\u6ede\u540e\u4e8e\u5404\u5bb6\u6700\u65b0\u7279\u6027\uff08\u65b0\u6a21\u578b\u3001\u65b0\u53c2\u6570\u3001reasoning\u3001prompt caching\uff09\uff0c\u8ffd\u65b0\u88ab\u52a8\u3002\u5c31\u50cf\u7ffb\u8bd1\u8f6f\u4ef6\u603b\u6bd4\u539f\u6587\u665a\u4e00\u6b65\uff1a\u5404\u5bb6\u6a21\u578b\u521a\u53d1\u5e03\u7684\u65b0\u80fd\u529b\uff0c\u6846\u67b6\u8981\u7b49\u4e0b\u4e00\u4e2a\u7248\u672c\u624d\u652f\u6301\uff0c\u800c\u4f60\u60f3\u7b2c\u4e00\u65f6\u95f4\u7528\u4e0a\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u8c03\u8bd5\u4e0e\u53ef\u8bfb\u6027<\/strong>\u3002\u81ea\u7814\u5faa\u73af\u7684 stack trace \u76f4\u8fbe\u81ea\u8eab\u4ee3\u7801\uff1b\u6846\u67b6\u5e38\u662f\u591a\u5c42\u62bd\u8c61 + \u56de\u8c03\uff0c\u62a5\u9519\u6808\u6df1\u3001\u884c\u4e3a\u9690\u5f0f\u3002\u957f\u671f\u7ef4\u62a4\u9879\u76ee\u66f4\u770b\u91cd\u53ef\u8bfb\u6027\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u4f9d\u8d56\u4e0e\u4f9b\u5e94\u94fe\u98ce\u9669<\/strong>\u3002\u6846\u67b6\u672c\u8eab\u662f\u5e9e\u5927\u7684\u4f20\u9012\u4f9d\u8d56\u6811\uff0c\u7248\u672c\u53d8\u52a8\u9891\u7e41\u3001API \u4e0d\u7a33\u5b9a\uff0c\u653e\u5927\u4f9b\u5e94\u94fe\u653b\u51fb\u9762\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u7248\u672c churn<\/strong>\u3002LangChain \u65e9\u671f API \u53d8\u52a8\u5267\u70c8\uff08<code>LLMChain<\/code> \u2192 LCEL \u2192 LangGraph\uff09\uff0c\u628a\u6838\u5fc3\u903b\u8f91\u7ed1\u5728\u5feb\u901f\u53d8\u52a8\u7684\u6846\u67b6\u4e0a\uff0c\u8fc1\u79fb\u6210\u672c\u9ad8\u3002<\/p>\n<\/li>\n<\/ol>\n<h2 id=\"3-hermes\">3. Hermes \u4ee3\u7801\u4e2d\u53ef\u5b9e\u8bc1\u770b\u5230\u7684\u53d6\u5411\uff08\u6709\u636e\u53ef\u67e5\uff09<\/h2>\n<ul>\n<li>\n<p><strong>\u6781\u81f4\u4f9d\u8d56\u6700\u5c0f\u5316 + \u4f9b\u5e94\u94fe\u9632\u5fa1<\/strong>\u3002<code>pyproject.toml<\/code> \u6709\u5927\u6bb5\u6ce8\u91ca\u8bf4\u660e\uff1a\u6838\u5fc3\u4f9d\u8d56<strong>\u5168\u90e8\u7cbe\u786e\u9489\u6b7b\u7248\u672c<\/strong>\uff08<code>==X.Y.Z<\/code>\uff0c\u4e0d\u7528\u8303\u56f4\uff09\uff0c\u8d77\u56e0\u662f 2026-05 \u7684 Mini Shai-Hulud \u8815\u866b\u653b\u51fb\uff1b\u5e76\u660e\u786e\u5199\u9053 <em>&#8220;smaller dependencies = smaller blast radius for the next supply-chain attack&#8221;<\/em>\uff0cprovider \u4e13\u5c5e\u4f9d\u8d56\u4e00\u5f8b\u60f0\u6027\u5b89\u88c5\uff08<code>tools\/lazy_deps.py<\/code>\uff09\u3002\u4e00\u4e2a\u628a\u300c\u4f9d\u8d56\u9762\u79ef\u300d\u5f53\u4e00\u7b49\u516c\u6c11\u7ba1\u7406\u7684\u9879\u76ee\uff0c\u81ea\u7136\u4e0d\u4f1a\u5f15\u5165 LangChain \u8fd9\u79cd\u91cd\u4f9d\u8d56\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u552f\u4e00\u7684 LLM SDK \u662f <code>openai==2.24.0<\/code><\/strong>\uff0c\u5176\u4f59\u591a provider \u5168\u9760\u81ea\u7814 Transport \/ Adapter \u5c42\uff08<code>agent\/transports\/<\/code>\u3001<code>agent\/*_adapter.py<\/code>\uff09\u9002\u914d\uff0c\u7edf\u4e00\u4ee5 OpenAI \u6d88\u606f\u683c\u5f0f\u4e3a\u4e2d\u95f4\u8868\u793a\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5faa\u73af\u5468\u8fb9\u5927\u91cf\u81ea\u7814\u5de5\u7a0b<\/strong>\uff1a\u4e2d\u65ad\u68c0\u67e5\u3001<code>agent\/iteration_budget.py<\/code>\u3001<code>agent\/error_classifier.py<\/code>\uff08\u6545\u969c\u5207\u6362\uff09\u3001<code>agent\/context_compressor.py<\/code>\u3001<code>agent\/prompt_caching.py<\/code>\u3001<code>agent\/tool_executor.py<\/code>\uff08\u5e76\u53d1\u5de5\u5177\u6267\u884c\uff09\u3002\u4ec5 <code>run_agent.py<\/code> \u5355\u6587\u4ef6\u5c31\u6709\u7ea6 5300 \u884c\uff0c\u5faa\u73af\u76f8\u5173\u6a21\u5757\u5408\u8ba1\u4e0a\u4e07\u884c\uff0c\u8bf4\u660e\u4ed6\u4eec<strong>\u523b\u610f\u6295\u5165\u53bb\u62e5\u6709\u8fd9\u4e2a\u5faa\u73af<\/strong>\uff0c\u800c\u975e\u5916\u5305\u7ed9\u6846\u67b6\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5e76\u975e\u300c\u4ec0\u4e48\u90fd\u81ea\u5df1\u9020\u300d<\/strong>\u3002\u5f53\u613f\u610f\u628a\u63a7\u5236\u6743\u4ea4\u51fa\u53bb\u65f6\uff08\u5982\u628a\u5de5\u5177\u5faa\u73af\u4ea4\u7ed9 OpenAI Codex app-server\uff09\uff0cHermes \u4f1a\u663e\u5f0f\u96c6\u6210\uff1b\u5b83\u53cd\u5bf9\u7684\u662f\u300c\u7528\u901a\u7528\u6846\u67b6\u66ff\u4ee3\u81ea\u5df1\u7684\u6838\u5fc3\u5faa\u73af\u300d\uff0c\u800c\u975e\u53cd\u5bf9\u4e00\u5207\u96c6\u6210\u3002<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u6982\u62ec Hermes \u7684\u300c\u7406\u7531\u300d\uff1a<strong>\u628a\u53ef\u63a7\u6027\u4e0e\u4f9b\u5e94\u94fe\u5b89\u5168\u5f53\u7b2c\u4e00\u4f18\u5148\u7ea7\uff0c\u800c agent \u6838\u5fc3\u5faa\u73af\u53c8\u8db3\u591f\u7b80\u5355\uff0c\u81ea\u7814\u7684\u6536\u76ca &gt; \u6846\u67b6\u5e26\u6765\u7684\u4fbf\u5229\u3002<\/strong><\/p>\n<\/blockquote>\n<h2 id=\"4\">4. \u6df1\u5165\uff1a\u6781\u81f4\u4f9d\u8d56\u6700\u5c0f\u5316 + \u4f9b\u5e94\u94fe\u9632\u5fa1<\/h2>\n<p>Hermes \u7684\u4f9b\u5e94\u94fe\u9632\u5fa1\u4e0d\u662f\u53e3\u53f7\uff0c\u800c\u662f\u843d\u5728 <code>pyproject.toml<\/code> + \u56db\u4e2a\u5177\u4f53\u6a21\u5757\u91cc\u7684\u591a\u5c42\u673a\u5236\u3002\u7406\u89e3\u8fd9\u5957\u7eaa\u5f8b\uff0c\u5c31\u80fd\u660e\u767d\u300c\u4e0d\u7528\u6846\u67b6\u300d\u4e3a\u4f55\u662f\u5b83\u7684<strong>\u5fc5\u7136\u63a8\u8bba<\/strong>\u800c\u975e\u53e3\u5473\u9009\u62e9\u3002<\/p>\n<h3 id=\"_1\">\u89e6\u53d1\u8fd9\u5957\u8bbe\u8ba1\u7684\u771f\u5b9e\u653b\u51fb<\/h3>\n<p><code>hermes_cli\/security_advisories.py<\/code> \u4e0e <code>pyproject.toml<\/code> \u6ce8\u91ca\u90fd\u70b9\u540d\u4e86\u540c\u4e00\u8d77\u4e8b\u4ef6\uff1a<\/p>\n<blockquote>\n<p><strong>Mini Shai-Hulud worm\uff082026-05\uff09<\/strong> \u2014\u2014 \u5728 PyPI \u4e0a\u6295\u6bd2\u4e86 <code>mistralai 2.4.6<\/code>\u3002\u8fd9\u662f\u4e00\u7c7b\u300c\u81ea\u6211\u4f20\u64ad\u7684\u4f9b\u5e94\u94fe\u8815\u866b\u300d\uff1a\u653b\u9677\u67d0\u7ef4\u62a4\u8005\u8d26\u53f7 \u2192 \u53d1\u5e03\u5e26\u6076\u610f\u4ee3\u7801\u7684\u65b0\u7248\u672c \u2192 \u6076\u610f\u4ee3\u7801\u5728\u5b89\u88c5\/\u8fd0\u884c\u65f6\u7a83\u53d6\u66f4\u591a\u51ed\u8bc1 \u2192 \u7528\u5077\u6765\u7684\u51ed\u8bc1\u6295\u6bd2\u66f4\u591a\u5305\uff0c\u6eda\u96ea\u7403\u6269\u6563\u3002<\/p>\n<\/blockquote>\n<p><code>pyproject.toml<\/code> \u5199\u5f97\u5f88\u76f4\u767d\uff1a\u82e5\u5f53\u65f6 mistralai \u7528 <code>&gt;=2.3.0,&lt;3<\/code> \u8fd9\u79cd\u8303\u56f4\u58f0\u660e\uff0c\u5219\u5728\u8be5\u6076\u610f\u7248\u672c\u88ab\u9694\u79bb\u524d\u7684\u51e0\u5c0f\u65f6\u5185\uff0c<strong>\u6bcf\u4e00\u6b21 install \u90fd\u4f1a\u81ea\u52a8\u62c9\u5230\u6295\u6bd2\u7248\u672c<\/strong>\u3002\u8fd9\u5c31\u662f\u9489\u6b7b\u7248\u672c\u7684\u76f4\u63a5\u52a8\u673a\u3002<\/p>\n<h3 id=\"_2\">\u653b\u51fb\u7c7b\u578b \u2192 \u9632\u5fa1\u7b56\u7565\u5bf9\u7167<\/h3>\n<p>\u628a Hermes \u7684\u9632\u5fa1\u9010\u6761\u62c6\u5f00\uff0c\u6bcf\u6761\u90fd\u5bf9\u5e94\u4e00\u7c7b\u5177\u4f53\u653b\u51fb\u573a\u666f\uff1a<\/p>\n<ol>\n<li>\n<p><strong>PyPI \u6295\u6bd2\u65b0\u7248\u672c<\/strong>\uff08\u8815\u866b\u6216\u88ab\u52ab\u6301\u8d26\u53f7\u53d1\u5e03\u6076\u610f X.Y.Z+1\uff09\u3002\u5bf9\u5e94\u7b56\u7565\uff1a\u6838\u5fc3\u4f9d\u8d56<strong>\u5168\u90e8\u7cbe\u786e\u9489\u6b7b<\/strong> <code>==X.Y.Z<\/code>\uff0c\u914d <code>uv.lock<\/code> \u9501\u5b9a\u4f20\u9012\u4f9d\u8d56\uff1b\u65b0\u7248\u672c\u53ea\u80fd\u901a\u8fc7\u300c\u4eba\u4e3a\u6539 pin + \u91cd\u65b0 lock + code review\u300d\u8fdb\u5165\u3002\u8bc1\u636e\uff1a<code>pyproject.toml<\/code> \u6ce8\u91ca +<code>[project.dependencies]<\/code> \u5168\u662f <code>==<\/code>\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u4f20\u9012\u4f9d\u8d56\u7206\u70b8\u9762<\/strong>\uff08\u76f4\u63a5\u4f9d\u8d56\u867d\u5c11\uff0c\u4f46\u95f4\u63a5\u62c9\u8fdb\u4e0a\u767e\u4e2a\u5305\uff0c\u4efb\u4e00\u88ab\u6295\u6bd2\u90fd\u4e2d\u62db\uff09\u3002\u5bf9\u5e94\u7b56\u7565\uff1a<strong>\u6838\u5fc3\u4f9d\u8d56\u6700\u5c0f\u5316<\/strong>\uff0c\u53ea\u6709\u300c\u6bcf\u4e2a session \u90fd\u7528\u5230\u300d\u7684\u5305\u8fdb core\uff1bprovider\/\u641c\u7d22\/TTS\/\u6d88\u606f\u5e73\u53f0\u7b49\u4e13\u5c5e\u4f9d\u8d56\u8e22\u51fa\u6838\u5fc3\uff0c\u6539\u4e3a<strong>\u60f0\u6027\u5b89\u88c5<\/strong>\u3002\u8bc1\u636e\uff1a<code>pyproject.toml<\/code> \u7684\u300cScope rule\u300d\u6ce8\u91ca + <code>tools\/lazy_deps.py<\/code> \u91cc\u7684 <code>LAZY_DEPS<\/code>\u3002<\/p>\n<\/li>\n<li>\n<p><strong><code>[all]<\/code> \u8fde\u5750\u5931\u8d25<\/strong>\uff08\u67d0 extra \u7684\u4f20\u9012\u4f9d\u8d56\u88ab\u9694\u79bb\uff0c\u5bfc\u81f4\u6574\u4e2a <code>[all]<\/code> \u89e3\u6790\u5931\u8d25\uff0c\u65b0\u88c5\u7528\u6237\u9759\u9ed8\u9000\u5316\u4e22\u529f\u80fd\uff09\u3002\u5bf9\u5e94\u7b56\u7565\uff1a\u628a\u53ef\u9009 backend \u4ece <code>[all]<\/code> \u79fb\u5230 lazy-install\uff0c\u5355\u5305\u9694\u79bb\u53ea\u5f71\u54cd\u8be5\u529f\u80fd\uff0c\u4e0d\u8fde\u7d2f\u5176\u5b83\u3002\u8bc1\u636e\uff1a<code>tools\/lazy_deps.py<\/code> docstring \u7684\u300cFragility\u300d\u6bb5 + <code>[all]<\/code> \u6ce8\u91ca\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u6076\u610f MCP \u6269\u5c55\u5305<\/strong>\uff08<code>npx<\/code>\/<code>uvx<\/code> \u62c9\u7684\u7b2c\u4e09\u65b9 MCP server \u53ef\u80fd\u662f\u6295\u6bd2\u5305\uff09\u3002\u5bf9\u5e94\u7b56\u7565\uff1a\u542f\u52a8\u524d\u67e5 <strong>OSV \u6570\u636e\u5e93<\/strong>\uff0c\u547d\u4e2d <code>MAL-*<\/code> \u6076\u610f\u8f6f\u4ef6\u516c\u544a\u5c31 <strong>BLOCK<\/strong>\u2014\u2014\u53ea\u62e6\u786e\u8ba4\u7684\u6076\u610f\u8f6f\u4ef6\u3001\u4e0d\u62e6\u666e\u901a CVE\uff0c\u4e14\u7f51\u7edc\u5931\u8d25\u65f6\u653e\u884c\uff08fail-open\uff09\u3002\u8bc1\u636e\uff1a<code>tools\/osv_check.py::check_package_for_malware<\/code>\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6e\u52ab\u6301\u5b89\u88c5\u6e90<\/strong>\uff08\u6076\u610f config \u628a\u5b89\u88c5\u91cd\u5b9a\u5411\u5230\u653b\u51fb\u8005\u955c\u50cf\u3001git \u6216\u672c\u5730\u8def\u5f84\uff09\u3002\u5bf9\u5e94\u7b56\u7565\uff1alazy-install <strong>\u53ea\u5141\u8bb8\u4ece PyPI \u6309\u5305\u540d\u88c5<\/strong>\uff0c\u4e0d\u652f\u6301 <code>--index-url<\/code>\/<code>git+https<\/code>\/<code>file:<\/code>\uff0c\u53ea\u80fd\u88c5\u767d\u540d\u5355 spec\uff0c\u4e14\u4ec5\u4f5c\u7528\u4e8e\u5f53\u524d venv\uff0c\u7edd\u4e0d\u78b0\u7cfb\u7edf Python\u3002\u8bc1\u636e\uff1a<code>tools\/lazy_deps.py<\/code> \u7684\u300cSecurity model\u300d\u6bb5\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5df2\u77e5 CVE \u7684\u4f9d\u8d56<\/strong>\u3002\u5bf9\u5e94\u7b56\u7565\uff1a\u5728\u9489\u6b7b\u7248\u672c\u4e0a\u9010\u6761\u6807\u6ce8 CVE\uff08<code>requests<\/code>\/<code>aiohttp<\/code>\/<code>starlette<\/code>\/<code>PyJWT<\/code>\/<code>anthropic<\/code> \u7b49\uff09\uff0c\u5347\u7ea7\u6709\u610f\u4e3a\u4e4b\u3002\u8bc1\u636e\uff1a<code>pyproject.toml<\/code> \u5185\u8054\u7684 <code># CVE-2026-xxxxx<\/code> \u6ce8\u91ca\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u6295\u6bd2\u5305\u5df2\u88c5\u8fdb\u7528\u6237\u73af\u5883<\/strong>\uff08\u9632\u7ebf\u7a81\u7834\u540e\u7684\u68c0\u6d4b\u515c\u5e95\uff09\u3002\u5bf9\u5e94\u7b56\u7565\uff1a\u6bcf\u6b21 CLI\/gateway \u542f\u52a8\u7528 <code>importlib.metadata.version()<\/code> \u6bd4\u5bf9<strong>\u5df2\u77e5\u88ab\u653b\u9677\u7248\u672c\u6e05\u5355<\/strong>\uff0c\u547d\u4e2d\u5373\u544a\u8b66 + \u7ed9\u4fee\u590d\u6307\u5f15\uff1b\u7528\u6237\u53ef <code>hermes doctor --ack &lt;id&gt;<\/code> \u786e\u8ba4\u5e76\u6301\u4e45\u5316\u3002\u8bc1\u636e\uff1a<code>hermes_cli\/security_advisories.py<\/code> \u7684 <code>ADVISORIES<\/code>\u3002<\/p>\n<\/li>\n<\/ol>\n<h3 id=\"_3\">\u5173\u952e\u7b56\u7565\u518d\u5c55\u5f00<\/h3>\n<ul>\n<li>\n<p><strong>\u9489\u6b7b\u7248\u672c + lockfile\uff08\u7b56\u7565 1\uff09<\/strong>\uff1a\u8303\u56f4\u58f0\u660e\u628a\u300c\u4f55\u65f6\u62c9\u5230\u65b0\u7248\u672c\u300d\u7684\u51b3\u5b9a\u6743\u4ea4\u7ed9 PyPI \u548c\u65f6\u95f4\uff1b\u9489\u6b7b\u5219\u6536\u56de\u5230\u300c\u4e00\u6b21\u663e\u5f0f\u4eba\u5de5\u63d0\u4ea4\u300d\u3002\u4ee3\u4ef7\u662f\u624b\u52a8 <code>uv lock<\/code>\uff0c\u6536\u76ca\u662f\u653b\u51fb\u8005<strong>\u6ca1\u6709\u81ea\u52a8\u5230\u8fbe\u7528\u6237\u7684\u901a\u9053<\/strong>\u3002pyproject \u660e\u786e\u8981\u6c42\uff1a\u5347\u7ea7\u5fc5\u987b\u540c\u65f6\u6539 pin \u5e76\u91cd\u65b0\u751f\u6210 <code>uv.lock<\/code>\uff0c\u300c\u4e0d\u8981\u5728\u6ca1\u6709\u4e66\u9762\u7406\u7531\u65f6\u628a\u8303\u56f4\u52a0\u56de\u6765\u300d\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u6700\u5c0f\u5316 + \u60f0\u6027\u5b89\u88c5\uff08\u7b56\u7565 2\u30013\uff09\u2014\u2014 &#8220;blast radius&#8221; \u7684\u6838\u5fc3<\/strong>\uff1a\u539f\u6587 <em>&#8220;smaller dependencies = smaller blast radius for the next supply-chain attack&#8221;<\/em> \u7684\u5de5\u7a0b\u542b\u4e49\u662f\uff1a\u6838\u5fc3\u4f9d\u8d56\u5217\u8868\u8d8a\u77ed\uff0c\u4e0b\u6b21\u4f9b\u5e94\u94fe\u653b\u51fb\u6ce2\u53ca\u4f60\u7684\u6982\u7387\u8d8a\u4f4e\u3002\u6240\u4ee5 <code>anthropic<\/code>\u3001<code>firecrawl<\/code>\u3001<code>edge-tts<\/code>\u3001<code>modal<\/code>\u3001<code>mautrix<\/code>\u3001<code>elevenlabs<\/code> \u7b49\u51e0\u5341\u4e2a provider \u4e13\u5c5e\u5305\u5168\u90e8\u79fb\u51fa core\uff0c\u6539\u7531 <code>lazy_deps.ensure(\"feature.name\")<\/code> \u5728\u9996\u6b21\u7528\u5230\u65f6\u73b0\u88c5\u3002\u53ea\u7528\u4e00\u5bb6\u6a21\u578b\u7684\u7528\u6237\uff0c\u6c38\u8fdc\u4e0d\u4f1a\u628a\u5176\u5b83\u51e0\u5341\u5bb6 provider \u7684\u4f9d\u8d56\u6811\u62c9\u8fdb\u653b\u51fb\u9762\u3002<\/p>\n<\/li>\n<li>\n<p><strong>OSV \u6076\u610f\u8f6f\u4ef6\u62e6\u622a\uff08\u7b56\u7565 4\uff09<\/strong>\uff1a\u552f\u4e00\u4e00\u5904\u300c\u4e3b\u52a8\u5916\u547c\u67e5\u8be2\u300d\u2014\u2014\u5728 agent \u771f\u6b63 <code>npx<\/code>\/<code>uvx<\/code> \u542f\u52a8 MCP server <strong>\u4e4b\u524d<\/strong>\uff0c\u5148\u95ee Google OSV API\u300c\u8fd9\u4e2a\u5305\u6709\u6ca1\u6709 <code>MAL-*<\/code> \u516c\u544a\u300d\u3002\u5b83<strong>\u6545\u610f\u53ea\u62e6\u786e\u8ba4\u6076\u610f\u8f6f\u4ef6\u3001\u4e0d\u62e6\u666e\u901a CVE<\/strong>\uff08\u907f\u514d\u8bef\u6740\uff09\uff0c\u4e14 <strong>fail-open<\/strong>\uff08\u7f51\u7edc\u5931\u8d25\u653e\u884c\uff0c\u4e0d\u963b\u65ad\u6b63\u5e38\u4f7f\u7528\uff09\u3002\u7075\u611f\u6765\u81ea Block\/goose \u7684\u6269\u5c55\u68c0\u67e5\u3002<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"langchain\">\u4e3a\u4ec0\u4e48\u8fd9\u5957\u7eaa\u5f8b\u5929\u7136\u6392\u65a5 LangChain<\/h3>\n<p>\u628a\u4e0a\u9762\u4e32\u8d77\u6765\uff1aLangChain\/LangGraph \u662f<strong>\u91cd\u4f9d\u8d56<\/strong>\uff0c\u81ea\u8eab\u53c8\u62d6\u4e00\u68f5\u5e9e\u5927\u4e14\u9ad8\u9891\u53d8\u52a8\u7684\u4f20\u9012\u4f9d\u8d56\u6811\u3002\u5bf9\u4e00\u4e2a\u628a\u300ccore \u4f9d\u8d56\u5fc5\u987b\u77ed\u3001\u6bcf\u4e2a\u5305\u90fd\u8981\u80fd CVE \u6807\u6ce8\u3001\u53ef\u9009\u4f9d\u8d56\u4e00\u5f8b\u60f0\u6027\u5316\u300d\u5f53\u786c\u89c4\u77e9\u7684\u9879\u76ee\uff0c\u5f15\u5165\u8fd9\u79cd\u6846\u67b6\u7b49\u4e8e\u4e00\u6b21\u6027\u7834\u574f\u7b56\u7565 1\/2\/3\/6\u2014\u2014blast radius \u76f4\u63a5\u7206\u70b8\u3002\u6240\u4ee5\u300c\u4e0d\u7528\u6846\u67b6\u300d\u4e0d\u662f\u5b64\u7acb\u7684\u53e3\u5473\uff0c\u800c\u662f\u8fd9\u5957\u4f9b\u5e94\u94fe\u7eaa\u5f8b\u7684<strong>\u5fc5\u7136\u63a8\u8bba<\/strong>\u3002<\/p>\n<h3 id=\"_4\">\u8865\u5145\uff1a\u4f9d\u8d56\u53ea\u662f\u5176\u4e2d\u4e00\u5c42<\/h3>\n<p><code>SECURITY.md<\/code> \u7684 trust model \u663e\u793a\u4f9b\u5e94\u94fe\u53ea\u662f\u9632\u5fa1\u7684\u4e00\u90e8\u5206\u3002Hermes \u628a\u6240\u6709\u300c\u8fdb\u5165 agent \u4e0a\u4e0b\u6587\u7684\u5185\u5bb9\u300d\uff08web \u6293\u53d6\u3001\u90ae\u4ef6\u3001gateway \u6d88\u606f\u3001\u6587\u4ef6\u3001MCP \u54cd\u5e94\u3001\u5de5\u5177\u7ed3\u679c\uff09\u90fd\u5217\u4e3a<strong>\u4e0d\u53ef\u4fe1\u8f93\u5165\u9762<\/strong>\uff1b\u53e6\u6709 <code>tools\/url_safety.py<\/code>\u3001<code>tools\/threat_patterns.py<\/code>\u3001<code>tools\/skills_guard.py<\/code>\u3001<code>tools\/skills_ast_audit.py<\/code>\u3001<code>tools\/tirith_security.py<\/code> \u5904\u7406 prompt \u6ce8\u5165\u4e0e\u6280\u80fd\u4ee3\u7801\u5ba1\u8ba1\u3002\u4f9d\u8d56\u6700\u5c0f\u5316\u89e3\u51b3\u300c\u4f60\u88c5\u8fdb\u6765\u7684\u4ee3\u7801\u53ef\u4fe1\u5417\u300d\uff0c\u8fd9\u4e9b\u6a21\u5757\u89e3\u51b3\u300c\u8dd1\u8d77\u6765\u540e\u5582\u7ed9\u6a21\u578b\u7684\u6570\u636e\u53ef\u4fe1\u5417\u300d\u3002<\/p>\n<h2 id=\"5\">5. \u4e0d\u7528\u6846\u67b6\u7684\u4f18\u7f3a\u70b9<\/h2>\n<h3 id=\"_5\">\u4f18\u70b9<\/h3>\n<ul>\n<li>\u5b8c\u5168\u63a7\u5236 prompt \/ \u6d88\u606f \/ \u7f13\u5b58 \/ \u91cd\u8bd5 \/ \u964d\u7ea7\uff0c\u80fd\u7b2c\u4e00\u65f6\u95f4\u7528\u4e0a\u5404\u5bb6\u6a21\u578b\u65b0\u7279\u6027\u3002<\/li>\n<li>\u4f9d\u8d56\u5c11\u3001\u653b\u51fb\u9762\u5c0f\u3001\u6784\u5efa\u53ef\u590d\u73b0\u3001\u957f\u671f\u53ef\u7ef4\u62a4\u3002<\/li>\n<li>\u8c03\u8bd5\u76f4\u89c2\uff0c\u6808\u77ed\uff0c\u884c\u4e3a\u663e\u5f0f\u3002<\/li>\n<li>\u4e0d\u53d7\u6846\u67b6\u7248\u672c\u5347\u7ea7\u7275\u8fde\u3002<\/li>\n<\/ul>\n<h3 id=\"_6\">\u7f3a\u70b9<\/h3>\n<ul>\n<li><strong>\u8981\u81ea\u5df1\u9020\u5f88\u591a\u8f6e\u5b50<\/strong>\uff1a\u91cd\u8bd5\u3001\u538b\u7f29\u3001\u8bb0\u5fc6\u3001\u5de5\u5177 schema\u3001\u5e76\u53d1\u3001\u53ef\u89c2\u6d4b\u6027\u2014\u2014Hermes \u4e3a\u6b64\u5199\u4e86\u4e0a\u4e07\u884c\uff0c\u6210\u672c\u771f\u5b9e\u5b58\u5728\u3002<\/li>\n<li><strong>\u7f3a\u5c11\u751f\u6001\u5373\u63d2\u5373\u7528<\/strong>\uff1aLangChain \u6709\u6d77\u91cf\u73b0\u6210 retriever \/ loader \/ \u96c6\u6210\uff0c\u81ea\u7814\u8981\u9010\u4e2a\u63a5\u3002<\/li>\n<li><strong>\u6982\u5ff5\u9700\u81ea\u5df1\u6c89\u6dc0<\/strong>\uff1a\u56fe\u7f16\u6392\u3001\u72b6\u6001\u673a\u3001checkpoint \u7b49 LangGraph \u76f4\u63a5\u63d0\u4f9b\u7684\u80fd\u529b\u8981\u81ea\u884c\u8bbe\u8ba1\uff08Hermes \u7528 Kanban + delegate \u81ea\u5b9e\u73b0\u4e86\u7c7b\u4f3c\u80fd\u529b\uff09\u3002<\/li>\n<li><strong>\u56e2\u961f\u4e0a\u624b\u66f2\u7ebf<\/strong>\uff1a\u6ca1\u6709\u901a\u7528\u6846\u67b6\u7684\u5171\u540c\u8bcd\u6c47\uff0c\u65b0\u4eba\u8981\u8bfb\u9879\u76ee\u79c1\u6709\u62bd\u8c61\u3002<\/li>\n<\/ul>\n<h2 id=\"6\">6. \u4ec0\u4e48\u65f6\u5019\u53cd\u800c\u8be5\u7528\u6846\u67b6<\/h2>\n<p>\u5e73\u8861\u5730\u770b\uff0c\u6846\u67b6\u5e76\u975e\u6ca1\u4ef7\u503c\uff1a<br \/>\n&#8211; <strong>\u5feb\u901f\u539f\u578b \/ Demo \/ \u4e00\u6b21\u6027\u811a\u672c<\/strong>\uff1a\u73b0\u6210\u96c6\u6210\u7701\u65f6\u95f4\u3002<br \/>\n&#8211; <strong>\u9700\u8981\u590d\u6742\u3001\u53ef\u89c6\u5316\u7684\u6709\u72b6\u6001\u7f16\u6392\u4e14\u4e0d\u60f3\u81ea\u7814<\/strong>\uff1aLangGraph \u7684\u56fe \/ checkpoint \/ human-in-the-loop \u662f\u771f\u5b9e\u4ef7\u503c\u3002<br \/>\n&#8211; <strong>\u56e2\u961f\u4e0d\u613f\u7ef4\u62a4\u5e95\u5c42\u5faa\u73af<\/strong>\uff0c\u613f\u7528\u62bd\u8c61\u7ea6\u675f\u6362\u53d6\u901f\u5ea6\u3002<\/p>\n<p><strong>\u7ecf\u9a8c\u6cd5\u5219<\/strong>\uff1a\u63a2\u7d22\u671f\u7528\u6846\u67b6\u8dd1\u5f97\u5feb\uff1b\u4e00\u65e6\u4ea7\u54c1\u8981\u957f\u671f\u6f14\u8fdb\u3001\u8981\u7cbe\u7ec6\u63a7\u5236\u6a21\u578b\u884c\u4e3a\u3001\u8981\u63a7\u4f9d\u8d56\u4e0e\u5b89\u5168\uff0c\u591a\u6570\u4e25\u8083\u9879\u76ee\u4f1a\u50cf Hermes \u4e00\u6837<strong>\u6536\u655b\u56de\u300c\u81ea\u7814\u7626\u6838\u5fc3\u5faa\u73af + OpenAI SDK\u300d<\/strong>\u3002\u8fd9\u4e5f\u662f Aider\u3001Codex CLI\u3001Claude Code \u7b49\u6d41\u884c coding agent \u540c\u6837\u4e0d\u4f9d\u8d56 LangChain \/ LangGraph \u7684\u539f\u56e0\u3002<\/p>\n<h2 id=\"7\">7. \u4e00\u53e5\u8bdd\u603b\u7ed3<\/h2>\n<p>agent \u7684\u6838\u5fc3\u5faa\u73af\u7b80\u5355\u5230\u4e0d\u503c\u5f97\u7528\u91cd\u6846\u67b6\u53bb\u5c01\u88c5\uff0c\u800c\u5faa\u73af\u5468\u8fb9\u771f\u6b63\u96be\u7684\u5de5\u7a0b\uff08\u7f13\u5b58 \/ \u964d\u7ea7 \/ \u538b\u7f29 \/ \u591a provider \/ \u4f9b\u5e94\u94fe\uff09\u53c8\u6070\u6070\u662f\u6846\u67b6\u62bd\u8c61\u4f1a\u6321\u8def\u7684\u5730\u65b9\u2014\u2014\u6240\u4ee5 Hermes \u9009\u62e9\u81ea\u7814\u7626\u6838\u5fc3\u5faa\u73af\uff0c\u7528\u4f9d\u8d56\u6700\u5c0f\u5316\u6362\u53d6\u53ef\u63a7\u6027\u4e0e\u5b89\u5168\u6027\u3002<\/p>\n<p>\u5982\u679c\u89c9\u5f97\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u4f60\u6709\u5e2e\u52a9\uff0c\u6b22\u8fce<strong>\u70b9\u8d5e\u3001\u6536\u85cf\u52a0\u5173\u6ce8<\/strong>\u3002\u540e\u7eed\u6301\u7eed\u5206\u4eab\u66f4\u591a\u6709\u4ef7\u503c\u7684\u5185\u5bb9\u3002\u4f60\u7684\u652f\u6301\u662f\u6211\u521b\u4f5c\u7684\u6700\u5927\u52a8\u529b\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf4\u660e\uff1aHermes \u4ed3\u5e93\u91cc\u6ca1\u6709\u4e00\u53e5\u660e\u786e\u5199\u4e0b\u300c\u6211\u4eec\u4e0d\u7528 LangChain \u56e0\u4e3a\u2026\u2026\u300d\u7684\u58f0\u660e\u3002 \u672c\u6587\u5206\u4e24\u5c42\uff1a\u884c\u4e1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[37,40,22,23,38,39,41],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-agent","tag-agent","tag-ai-agent","tag-langchain","tag-langgraph","tag-38","tag-39","tag-41"],"_links":{"self":[{"href":"https:\/\/genetop.top\/index.php\/wp-json\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/genetop.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/genetop.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/genetop.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/genetop.top\/index.php\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":0,"href":"https:\/\/genetop.top\/index.php\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"wp:attachment":[{"href":"https:\/\/genetop.top\/index.php\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/genetop.top\/index.php\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/genetop.top\/index.php\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}