Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

Story

Three Agent Engines Face a 63-Run Performance Comparison

AI summary

A Juejin AI report author built three agent engines around LangChain ReAct, native function calling, and Python code actions, then compared them through shared routing, isolated sessions, tools, and metrics. Across 63 runs on seven tasks with deepseek-chat, all three completed 21 of 21 cases; CodeAgent used 15,051 tokens and 11 steps, while ReAct used 25,797 tokens and 19 steps, and ToolCallingAgent used 30,890 tokens and 16 steps. The author also found that project-specific prompt and termination rewrites reduced costs more decisively than whether an engine was framework-based or handwritten.

In-depth insight

The report offers a concrete implementation and benchmark for developers choosing among text-driven, structured function-calling, and code-driven agent architectures, while showing that prompt adaptation and step count strongly affect cost.

三引擎 Agent 方案设计与性能测试总结

摘要

项目原本只有一条 LangChain ReAct Agent 链路。为了比较不同的 Agent 控制循环与动作协议,我们新增了一条手写的 MultiStepAgent 引擎线,并实现了两个子引擎:

  • ToolCallingAgent:用原生 function calling 返回结构化工具调用;
  • CodeAgent:用 Python 作为 Action Language,把代码当成可执行的思考与行动方式。

前端通过路由和引擎选择页进行切换,三个引擎拥有独立会话空间;后端统一通过 engine 参数路由,并输出统一的 [META] 统计,让 token、steps、time、tool calls 可以直接对比。

第一版直接迁移了 smolagents 的提示词。实测发现:token 成本主要被提示词长度和步数主导,而不是“框架 or 手写”本身。于是第二版把两个新引擎的提示词和结束语义重写为项目专用版本,并重新跑了同一套 63 次实验。

#LangChain ReAct#ToolCallingAgent#CodeAgent#MultiStepAgent#smolagents#deepseek-chat#ToolSpec#LangChain#Flask

Original · 14 min readRead the original
Group chat

No comments yet. Start the conversation.