最新资讯
dev.to 我们在 DolphinBench 上测试记忆检索:纯关键词搜索暴露了自身回归 dev.to 别再把 Agent 写成 while 循环,把它建模为状态机 bloomberg.com Rightmove 与 Scout24 借 AI 产品应对低迷房市并上调展望 stackoverflow.blog 欢迎来到芯片时代:半导体制造、AI 数据中心与芯片设计的未来 www.youtube.com AI Agent 总犯同样的错:CentralAgent AI 将记忆重构为经验系统 pub.towardsai.net Netflix 科学家建议重采样 LLM 评判:5 次仅将误差棒缩小 13% pub.towardsai.net Jev 作为 LLM 前的静默层:构建提示感知的模型路由器 reddit.com OpenAI 称 Astra 仅满足 10% 安全任务标准 dev.to FreeToken:在自有 GPU 上运行前沿 MoE 模型及其内存需求 dev.to 当 AI Agent 说“完成”时,究竟完成了什么? dev.to 部署 Underdog Bark 3.0 Pro:逐字转写、自定义后端与分块设置 dev.to 为艰难对话构建 AI:五个 Agent、一条安全正则与一位盲评监督者
多元动态
登录 注册
智能体 dev.to · @Albert zhang

构建结构化的 Agent 间通信:实用指南

原文 我的收藏

文章指出多数多 Agent 教程只演示“Agent A 与 Agent B 对话”,未解决规模化下的可靠性问题:输出超出 token 限制、关键参数被摘要掉、下游 Agent 解析偏差。作者在 AgentForge 中为每个 Agent 声明输入 schema,由编排器在执行前校验,不匹配则中止并报错,而非让下游 Agent 做出错误推断。

AI推荐理由 文章针对多 Agent 系统中基于字符串传递消息的可靠性问题,提出用带类型的 JSON 契约声明各 Agent 的输入输出 schema,并由编排器在执行前校验,避免输出超长、关键参数被摘要掉或解析歧义。属于工程实践分享,含代码示例,但来自个人博客,缺少规模化验证与对比数据。

68

正文

Every multi-agent tutorial shows "Agent A talks to Agent B." None show how to keep that conversation reliable at scale. The Problem with String-Based Agent Chat # What most frameworks do: result = agent_a.run("Analyze this and tell agent_b what to do") agent_b.run(result) # What if result is 2000 tokens? What if it omits context? Enter fullscreen mode Exit fullscreen mode This breaks when: Output exceeds token limits Critical parameters get "summarized" away Agent B parses instructions differently than intended Our Solution: Typed JSON Contracts Every agent in AgentForge declares its input schema: { "agent": "risk_analyzer", "input": { "portfolio": ["AAPL", "TSLA"], "timeframe": "1d", "risk_threshold": 0.05 }, "expected_output": { "max_drawdown": "float", "sharpe_ratio": "float", "flags": ["string"] } } Enter fullscreen mode Exit fullscreen mode The orchestrator validates before execution. If agent A's output doesn't match agent B's input schema, the pipeline halts with a clear error — instead of agent B making a wrong inference. Schema Enforcement at Runtime from agentforge.core import Orchestrator, AgentContract contract = AgentContract( input_schema={"query": str, "max_results": int}, output_schema={"results": list, "confidence": float} ) orch = Orchestrator() orch.register("search_agent", search_fn, contract) Enter fullscreen mode Exit fullscreen mode If search_fn returns "confidence": "high" instead of 0.92, the orchestrator flags it immediately. Why This Matters In production, you don't want agents to "kind of work." You want deterministic, debuggable, testable behavior. Typed contracts give you that. Built with AgentForge. Open source. Production-tested. https://github.com/agentforge-cyber/agentforge-mvp Do you enforce schemas in your agent pipelines? Or do you trust the LLM to "figure it out"? Posted on 2026-09-13 by the AgentForge team.

来源报道 · 1 篇 · 以下链接均前往原始媒体

Albert zhang 构建结构化的 Agent 间通信:实用指南 09-13 · 原文发布
← 返回精选动态 原文

更多内容