{"slug": "gartner-expects-40-of-agent-projects-to-be-canceled-i-stopped-one-and-here-is-i", "title": "Gartner Expects 40% of Agent Projects to Be Canceled. I Stopped One, and Here Is What I Learned", "summary": "A developer who built and then canceled a six-agent petroleum trading system reports that the project failed on data access, governance and ownership rather than model capability, and proposes treating agents as distributed systems with event-driven consumers, idempotency keys and per-event tracing. The account cites Gartner's forecast that over 40% of agentic AI projects will be canceled by the end of 2027, noting it is a prediction rather than a measured outcome.", "body_md": "A model, some tools, a database and a trigger make a working demo. They don't make a production system.\n\nGartner [predicts](https://www.gartner.com/en/newsroom/press-releases/2025-06-25-gartner-predicts-over-40-percent-of-agentic-ai-projects-will-be-canceled-by-end-of-2027) that over 40% of agentic AI projects will be canceled by the end of 2027, citing escalating costs, unclear business value and inadequate risk controls. That is a forecast, not a measured outcome. One [reconciliation of failure statistics](https://alatirok.com/ai-agent-failure-rate-2026/) notes that it is the only widely quoted figure that measures agents specifically. The scarier numbers (80%, 88%, 89%) cover broader categories such as all enterprise AI or all proofs of concept.\n\nI recently became one of those statistics. I built a six-agent system for petroleum trading and then stopped the project. The reason had little to do with the model or the code.\n\nThis article covers the failure data, a layered architecture I would use next time, and my own case. It builds on good existing work, including [Event-Driven AI Agents: Patterns That Scale](https://dev.to/thedailyagent/event-driven-ai-agents-patterns-that-scale-39ld), [Designing Agentic AI Systems](https://dev.to/sreeni5018/designing-agentic-ai-systems-how-real-applications-combine-patterns-not-hype-1ob4), Martin Fowler's [Long-horizon agents and durable execution](https://martinfowler.com/articles/durable-execution-agents.html) and MLflow's [Event-Driven Agents](https://www.mlflow.org/articles/event-driven-agents/).\n\n[Forbes' summary](https://www.forbes.com/sites/robertszczerba/2026/07/07/why-40-of-agentic-ai-projects-may-be-canceled-by-2027/) of the Gartner forecast points the same way: governance, data access, ownership and ROI drive cancellations more than raw model capability. Most agent failures are distributed-systems and data problems, so I treat the agent as a distributed system.\n\nEvery architecture guide I read, including the ones linked above, assumes the agent can reach the data it needs. My project shows what happens when that assumption fails. I return to it in the case study below, because it should be checked before anything else.\n\nA request-driven agent waits for a caller. An [event-driven agent](https://www.mlflow.org/articles/event-driven-agents/) wakes because something happened, such as a webhook, a queue message or a file change. The broker buffers events when the agent is slow or down. The consumer loop is: subscribe, receive an event, enrich it with tools, reason, then act or choose to do nothing.\n\nPlan for these failure modes:\n\nUse orchestration when one event needs dependent steps, and choreography when several independent agents should react to the same event.\n\nHere is an illustrative handler with an idempotency key and per-event tracing, following the tracing pattern in the MLflow guide. It is a sketch, not production code:\n\n``` php\nimport hashlib\nimport mlflow\n\ndef idempotency_key(event: dict) -> str:\n    return hashlib.sha256(f'{event[\"id\"]}:{event[\"type\"]}'.encode()).hexdigest()\n\n@mlflow.trace\ndef handle_event(event: dict):\n    mlflow.update_current_trace(\n        tags={\"event_id\": event[\"id\"], \"event_type\": event[\"type\"]}\n    )\n    key = idempotency_key(event)\n    if processed_store.exists(key):           # your own store (Redis, Postgres, ...)\n        return {\"status\": \"duplicate_ignored\"}\n\n    context = enrich(event)                   # tool calls appear as spans\n    decision = agent.run(event, context)      # \"no_action\" is a valid result\n    if decision.action == \"no_action\":\n        processed_store.add(key, outcome=\"no_action\")\n        return {\"status\": \"no_action\"}\n\n    result = act(decision, idempotency_key=key)\n    processed_store.add(key, outcome=result.status)\n    return {\"status\": result.status}\n```\n\nA duplicate delivery now shows up as two traces with the same `event_id`, and \"no action\" becomes something you can read instead of a gap in your logs.\n\nMartin Fowler's article describes [durable execution](https://martinfowler.com/articles/durable-execution-agents.html) as an emerging pattern. The runtime records the result of every step that touches the outside world. After a failure, the program runs again, completed steps are skipped and state is rebuilt from the record. Temporal, Restate, Inngest, DBOS and Cloudflare Workflows implement it. It resembles a write-ahead log, event sourcing and Erlang actors. Waiting workflows hold no process, so cost tracks work done rather than the number of idle agents.\n\nDurable does not mean correct. Fowler's practical rules include:\n\nA sketch of such a guard:\n\n``` php\nclass PlaceOrder(Tool):\n    def allowed(self, state) -> bool:\n        return state.approved_up_to is not None and state.order is None\n\n    async def execute(self, state, ctx):\n        price = await ctx.supplier.current_price(state.sku)    # re-check now\n        if price > state.approved_up_to:                       # outside approved range\n            return Result(placed=False, price=price)\n        return await ctx.supplier.place_order(\n            state.po, idempotency_key=state.po.number          # stable across retries\n        )\n```\n\nNotice that this guard depends on `current_price` returning a real, current number. That is the point I return to below.\n\nTreat memory as a subsystem, not a vector store. One [architecture guide](https://www.cognee.ai/ai-agent-memory-architecture) separates working memory from long-term episodic, semantic and procedural memory, with explicit write and read paths and a feedback loop. Start simple. One [source](https://theaioperator.io/p/agent-memory) argues that below roughly 50K notes, text search with a capped output can beat a vector database. The open-source [gbrain](https://github.com/garrytan/gbrain) project defaults to embedded PGLite for personal use up to about 50K pages. It moves to Postgres with pgvector for shared or large deployments.\n\n[Bain](https://www.bain.com/insights/the-three-layers-of-an-agentic-ai-platform/) describes three layers for an agentic platform: orchestration, observability and governed data access. Its components include a central registry and policy, runtime guardrails such as prompt-injection filters, and full tracing of the execution graph. A [research reference framework](https://arxiv.org/html/2602.10479v1) adds policy enforcement on every tool call, permission separation by role, bounded execution budgets and immutable audit logs.\n\nFor event-driven agents, tracing matters more than for chat agents, because nobody is watching. For any event you must be able to say what the agent received, which model and tool calls it made, and why it acted or didn't. Build an evaluation set from real events, including \"no action\" cases.\n\nI built [Hanna AI](https://github.com/modarresi1913/hanna-ai), a prototype multi-agent system for petroleum and petrochemical trading. According to its README, it has six specialized agents covering market analysis, logistics, documentation, compliance, finance and operations. A keyword-based router sends each message to the right agent, and the operations agent coordinates deals. It runs on Next.js, TypeScript and SQLite via Prisma.\n\nThe design looked complete. The problem was upstream of the design.\n\n**What I could not get.** I could not obtain up-to-date data for the oil-related industries I was targeting, because I had no access to it. I also could not find clear, transparent data on suppliers and buyers.\n\n**What it did to the build.** Real-time prices became mock feeds for 12 products. The company directory became a static list of about 20 companies. The agents could produce fluent answers, but not answers anyone should trade on.\n\n**What it did to each layer:**\n\nThe durable-execution guard above fails for the same reason. It can re-check a price before an order, but only if a real price exists.\n\n**Why I stopped.** Without current market data and without transparent information on who supplies and who buys, the system could only demonstrate its workflow, not support real decisions. I chose to stop the project rather than present mock output as if it were reliable. The project is currently on hold.\n\n**What I would do differently:**\n\n| Layer | Core pattern | Main risk it addresses | \n|---|---|---|\n| 0. Data access | Verify sources, freshness and rights | Building on data you can't get | \n| 1. Ingress | Event bus, dedup, idempotency keys | Bursts, duplicates, missed events | \n| 2. Execution | Durable workflows, retries, compensation | Crashes, lost state, long waits | \n| 3. Memory | Layered, simple-first | Stale or oversized context | \n| 4. Governance | Central policy, audit, tracing, evaluation | Silent wrong actions, compliance | \n\nAdd guardrails and observability before complexity ([Neo4j](https://neo4j.com/blog/agentic-ai/agentic-architecture/) makes a similar point). A sensible order:\n\nFowler's closing point fits my experience: the trade-offs you build into the harness decide whether an agent is useful or only a proof of concept. I would add one more rule: confirm the data exists before you build the harness.\n\nAuthor: Seyed Alireza Alhosseini Almodarresieh\n\nmy site:[https://almodarresieh.github.io/](https://almodarresieh.github.io/)", "url": "https://wpnews.pro/news/gartner-expects-40-of-agent-projects-to-be-canceled-i-stopped-one-and-here-is-i", "canonical_source": "https://dev.to/alirezaai/gartner-expects-40-of-agent-projects-to-be-canceled-i-stopped-one-and-here-is-what-i-learned-550g", "published_at": "2026-11-27 16:37:13+00:00", "updated_at": "2026-11-27 16:42:24.451874+00:00", "lang": "en", "topics": ["ai-agents", "artificial-intelligence", "mlops", "ai-safety"], "entities": ["Gartner", "Martin Fowler", "MLflow", "Forbes"], "also_reported_by": [], "takeaway": "Treat agents as event-driven distributed systems: buffer events in a broker, deduplicate with a hash of event id and type, and trace each event so duplicate deliveries and 'no_action' outcomes are visible.", "recommendation": {"advice": "Before building agent logic, verify the agent can actually reach its data; then run it as an event-driven consumer with idempotency keys and per-event tracing so duplicates and no-action outcomes are observable.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/gartner-expects-40-of-agent-projects-to-be-canceled-i-stopped-one-and-here-is-i", "markdown": "https://wpnews.pro/news/gartner-expects-40-of-agent-projects-to-be-canceled-i-stopped-one-and-here-is-i.md", "text": "https://wpnews.pro/news/gartner-expects-40-of-agent-projects-to-be-canceled-i-stopped-one-and-here-is-i.txt", "jsonld": "https://wpnews.pro/news/gartner-expects-40-of-agent-projects-to-be-canceled-i-stopped-one-and-here-is-i.jsonld"}}