@ba_niu80557: https://x.com/ba_niu80557/status/2062103965517721821
Summary
This article breaks down six design paths for the 2026 Agent framework (LangGraph, OpenAI Agents SDK, CrewAI, Dify, vendor-native SDK, Pi) and provides selection recommendations based on dimensions such as state management, process complexity, human-machine interaction, and model flexibility. It is suitable for teams looking to choose an Agent framework in a production environment.
View Cached Full Text
Cached at: 06/03/26, 09:55 PM
2026 Agent Framework: Six Routes Fully Deconstructed — A Selection Guide from Lessons Learned
Lately, people keep asking me “which agent framework should I use?” After nearly two years of AI consulting across various client scenarios, my answer is generally — don’t rush to pick a framework. First, figure out what shape your problem actually is.
Because in 2026, agent frameworks aren’t about “which one is best.” There are six completely different design philosophies in front of you. The question is which one fits your scenario.
Pick the right one, and you’re live in three weeks. Pick wrong, and an engineer wastes a quarter. That’s not my line — it’s what Digital Applied said after their horizontal evaluation: migrating between frameworks on tool definitions, memory schemas, and observability pipelines normally eats up an entire engineer quarter.
So in this article, I want to lay out the landscape first, then talk about how to choose.
Route 1: Graph State Machine — LangGraph
LangGraph models an agent as a directed graph. Nodes are agents, tools, or checkpoints. Edges can have conditions. State at every step can be persisted, rolled back, and paused for human approval before continuing.
This is the de facto standard for enterprise production environments in 2026, with little controversy. Uvik’s research lists about 400 companies running on LangGraph Platform — including Klarna, Uber, LinkedIn, BlackRock, JPMorgan, and Replit. Monthly downloads: 34.5 million, the highest of any agent framework.
LangGraph wins on controllability. Every path taken, every condition triggering a branch, every point where human intervention is needed — all explicitly defined in the graph. You don’t need to guess what the agent did; the graph is the execution path. When something breaks, you can point at a specific node and say “the error is right here.”
The trade-off is a slower learning curve. Getting from zero to writing production-grade agents takes about one to two weeks, and there’s more boilerplate than in other frameworks. If your task isn’t actually complex, using LangGraph is like using a sledgehammer to crack a nut.
When to use it: financial compliance approvals, multi-step customer service, any long-running workflow that needs audit trails and failure recovery. If your agent needs to tell a human “you’re at step 4, here’s the judgment from step 3, do you want to change it?” — LangGraph is basically the only choice.
Route 2: Handoff Chains — OpenAI Agents SDK
OpenAI turned its experimental Swarm project into the production-grade Agents SDK. The core abstraction is handoff — explicit handover of control between agents, with the conversation context following along.
Developer experience is the best among these six frameworks. You can get a multi-agent system running in under 100 lines of code. In April 2026, they added a harness system and sandbox execution — a sign that OpenAI is starting to take production environments seriously.
But it has a hard limitation. It’s locked to OpenAI’s models. Want to switch between Claude and GPT? Want to use open-source models? This framework doesn’t support it.
When to use it: you want to get a demo-ready agent up and running with minimal code, and you’re already committed to a full OpenAI stack. Prototyping speed is genuinely fast — no other framework competes here. But you need to be clear-eyed about the vendor lock-in cost.
Route 3: Role-Based Collaboration — CrewAI
CrewAI’s approach is to organize agents by role. You define a researcher, a writer, a reviewer, form them into a crew, give them a task, and CrewAI manages the collaboration.
44.6K GitHub stars, fast to learn. Tasks that naturally have a division of labor — research reports, content pipelines, competitive analysis — feel especially natural with CrewAI. In 2026, it also added A2A protocol support and enterprise-grade observability.
But here’s an important insight from real-world practice. Particula Tech’s horizontal comparison noted that CrewAI → LangGraph is currently the most common framework migration path. Teams prototype quickly in CrewAI, then when they hit production they find CrewAI’s flow control isn’t enough, and end up migrating to LangGraph. The migration cycle is about one to two weeks.
That’s not to say CrewAI is bad. Its “role collaboration” abstraction is very elegant in simple scenarios. But once your task needs conditional branches, state rollback, human approval — you’ll find CrewAI can’t express those.
When to use it: your task is naturally structured as “several roles each do their own thing and then aggregate.” If you know from the start that you’ll eventually need complex flow control — consider starting with LangGraph directly to avoid the migration later.
Route 4: Visual Platform — Dify
Dify is a different beast from the previous three. It’s not a framework for engineers — it’s a platform for teams that want to use AI without writing code.
129.8K GitHub stars, higher than all agent frameworks. But that number doesn’t represent technical influence — it’s audience size. There are far more non-technical people than engineers.
Drag-and-drop to build AI apps, connect data sources, publish internal tools. Operations teams building knowledge bases, product teams building customer service bots, marketing teams doing content generation — Dify is great for these scenarios.
But if you need fine-grained control over agent behavior — conditional logic, custom tools, complex context management — Dify wasn’t designed for you. Its target users are people who run away at the phrase “write a TypeScript extension.”
When to use it: your team has no engineers, or engineers shouldn’t be spending time on building internal tools. When the boss asks “can we get an AI system without hiring anyone?” the answer is likely Dify.
Route 5: Vendor Native SDK — Claude Agent SDK / Google ADK
SDKs released by the model providers themselves, with the deepest integration with their own models.
Claude Agent SDK opens up the Claude Code runtime as a programmable library. Built-in tools, agent loop, context management — all the capabilities of Claude Code, now callable via Python or TypeScript. Adoption grew quickly in 2026, especially in scenarios needing native MCP support and Memory features.
Google ADK uses hierarchical orchestration, native integration with Vertex AI, and supports Python, TypeScript, Java, and Go. If your entire stack is on Google Cloud, this is the path of least resistance.
The advantage of both SDKs is the same: native-level integration with their own models. Other frameworks can’t achieve this depth.
The disadvantage is also the same: you’re locked into one vendor. Want to switch models? Switch frameworks.
When to use it: you’ve already committed to Claude or Google as your primary model and don’t plan to switch short-term. The experience with the native SDK will be best. But if you want to retain vendor flexibility — this path isn’t for you.
Route 6: Minimal Harness — Pi
Pi is the most unique of these six routes, and the least well-known.
All five previous routes share one assumption: the framework makes a lot of decisions for you. How state is managed, how workflows are orchestrated, how tools are invoked — the framework has default approaches. You work within the boundaries the framework sets.
Pi rejects this assumption. Its author, Mario Zechner, is the badlogic who wrote libGDX — someone who has built low-level frameworks for twenty years. His philosophy: don’t make decisions for the user. Give them a set of orthogonal, composable primitives and let them build their own.
So Pi by default gives the model only four tools — read, write, edit, bash. No sub-agent, no plan mode, no predefined orchestration logic. It’s not that these things can’t be done — they’re deliberately not built-in. You want them? Build your own with a TypeScript extension, or install a community Pi Package.
Pi has three design aspects that I find genuinely substantial. First, context engineering is a first-class citizen — AGENTS.md loading, skills, prompt templates, dynamic context injection are all core features. Second, compaction is fully open — you control what gets kept and what gets dropped during compaction, and you can even guide the summarization strategy with natural language. Third, sessions are tree-structured — you can branch from any historical node, giving coding tasks version control for trial-and-error.
Pi also has a unique philosophy: it encourages users to publish coding sessions publicly on Hugging Face, improving coding agents through real engineering sessions rather than toy benchmarks.
When to use it: you’re the kind of engineer who feels other frameworks “make too many decisions for me.” You want complete control over every behavior of the agent. You’re willing to build things yourself in exchange for total freedom.
When NOT to use it: enterprise business workflows needing audit, permissions, persistence. Pi is a coding harness, not an enterprise agent platform. Using it for approval flows is like using a Swiss Army knife to build a house.
Six routes covered. How to choose?
Picking a framework isn’t about comparing feature lists. It’s about understanding what your scenario looks like across a few key dimensions.
Here’s what I look at when making a selection:
How strong are your state management requirements? If your agent needs to resume from a crash, persist state at every step — LangGraph is the only one that seriously does checkpointing. Short tasks that run to completion — most frameworks work, no need to bring in LangGraph for that.
Is the flow linear or branching? Linear (A → B → C) — CrewAI and OpenAI Agents SDK can handle it. Once you have conditional branches, loops, rollbacks — LangGraph. Other frameworks either don’t support it or you have to hack it in.
Does it need human intervention? Critical decisions must be human-approved → LangGraph has native human-in-the-loop. Occasional confirmations → most frameworks’ hooks can do it.
How important is model flexibility? Want to switch between vendors → LangGraph, CrewAI, Pi are model-agnostic. Already committed to one → the corresponding vendor SDK gives the best experience.
What’s the team’s technical level? Non-technical team → Dify. Engineers who don’t want to spend a week or two learning → CrewAI or OpenAI Agents SDK. Senior engineers who want total control → LangGraph or Pi.
If you’re still unsure — use the simplest decision method: will your agent eventually need conditional branches and human approval? If yes → LangGraph. If no → start with CrewAI or OpenAI Agents SDK to validate, and migrate when you hit the ceiling.
Finally, something easily overlooked.
MIT analyzed over 300 enterprise AI implementation projects and found that only about 5% successfully made it from pilot to production.
One line from the report is particularly worth remembering: “The failure mode is almost never the framework.”
The cause of failure is almost never the framework.
It’s requirements not thought through. Data not prepared. Context engineering not done. Evaluation system not built. Costs not calculated correctly. Human approval flows not designed.
The framework is just a container. What you put into it matters far more than what container you use.
After two years of AI implementation, I’ve become increasingly convinced of this: clients never fail because they “chose the wrong framework.” They fail because before choosing the framework, they didn’t think through “what problem is this agent solving, where does the data come from, who’s responsible when something goes wrong, how do we measure effectiveness?”
Framework selection takes a week. Thinking through these questions might take a month.
But most teams spend a month selecting a framework and a week thinking through the questions.
The order is reversed.
Think through the problem first. Then you’ll find the framework selects itself.
Similar Articles
@teach_fireworks: A one-image comparison of mainstream Agent development frameworks! How to choose among so many Agent development frameworks? For personal heavy daily coding / research on open-source projects: try Pi Agent AI SaaS or enterprise-level agents: OpenAI Agents SDK + Lang…
A tweet compares mainstream AI Agent development frameworks (such as Pi Agent, OpenAI Agents SDK, LangGraph, LlamaIndex, Pydantic AI) and gives selection recommendations for different scenarios.
@Xudong07452910: Open-source framework recommendation: Agency Agents — 232 professional AI agents, divided by function, covering 16 business departments. If you've used Claude Code or Codex, you may have encountered this problem: AI is very capable at coding tasks, but when it comes to front-end design, writing marketing...
Agency Agents is an open-source framework providing 232 professional AI agents covering 16 business departments. Each agent has a unique personality, communication style, and delivery standards. It supports multiple development tools such as Claude Code, GitHub Copilot, and has community-translated versions.
This article systematically reviews AI Agent architecture and engineering practices, covering control flow, context engineering, tool design, memory, multi-agent organization, evaluation, tracing, and security. It is based on the OpenClaw implementation and emphasizes the critical role of Harness (testing and validation infrastructure) for system stability.
This article systematically reviews AI Agent architecture and engineering practices, covering control flow, context engineering, tool design, memory, multi-agent organization, evaluation, tracing, and security. It is based on the OpenClaw implementation and emphasizes the critical role of Harness (testing and validation infrastructure) for system stability.
@chasen_liao: https://x.com/chasen_liao/status/2077219202608545835
This article explores the trend of upgrading prompt engineering to Agent engineering, emphasizing structured context management of AI agents through methods like AGENTS.md, and shares a minimal closed-loop workflow methodology.
@GitHub_Daily: Using AI agents for production-grade tasks—writing code, running workflows, calling APIs—works fine initially, but as the scale grows, things easily get out of control: permissions too broad, context loss, and debugging becomes impossible. That's where agents-best-practices comes in: a complete guide to designing a runtime framework for AI agents, not limited to coding scenarios, but also applicable to operations, sales...
Introduces the agents-best-practices repository, a production-grade AI agent runtime framework design guide covering tool permission tiers, context compression, etc., supporting Codex and Claude Code installation.