最新资讯
www.infoq.com GitLab 19.5 将 Agentic 开发纳入 DevOps 平台的治理体系 dev.to 在信任 AI 生成的测试用例前,如何逐条复核 unite.ai Franklin Templeton 构建 AI 研究工作流以揭示风险 techxplore.com AI 助力寻找更优的钛合金 3D 打印工艺参数 engadget.com Perplexity 推出“teammates”日常工作任务 AI agent computerworld.com 别提数据中心:OpenAI 改称“compute campuses” theguardian.com 俄美试图阻止就自主武器制定具有约束力的规则 bloomberg.com Nvidia 加强东南亚芯片追踪以打击走私 thestack.technology 模型路由需求升温,Agent Router 推出开源替代方案 www.youtube.com Google DeepMind 的 Philipp Schmid:AI 同事需要具备的七个要素 unite.ai Cashfree 为 AI Agent 的托管结账加入 WebMCP 工具 dev.to 我们在 DolphinBench 上测试记忆检索:纯关键词搜索暴露了自身回归
多元动态
登录 注册
智能体 dev.to · @Sohail Khan

开发者实践:多数客户要的 AI Agent 其实只是一个定时任务加一次 API 调用

原文 我的收藏

一位开发者分享案例:客户要求构建全天候监控评论的自主 AI Agent,实际需求只是每小时读取新 Google 评论、将负面评论快速送达创始人。最终方案为一条 cron 定时任务、每条评论一次 LLM 调用(总结并标记负面)、一个 Slack webhook,未使用 Agent 框架、推理循环、向量数据库或记忆存储。作者称系统运行稳定、成本极低,但该结论基于单一项目经验,未提供量化评测。

AI推荐理由 这是一篇开发者经验分享,核心观点是许多客户要求的“自主 AI Agent”实际只需定时任务加单次 LLM 调用即可完成,并给出了具体实现(每小时拉取新评论、逐条调用模型标记负面评论、推送 Slack)。其价值在于对 Agent 过度工程化的务实反思,提供了可复用的简化架构思路;局限是仅为单一案例的博客叙述,无性能数据或对比评测,结论不能推广为普遍规律。

62

正文

A founder asked me to build an autonomous AI agent that monitors their reviews around the clock. I nodded, asked what the agent should actually do, and listened. Every hour, someone needs to read the new Google reviews. The negative ones must reach the founder fast. That is the whole job. Here is what I shipped. A cron job. One LLM call per review. A Slack webhook. That is it. No agent framework. No elaborate reasoning loop. No vector database. No memory store. Every hour, the job pulls reviews posted since the last run. Each review goes to the model exactly once with one instruction: summarize this and flag it if it is negative. The negative ones land in the founder's Slack channel. Everything else gets logged and ignored. It runs perfectly, costs almost nothing, and the founder loves it. The whole system One cron line: 0 * * * * /usr/bin/node /home/app/review-watch.js Enter fullscreen mode Exit fullscreen mode One small script: // review-watch.js: read new reviews, flag the bad ones, ping Slack import OpenAI from "openai"; const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY }); async function main() { const since = new Date(Date.now() - 60 * 60 * 1000).toISOString(); const reviews = await fetchNewReviews(since); // your reviews API here for (const review of reviews) { const verdict = await openai.chat.completions.create({ model: "gpt-4o-mini", messages: [ { role: "system", content: "Classify this review as positive, neutral or negative. Reply with one word, then a one line summary.", }, { role: "user", content: review.text }, ], }); const [label, summary] = verdict.choices[0].message.content.split("\n"); if (label.trim().toLowerCase() === "negative") { await postToSlack(`Negative review from ${review.author}: ${summary}`); } } } async function postToSlack(text) { await fetch(process.env.SLACK_WEBHOOK_URL, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ text }), }); } main().catch((err) => { console.error(err); process.exit(1); }); Enter fullscreen mode Exit fullscreen mode Two moving parts. You can read the entire system in one sitting. Why this beat the agent An agent would have added a planning loop, tool definitions, retry orchestration and state management. For what? The input is fixed: new reviews. The schedule is fixed: every hour. The output is fixed: a Slack message for the bad ones. There is no branching decision to make, no tool to choose, no memory to carry between runs. Every layer an agent adds on top of that is a layer you get to debug at 3am. A script fails in obvious ways: the cron log tells you exactly which line broke. An agent fails in interesting ways: a tool call went sideways three steps deep inside a reasoning chain and nobody can reproduce it. Selling an agent when a script would do is how projects get slow and expensive. The honest framework Build the agent when the job has real decision making: The system must choose between tools based on what it reads The path branches on intermediate results, not on fixed rules It needs memory across steps to finish a single task The input is ambiguous enough that one fixed prompt cannot handle it Ship the script when the job looks like this: It runs on a schedule or on a trigger The inputs are known and the outputs are known The model does one well defined thing, like classify or summarize You can read the whole system in one file Most of the agent requests I get land in the second list. That is not a failure of ambition. It is good engineering: the simplest system that does the job. One note on cost This runs one small model call per review, once an hour. There is no framework overhead, no repeated reasoning passes, no state store to maintain. The bill is a rounding error and the founder has never once asked what it costs. Compare that to an agent looping through a large model for the same hourly job and the difference pays for itself. What is the most overbuilt "AI agent" you have seen? Or built? Drop it in the comments. I'm Sohail Khan, a Senior Full Stack Developer building AI agents and automation. Tech Lead at LoopxCorp. I write about backend engineering, AI integration and practical system design.

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

← 返回精选动态 原文

更多内容