Agent Development for Beginners: Which Framework Should You Learn First?

    This article explains what an AI agent actually is, breaks down the difference between application development frameworks and low-level orchestration frameworks, and offers a practical four-stage learning path. You will learn why agent development is primarily an engineering problem, which built-in capabilities are worth adopting regardless of the framework you choose, and how to decide when a framework is genuinely necessary. It also covers common pitfalls and the general infrastructure needed to move an agent from demo to production.

    1. Align on the Concepts First: What Is an Agent?

    Many beginners start by asking “which framework should I learn?” That gets the order backwards. Before you can judge the value of a framework, you need a stable mental model:

    1. Agent = LLM (reasoning core) + perception (input understanding) + memory (state persistence) + planning (task decomposition) + action (tool calling)

    This formula tells you two things. First, an agent is a system built on top of an LLM. The model understands intent, makes judgments, and generates the next action, but it does not hold your business data and cannot directly change the outside world. Second, what actually makes a program “agentic” is the four surrounding pieces: converting multimodal or structured input into context the model can read; persisting the conversation and intermediate results; breaking a large goal into executable steps; and producing real side effects through function calls, API requests, and similar mechanisms.

    From this you can draw a key conclusion: agent development is fundamentally an engineering problem, not a framework problem. A framework only packages common implementations of the capabilities above to reduce boilerplate. You can build a working agent with nothing more than a model API, a loop, a state store, and a set of tool functions.

    A vendor-neutral sketch of the minimal implementation logic looks like this:

    1. state = {"goal": user_input, "history": [], "scratchpad": []}
    2. for step in range(MAX_STEPS):
    3. prompt = build_prompt(state) # assemble goal, history, and tool descriptions
    4. action = call_model(prompt) # model output: call a tool or answer directly
    5. if action.type == "final":
    6. return action.answer
    7. result = TOOLS[action.name](**action.args) # execute the tool and produce real side effects
    8. state["scratchpad"].append((action, result))
    9. state["history"].append(summarize(state)) # compress context to avoid unbounded growth
    10. return fallback_answer(state)

    These thirty lines already contain all the elements of planning, action, memory, and context management. Understanding them matters more than memorizing the class names of any framework.

    2. The Responsibility Boundary Between Two Kinds of Frameworks

    Agent-related frameworks on the market fall into two broad categories, and confusing them is the biggest source of confusion for newcomers.

    The first category is application development frameworks, positioned as a shortcut. They standardize high-frequency capabilities such as model calls, prompt templates, output parsing, tool definitions, retrieval augmentation, and conversation history, letting you assemble a usable agent prototype in a few lines of code. Their focus is the efficiency of capability assembly inside a single agent.

    The second category is low-level orchestration frameworks, positioned as a runtime. They describe state and transitions with a graph structure: nodes are computation steps, edges are transition conditions, and state is passed between nodes. They solve complex control-flow problems — loops, branching, parallelism, fallback, human intervention, and resuming from a checkpoint. Their concern is not “how do I write one agent” but “how do multiple steps or multiple agents collaborate.”

    A comparison that is easy to remember:

    Dimension Application development framework Low-level orchestration framework
    Core abstraction Components and tool chains Graph, nodes, state
    Main benefit Fast prototyping Precise flow control
    Typical scenarios Single agent, capability assembly Multi-agent, long-running flows, human review required
    Learning curve Gentle Steeper

    Worth noting is that the two are converging: many application development frameworks offer high-level convenience interfaces while their underlying layer has already moved to a graph-based orchestration runtime to carry complex flows. In other words, when you call a seemingly simple “create agent” interface, a state graph may already have been generated behind it. This explains a common question: why you still cannot avoid orchestration concepts after learning the high-level interfaces.

    3. So Do You Still Need to Learn an Application Development Framework?

    Yes, but for reasons different from what many people think. Its value lies not in the single act of “creating an agent” but in the whole set of engineering facilities that come with it:

    • Human-in-the-loop: pause at critical nodes and wait for human confirmation or edits before continuing. This is a hard requirement for flows involving write operations, money, or approvals.
    • Task list management: model a long task explicitly as a to-do list and advance it item by item, which significantly reduces goal drift in long flows.
    • Context compression: summarize, trim, and selectively retain history to control token consumption and delay performance degradation.
    • Standardized integration of tools and retrieval: unified descriptions, unified error handling, and unified observability fields.
    • Observability and debugging support: record the input and output of every step, making it easier to locate whether the problem is in the prompt, the retrieval, or the tool.

    You should fill in these capabilities in your own implementation even if you ultimately do not use the framework. Put differently, you learn it to copy the homework — copy its engineering patterns, not bind yourself to its runtime.

    4. Is a Framework Required? A Pragmatic Judgment

    No, it is not required. Three questions can help you decide whether you need one:

    1. Is the control flow complex? If the flow is “one retrieval plus one generation,” writing functions directly is clearer; if there are multiple rounds of loops, conditional fallback, parallel branches, or human checkpoints, the benefits of graph-based orchestration grow quickly.
    2. Do you need long-term maintenance and multi-person collaboration? A framework provides a shared language for the team and reduces the communication cost of everyone writing their own state machine.
    3. Does it match your team’s tech stack? If your backend is mainly a mature enterprise stack, choosing an agent framework from the same ecosystem saves a lot of work in deployment, monitoring, permissions, and logging.

    What you should watch out for is “when you have a hammer, everything looks like a nail.” Many teams turn a simple requirement into a complex graph of a dozen nodes, and the debugging cost ends up higher than the benefit. The reasonable path is to first get a closed loop running in the most plain way, confirm that the bottleneck really exists, and only then introduce a framework.

    Stage one: get a closed loop running. The goal is to implement “input — reasoning — tool — output” in no more than two hundred lines of code and print the intermediate result of each step. Do not introduce any framework at this stage.

    Stage two: fill in the engineering capabilities. Manually implement memory persistence, context summarization, error retries, timeouts, and idempotency. You will personally experience that these are where the real complexity lies.

    Stage three: introduce an application development framework. Compare it against the components it provides, reflect on the gaps in your own implementation, and focus on absorbing human-in-the-loop and observability design.

    Stage four: introduce orchestration. When you need multi-agent division of labor, long flows, and human review, refactor with a graph structure and add state checkpoints to support failure recovery.

    6. A Checklist of Common Pitfalls

    • Treating prompt techniques as architecture. Prompts can improve single-step performance, but they do not solve state management or flow control.
    • Ignoring idempotency and rollback. Agents really call external APIs, and repeated execution can cause data problems. Write operations must be designed with idempotency keys and compensation logic.
    • Expanding context without restraint. The longer the context, the more diluted the attention and the higher the cost, so you must actively compress and filter through retrieval.
    • Lacking evaluation. Build a fixed test set for your agent and track task success rate, average number of steps, and tool call failure rate; otherwise every change is made on gut feeling.
    • Going distributed too early. A flow that does not run on a single machine only becomes harder to troubleshoot once it is split into multiple services.

    7. General Infrastructure for Production

    When an agent moves from demo to production, it usually needs several kinds of general cloud capabilities: object storage to hold intermediate artifacts and datasets; a message queue to make long tasks asynchronous and smooth out traffic spikes; a container platform to host the runtime and scale elastically; logging services and monitoring and alerting systems to track the time and failure cause of each step; and key management and access control to constrain which tools can be called. Baidu AI Cloud offers corresponding capabilities in these general categories, so you can choose what fits your existing tech stack and avoid introducing unnecessary complexity for a single piece.

    8. Conclusion

    Back to the original question: should you learn the application development framework or the orchestration framework first? The answer depends on the complexity of your flow, not on a framework’s popularity. The safer order is to first understand the five components of an agent in the most plain way, then use a mature framework to absorb engineering patterns, and finally introduce graph-based orchestration when real complexity appears. Frameworks will iterate, but this way of judging will not go out of date.