AI Agent Development Basics: Do You Need Application Frameworks, Orchestration, or Both?

    This article explains how beginners should approach AI agent development without trying to master every framework at once. It clarifies what application frameworks and orchestration frameworks each solve, why a single agent can still need complex orchestration, and how to decide which layer to learn first. You will also find a minimal, framework-free agent loop, a clear separation between state, memory, and context, and the production engineering practices required for tool safety, human approval, failure recovery, observability, and evaluation, followed by a staged learning path and framework selection criteria.

    1. The Core Question: If You Learn Orchestration, Do You Still Need an Application Framework?

    A common question from people new to agent development is this: if an orchestration framework can already organize task execution, can you skip the LLM application framework?

    The answer is neither a simple “yes” nor a simple “no.” You do not need to learn every feature of both frameworks, but you do need to understand what problem each one solves and master the capabilities your current task actually requires.

    Application frameworks typically help developers connect models, define tools, organize messages, handle retrieval results, and stand up an agent quickly. Orchestration frameworks focus on the execution process: how tasks branch, when to loop, how state is preserved, how to recover after a failure, and which steps need human confirmation.

    The two overlap, but they do not replace each other. Beginners are better off first building a minimal working loop for an agent, then adding application components and orchestration capabilities as requirements appear, rather than starting from a large surface of APIs and configuration options.

    2. Understanding Agents: The Model Is Only One Component

    An agent can be approximated as:

    Agent = model reasoning + environment input + state and memory + decision mechanism + tool execution.

    This is an engineering abstraction meant to aid understanding. It is not a strict mathematical definition, and it does not imply that every agent must have a dedicated long-term memory module or a complex planner.

    A normal model call is usually “input a question, generate an answer.” An agent, by contrast, can choose the next action based on task progress within defined constraints, invoke external capabilities, read execution results, and keep going until the task is complete or a stop condition is triggered.

    For example, a task to “summarize this week’s device alerts into a report” might require the system to:

    1. Identify the time range and the device scope.
    2. Query the alert data.
    3. Classify and aggregate the alerts.
    4. Run additional queries when information is insufficient.
    5. Generate a draft report.
    6. Publish it after human confirmation.

    The model is responsible for understanding, summarizing, and proposing intended actions. Actions such as data queries, permission checks, and file writes should be carried out by deterministic programs. The fact that a model can produce a description of an operation does not mean it has reliably performed that operation.

    Also note that not every application that contains a model needs to be built as an agent. When business steps are fixed and inputs and outputs are well defined, an ordinary workflow is usually easier to test and easier to keep within budget.

    3. Application Frameworks vs. Orchestration Frameworks

    3.1 Application frameworks: lowering the cost of integrating common components

    LLM application frameworks typically provide a set of composable building blocks, such as:

    • Model invocation and message organization.
    • Tool description and wrapping of tool results.
    • Document loading, chunking, and retrieval pipelines.
    • Structured output and result validation.
    • Conversation history and context handling.
    • Call logging, error handling, and extension interfaces.

    Their main value is reducing repetitive integration work so developers can validate a business idea faster.

    Whether a specific framework actually provides these capabilities, and whether they live in the core modules or in extension components, must be confirmed against the actual version and its documentation. Common engineering needs should not be treated as features every framework ships with.

    3.2 Orchestration frameworks: making execution paths and state transitions explicit

    Orchestration frameworks emphasize modeling the task execution process. Common concepts include:

    • Nodes: a model call, a tool execution, data processing, or a human approval.
    • Edges: transition relationships between nodes.
    • State: data that must be retained and passed along during execution.
    • Conditional branching: deciding the next step based on state.
    • Loops: repeatedly executing certain nodes until a stop condition is met.
    • Checkpoints: saving execution state so it can be resumed.

    For instance, an analysis task can be expressed as:

    “receive request → retrieve material → decide whether the material is sufficient → retrieve more or generate a draft → validate the result → output.”

    This turns a complex flow from implicit prompt instructions into a program structure that can be inspected and tested.

    3.3 Orchestration is not the same as multi-agent

    A common misconception is that application frameworks are for building a single agent while orchestration frameworks exist only to connect multiple agents.

    In fact, a single agent may also need complex orchestration. It may call tools repeatedly, wait for approvals, handle exceptions, and resume execution. Conversely, simple collaboration among several roles does not necessarily require a complex graph structure.

    Whether orchestration is needed depends mainly on requirements for state, branching, recovery, and auditing, not on the number of agents.

    4. How to Decide Which Layer to Learn First

    Start from the main difficulty in your project.

    Current need Capability to prioritize
    Quickly build a Q&A or tool-calling prototype Model invocation, tool definition, message handling
    Connect internal documents and business data Retrieval, permission filtering, citations, result validation
    Multi-step decisions and loop execution State design, conditional branching, stop mechanisms
    Tasks that need approval or run over a long period Persistence, pause and resume, human intervention
    Preparing to launch a service Security controls, observability, evaluation, concurrency, failure handling

    If the main difficulty is “how the model calls a business API,” prioritize application-layer components. If the main difficulty is “where the flow has reached and how to continue after a failure,” prioritize orchestration knowledge.

    Even if you choose to adopt an orchestration framework directly, you still need to understand model inputs, tool contracts, and context management. Skipping a framework is fine; skipping these capabilities is not.

    5. First Practical Step: A Minimal Loop Without a Complex Framework

    Beginners should first complete a task with a very small scope, such as “query a certain type of record and generate a summary.” Keep the number of tools to one or two, and leave multi-role collaboration and long-term memory out for now.

    The following is language-agnostic illustrative pseudocode. All functions are custom abstractions and do not correspond to any specific product API:

    1. state = initializeTaskState()
    2. maxSteps = configuredStepLimit
    3. repeat until maxSteps is reached:
    4. decision = requestNextActionFromModel(state)
    5. if decision indicates the task is complete:
    6. validate the final result
    7. return the result
    8. validate tool name, arguments, and access permissions
    9. if the action has external side effects:
    10. run a risk check
    11. wait for human confirmation if necessary
    12. toolResult = execute the permitted tool
    13. write toolResult into state
    14. return "not completed within the limit", with the steps already completed

    What matters in this flow is not the amount of code but the separation of responsibilities:

    • The model proposes intent.
    • The program validates intent.
    • The tool performs the actual operation.
    • The state records the real result.
    • The system decides whether execution may continue.

    You must set an execution limit, a timeout, and termination conditions to avoid infinite loops. Arguments returned by the model must also be validated and must never be used directly for sensitive operations.

    Once this loop works, learning a framework becomes meaningful, because you can see exactly what work the framework is wrapping for you.

    6. State, Memory, and Context: Do Not Conflate Them

    These three concepts are often loosely grouped together as “memory,” but their engineering responsibilities differ.

    6.1 State is the factual record of task execution

    State may include the user’s goal, the current phase, tools already called, tool results, error information, and approval records. It serves flow progression and recovery.

    When designing state, be explicit about which fields the model may suggest changing and which fields only the program may update. For example, “approval granted” must come from a trusted approval event and cannot be filled in by the model itself.

    6.2 Memory is information reusable across tasks

    Long-term memory may store preferences the user has explicitly authorized or business knowledge that has been verified. It requires consideration of expiry, provenance, access permissions, and deletion mechanisms.

    Speculation generated by a model should not be saved as a permanent fact, and user data should not be retained indefinitely.

    6.3 Context is what the model actually sees in this call

    Retaining the full history does not mean the full history should be sent to the model every time. Overly long context can increase cost and can also let irrelevant information interfere with judgment.

    Common approaches include keeping recent interactions, summarizing older records, retrieving relevant fragments, and prioritizing key constraints and reliable evidence. Summaries can also drop details, so important facts should keep a traceable original record.

    7. From Demo to Production: Engineering Capabilities You Must Add

    7.1 Tool safety: treat model output as input to be validated

    Tools should follow the principle of least privilege, with read and write operations separated as much as possible. High-risk actions such as deletion, publishing, payment, or permission changes should require independent validation and, where necessary, human approval.

    External documents, web pages, or tool return values may also contain misleading instructions. The system must distinguish business data from trusted instructions and must never let retrieved content alter the permission policy.

    7.2 Human intervention: more than adding a button

    A reliable approval flow needs to persist the content awaiting approval, identify the approver and the approval scope, and record the approval outcome. When execution resumes, the system must confirm that the action actually performed matches the action that was approved.

    If arguments change after approval, re-confirmation is normally required rather than reusing the old approval.

    7.3 Failure recovery: retry is not the same as re-running every step

    Retrying a query operation is usually straightforward. For operations with external side effects, repeated execution can cause duplicate submissions.

    You therefore need idempotency keys, execution records, and result reconciliation. Saving checkpoints helps recovery but does not automatically guarantee that an external operation will not be repeated. The system must also clearly distinguish “not yet executed,” “executed successfully,” and “execution result unknown.”

    7.4 Observability and evaluation: fluency of the answer is not enough

    Record task phases, tool calls, elapsed time, failure reasons, model usage, and human interventions, with sensitive data masked.

    Evaluation should cover at least:

    • Whether the task was actually completed.
    • Whether tool selection and arguments were correct.
    • Whether the result is backed by reliable evidence.
    • Whether permissions or business constraints were violated.
    • Whether the system can stop safely on failure.
    • Whether time and cost are within expectations.

    For fixed business scenarios, build a repeatable test set instead of judging reliability from a few successful demos.

    Stage 1: Master basic interaction

    Understand model invocation, message structure, tool descriptions, structured result validation, and the uncertainty of model output. The goal is to be able to explain which layer a failed call broke in.

    Stage 2: Complete a single-tool and multi-tool loop

    Start with read-only tools, then add argument validation, exception handling, and stop conditions. Do not pursue complex autonomous planning at this stage.

    Stage 3: Introduce application components as needed

    When repetitive integration work grows noticeably, use a framework to manage models, tools, retrieval, and context. The learning focus is component responsibilities and extension boundaries, not memorizing every API.

    Stage 4: Introduce explicit orchestration

    When tasks require branching, loops, approvals, or recovery, model the flow as nodes, state, and transition rules. For deterministic business steps, prefer explicit rules; involve the model in decisions only where it is genuinely necessary.

    Stage 5: Build production safeguards

    Add permissions, auditing, evaluation, monitoring, version management, and regression testing. Changes to prompts, tool definitions, state structures, or model configuration can all affect behavior and should be placed under change management.

    9. Framework Selection: Focus on Boundaries, Not “Do-Everything”

    Frameworks can shorten prototype development time, but they do not automatically solve business correctness, security, or runtime reliability.

    When evaluating one, check in particular:

    1. Whether it fits the team’s existing technology stack.
    2. Whether state and execution paths are easy to inspect.
    3. Whether it can integrate with existing identity, permission, and audit systems.
    4. Whether automated testing is straightforward.
    5. Whether problems can be localized when something goes wrong.
    6. Whether custom business logic is overly constrained.
    7. Whether core business logic can stay moderately decoupled from the framework.

    Isolating model invocation, tool contracts, and business rules behind internal boundaries lowers the cost of changing frameworks later. That isolation should be designed around real points of change, though; there is no need to build a complex abstraction layer in advance for a hypothetical migration.

    10. Conclusion: What You Really Learn Is Transferable Development Skill

    Learning agent development does not require systematically finishing both application frameworks and orchestration frameworks first, and “using a particular framework” should not be equated with “understanding agent engineering.”

    A more reliable path is: first understand the boundary of responsibility between the model and the program and complete a minimal loop; then learn tools, state, and context management; then introduce orchestration according to task complexity; and finally add security, recovery, evaluation, and observability.

    Frameworks help you get started faster, but system quality is still determined by whether task modeling is sound, whether execution boundaries are clear, whether results are verifiable, and whether failures are handled safely. With these fundamentals in place, you can judge more effectively whether any technical approach suits your current business.