Daily Tech Briefing
AI 科技速览

每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。

AI 快讯
HackerNoon AI · 2026/7/28 02:14:10
The End of CRUD APIs? Designing Intent-Driven Services for AI Agents

The End of CRUD APIs? Designing Intent-Driven Services for AI Agents

AI 中文解读
AI Agent的崛起正在让传统的CRUD接口走向终结!未来的API设计不再需要开发者一步步告诉系统“增删改查”,而是直接说出“我要下单”这个意图,系统自动搞定一切。 传统API就像让机器人去盖房子,你得告诉它先拿砖、再和水泥、再砌墙,每个步骤都可能出错。而意图驱动型服务不同,你只需说“给我盖个房子”,系统自己会判断所有细节。例如,过去AI要完成一个购买流程,需要依次调用客户、库存、支付等接口,一旦顺序搞错或理解偏差,就可能重复下单或支付失败。新方案把业务逻辑封装在服务内部,对外只暴露“下单”“改签”“开发票”这类明确的业务行为,大大降低了AI出错的可能。 对普通用户来说,这项变化意味着未来与AI交互会更顺畅——比如你让智能助手“帮我在星巴克订一杯拿铁”,它不再需要拆解成十几步操作,而是直接理解这个意图并一步到位。对开发者而言,写API的复杂度也降低了,因为不再需要暴露底层数据结构的细节。更聪明的AI应用很快就能落地,让自动化办公、智能客服等场景真正变得可靠。
Discover AnythingSignupWrite New StoryThe End of CRUD APIs? Designing Intent-Driven Services for AI AgentsbyFlaregun-devbyFlaregun-dev|@uthejdeveloperThis is thej, a software dev currently working on a startup app. Trying to find people to join the journey as wellSubscribeJuly 28th, 2026TLDR Your browser does not support the audio element.Speed1xVoiceDr. One Ms. Hacker byFlaregun-dev@uthejdeveloperbyFlaregun-dev|@uthejdeveloperThis is thej, a software dev currently working on a startup app. Trying to find people to join the journey as wellSubscribeStory's CredibilitybyFlaregun-dev|@uthejdeveloperThis is thej, a software dev currently working on a startup app. Trying to find people to join the journey as wellSubscribeStory's CredibilityTraditional CRUD APIs were designed around resources and operations such as create, read, update, and delete. That model remains effective for browsers, mobile applications, and service-to-service integrations where developers understand the domain and explicitly control the call sequence. AI agents operate differently. An agent receives a goal, selects tools dynamically, evaluates intermediate results, and may revise the execution path. Resource-oriented endpoints expose data structures, but they often hide the business meaning required for reliable autonomous action. As agentic systems become more common, API design is shifting from resource manipulation toward explicit intent. A CRUD interface might expose /customers, /inventory, /payments, and /shipments. Completing a purchase could require the agent to retrieve a customer, validate an address, reserve stock, authorize payment, create an order, and schedule delivery. Each call introduces another schema, dependency, failure mode, and opportunity for incorrect sequencing. The agent must understand details that traditionally belong inside the service boundary. A small prompt interpretation error can produce duplicate reservations, payment authorization without fulfillment, or an order created before required policy checks complete. An intent-driven service accepts the desired outcome rather than the individual mutations required to produce it. Instead of exposing internal workflow mechanics, the service presents a capability such as placeOrder, rescheduleDelivery, or resolveInvoiceDispute. The service then validates the request, applies domain rules, coordinates dependent operations, and returns a structured result. This approach does not remove REST, messaging, or internal CRUD operations. It changes the external contract presented to autonomous consumers. A concise Spring-style endpoint can make the distinction clear:@PostMapping("/intents/place-order") public OrderResult placeOrder(@RequestBody PlaceOrderIntent intent) { policyService.validate(intent); return orderWorkflow.execute(intent); } The endpoint describes a business action rather than a database mutation. Validation and orchestration remain inside the domain boundary, where transaction rules, compensation logic, and compliance checks can be enforced consistently. The agent does not need to infer whether inventory reservation must precede payment authorization or whether fraud analysis must be completed before shipment creation. Intent contracts require more precision than conventional application endpoints because agents depend on machine-readable semantics. An operation name alone is insufficient. The contract should define the goal, required inputs, preconditions, possible side effects, authorization scope, idempotency behavior, timeout expectations, and result states. OpenAPI can represent much of this information, while extensions can describe agent-specific metadata such as risk level, confirmation requirements, and execution mode.operationId: placeOrder x-intent: commerce.order.place x-risk-level: medium x-idempotency-required: true x-confirmation: conditional These annotations allow an orchestration layer to determine whether the operation is safe to invoke
分享
阅读原文