# Same Model, Four Agents: A Deep Dive into Agent Framework Architectures

    This article explains why the same large language model behaves differently depending on the agent framework around it. It breaks down the concept of the agent harness—the runtime structure that handles prompting, tool execution, state, memory, safety, and recovery—then analyzes four representative architecture styles: minimal kernel, shared service, skill-and-memory, and multi-channel access. It concludes with the six key variables that drive behavioral differences and practical guidance for framework selection and evaluation.

    1. The Starting Question: Same Model, Different Agents

    Put the same large language model into different agent frameworks, and what you get is rarely “the same assistant with a different skin.” Instead, you get four systems with different behavior patterns, capability boundaries, and engineering complexity. The reason is not mysterious: an LLM itself only does token-in, token-out. It has no native ability to execute tools, does not automatically persist session state, and does not proactively respect permission boundaries. What organizes these capabilities is the entire runtime structure around the model—commonly called the agent harness.

    A simple formula captures this:

    Agent = model weights + harness

    The model handles reasoning and generation; the harness connects prompting, tools, memory, sessions, safety guardrails, output parsing, and error recovery. The model is stateless—the harness determines “what the model can see, what it can do, and what remains after it acts.” Consequently, when the same model runs in different harnesses, prompt organization, tool granularity, loop-control strategy, context-trimming rules, and failure-retry mechanisms all differ—and so does the resulting behavior.

    This article examines four representative framework design orientations. To avoid getting bogged down in product comparisons, we abstract them as the “minimal kernel,” “shared service,” “skill-and-memory,” and “multi-channel access” styles. The point is not to memorize framework names, but to understand how differences emerge once the same model is wrapped in different harnesses.

    2. What Exactly Is a Harness: Everything Around the Model

    When developers first encounter agent frameworks, they often focus on model selection, assuming a bigger model will solve everything. The model matters, but the harness often influences the final result just as much. A well-designed harness lets a mid-sized model reliably complete multi-step tasks; a poorly designed one can make even a strong model drift off course repeatedly.

    From an engineering perspective, a harness includes at least these layers:

    1. Prompt assembly layer: Combines system instructions, user input, message history, tool descriptions, retrieval results, and memory fragments into the context the model consumes.
    2. Tool execution layer: Defines tool schemas, parses tool-call requests from model output, executes the actual actions, and feeds results back to the model.
    3. Session and state layer: Persists conversation history, task progress, intermediate artifacts, and cross-turn state; decides what enters the next round of context.
    4. Memory and skill layer: Retains long-lived information, retrieves and injects it at the right moment, or consolidates successful experience into reusable workflows.
    5. Security and permission layer: Restricts tool scope, file access, network access, and sensitive operations; sets human confirmation points.
    6. Observability and recovery layer: Records call chains, token consumption, tool results, and errors; supports retry, rollback, and interruption recovery.
    7. Access adaptation layer: Converts different clients, messaging channels, or API requests into unified internal events.

    A minimal agent loop can be abstracted as:

    1. while not done:
    2. context = build_context(system, history, memory, tools)
    3. output = model.generate(context)
    4. action = parse_action(output)
    5. if action.type == "tool_call":
    6. result = execute_tool(action.name, action.args)
    7. history.append(tool_result(result))
    8. elif action.type == "final":
    9. return action.content

    This pseudocode looks simple, but every function hides major design decisions. build_context determines how context is trimmed, execute_tool determines permissions and error handling, parse_action determines output-format stability, and the loop’s termination condition determines whether the agent gets stuck in useless tool calls. The differences among the four framework styles are, at their core, different combinations of these decisions.

    3. From Teaching-Grade Minimal Kernels to Production Frameworks: Why the Code Size Gap Is So Large

    To understand agent architectures, start with a teaching-grade minimal framework. It typically keeps only the core reasoning loop, a few tools, and simple session logging, so a reader can grasp the essentials of a harness within a single article or book chapter. Its value is transparency: no complex abstractions—the model’s inputs and outputs, tool calls, and loop termination are all clearly visible.

    Production frameworks are far larger—not because the code is gratuitously complex, but because they must handle real-world engineering problems:

    • Safety guardrails: tool whitelists, parameter validation, sensitive-path restrictions, human approval, injection-attack protection.
    • Cross-session state: session resume, task continuation, multi-user isolation, concurrency control.
    • Complex memory systems: short-term context, long-term memory, retrieval ranking, expiry cleanup, conflict handling.
    • Multi-client access: protocol conversion and state synchronization across CLI, IDE, web, and messaging channels.
    • Observability: logging, metrics, tracing, auditing, cost accounting.
    • Error recovery: tool timeouts, malformed model output, retry and compensation after partial failures.

    So evaluating a framework means looking not at “how many lines the core loop has,” but at which production problems it solves out of the box versus which it leaves to the application layer. Teaching-grade frameworks are great for understanding principles and lightweight embedding; production frameworks suit multi-user, multi-session, and complex-permission scenarios, at the cost of higher learning and operational overhead.

    4. Deep Dive into the Four Architecture Styles

    1. Minimal Kernel: Small Core, Explicit Loop, Control First

    The minimal-kernel philosophy is “keep the agent loop small and make the extension points clear.” It typically provides only prompt assembly, tool registration, model invocation, and basic session management—no built-in complex memory, multi-channel access, or heavyweight permission systems. The advantages are transparent behavior, easy debugging, and easy embedding into existing applications; the drawback is that you must build many production capabilities yourself.

    This style suits scenarios where you need full control over agent behavior, want to embed the agent into an existing backend service, have short task chains, and have a team capable of building observability and security on its own. The key design point is whether the extension interfaces are stable. For example, tool registration should keep a unified schema, model adapters should isolate vendor differences, and loop control should allow the upper layer to set maximum steps, timeouts, and termination conditions.

    Minimal does not mean crude. A good minimal kernel makes “context assembly” and “tool execution” replaceable modules rather than scattering that logic across the loop. Otherwise, every attempt to add memory or permissions forces edits to the core loop, and the simplicity advantage is lost.

    2. Shared Service: One Runtime, Many Clients

    The defining trait of the shared-service style is a centrally deployed agent runtime, with multiple clients connecting through a unified protocol. Clients can be CLIs, editor plugins, web pages, or internal tools. The server handles session management, tool execution, model invocation, and state persistence; clients handle only interaction and display.

    This architecture addresses multi-client consistency. A task started in one client can continue in another; tool execution and permission control live on the server, so clients don’t reimplement them; model keys and sensitive configuration never need to be distributed to clients. But shared services introduce new engineering challenges:

    • Session isolation: Sessions of different users and projects must be strictly separated to prevent context cross-talk.
    • Concurrency and queuing: Multiple requests to the same session must be serialized or locked to prevent interleaved tool calls.
    • Streaming output: The server must stably push incremental model output, tool progress, and final results to clients.
    • Idempotency and recovery: After a client disconnects and reconnects, it must be able to resume task state or terminate safely.
    • Permission propagation: The server must know which user a request represents and which tool permissions that user holds.

    A simplified server interface can be abstracted as:

    1. interface AgentSession {
    2. create(userId: string, projectId: string): SessionId;
    3. append(sessionId: SessionId, event: UserEvent): AsyncStream<AgentEvent>;
    4. cancel(sessionId: SessionId): void;
    5. snapshot(sessionId: SessionId): SessionState;
    6. }

    The shared-service style suits organizations that need multi-client collaboration, centralized governance, and unified auditing. When evaluating candidates, focus on session isolation, concurrency control, disconnect recovery, and the permission model—not on how polished the client UI is.

    3. Skill and Memory: Consolidating Successful Experience Back into the System

    The distinctive feature of this style is that the agent not only completes the current task but also saves effective methods discovered along the way as reusable skills or memories. When a similar task appears next time, the system can retrieve the relevant experience, inject it into context, or directly invoke an already-consolidated skill workflow.

    This design pays off for repetitive work. For fixed-format data processing, routine troubleshooting, or document-generation standards, having the model reason from scratch every time is costly and unstable; consolidating successful steps into skills improves both consistency and efficiency. But “the more memory, the better” is wrong—memory requires a governance mechanism:

    1. Write criteria: Which experience is worth saving? Write after one success, or only after multiple validations?
    2. Structured representation: A skill should include applicability conditions, steps, tool dependencies, parameter descriptions, and failure cases.
    3. Retrieval and injection: Retrieve by task similarity, project scope, and timeliness to avoid polluting context with irrelevant memory.
    4. Versioning and rollback: Skills go stale; they need version management and deprecation mechanisms.
    5. Evaluation and auditing: Does memory actually improve success rates? Does it introduce wrong preferences?
    6. Permissions and privacy: Memory must not contain data beyond the user’s authority or sensitive information.

    An abstract skill entry might look like:

    1. {
    2. "name": "monthly_report_cleanup",
    3. "when": "Input is a monthly report containing missing fields",
    4. "steps": ["validate fields", "normalize date format", "generate missing-item list"],
    5. "tools": ["table_reader", "validator"],
    6. "version": 3,
    7. "approved": true
    8. }

    The hard part of skill memory is not storage but “when to trust memory.” Production systems should bring both memory writes and memory usage into observable, approvable workflows, preventing the model from cementing accidental successes into flawed norms.

    4. Multi-Channel Access: An Adapter Layer to Mask Channel Differences

    The goal of the multi-channel style is to let the same agent capability serve multiple messaging channels or interaction endpoints simultaneously. Channels differ widely in message format, rich-text capability, rate limits, callback mechanisms, and identity systems. If each channel implements its own agent logic, maintenance costs explode.

    The sound approach is an adapter layer: convert each channel’s inbound messages into unified internal events, and convert agent output into formats each channel can display. The core agent handles only unified events, agnostic to their origin. An abstract interface might be:

    1. class ChannelAdapter:
    2. def parse_inbound(self, raw) -> UnifiedEvent: ...
    3. def format_outbound(self, event) -> ChannelMessage: ...
    4. def identify_user(self, raw) -> UserIdentity: ...
    5. def ack(self, raw) -> None: ...

    Key engineering concerns for multi-channel access include message deduplication, user identity mapping, channel rate limiting, async notification for long tasks, rich-text degradation, attachment security scanning, and audit trails. Note especially: the more channels, the larger the attack surface. The adapter layer must uniformly enforce input validation, permission checks, and sensitive-operation confirmation—never loosen security because a channel “looks internal.”

    5. Where the Differences Come From: Six Key Variables

    In summary, the same model behaves differently across frameworks mainly due to six variables:

    1. Prompt organization: strictness of system instructions, detail of tool descriptions, history-trimming strategy.
    2. Tool granularity: few coarse tools vs. many fine ones; strictness of parameter validation; whether error messages are model-readable.
    3. Loop control: maximum steps, timeouts, termination conditions, whether parallel tool calls are allowed.
    4. Context management: memory injection volume, retrieval ranking, summarization and compression, handling of conflicting information.
    5. Error recovery: on tool failure—retry, switch tools, or escalate to a human; how malformed model output gets repaired.
    6. Security boundary: which tools run automatically and which require confirmation; how files, network, and sensitive data are isolated.

    Together, these six variables form the harness’s “behavioral fingerprint.” When evaluating frameworks, design benchmark tasks for each variable: multi-step tool calling, long-context memory, erroneous tool parameters, out-of-boundary permission requests, disconnect recovery, and multi-client concurrency. Only by comparing architectures on the same set of tasks can you see real architectural differences instead of being misled by demos.

    6. Selection Advice: Clarify Constraints Before Discussing Frameworks

    When choosing an agent framework, work through your requirements in this order:

    • Deployment form: embedded single-machine, centralized service, or multi-client collaboration? For centralized services, scrutinize session isolation and concurrency control first.
    • Task complexity: minimal kernels fit short task chains; long chains demand stronger state recovery and observability.
    • Memory needs: Do you need experience that persists across sessions? If so, evaluate skill write approval, retrieval quality, and version governance first.
    • Number of channels: For multi-channel access, prefer solutions with clean adapter boundaries, complete identity mapping, and rate-limiting mechanisms.
    • Security level: When files, networks, databases, or production operations are involved, you must check tool whitelists, human confirmation, and audit logs.
    • Team capability: Minimal frameworks offer freedom but high build cost; production frameworks have built-in capabilities but higher learning and customization costs.
    • Observability: Can you trace every model call, tool execution, context change, and cost?

    A practical principle: don’t start with the “most feature-rich” framework—start with the scenario whose constraints are clearest. Get one minimal task chain working end to end, then add memory, channels, and permissions incrementally. Each new capability layer must be matched with corresponding evaluation and monitoring.

    7. Engineering Practice: Decompose with Architecture Diagrams, Not Just Documentation

    The source material for this analysis relied heavily on architecture diagrams to decompose frameworks—an effective method, because agent-system complexity often hides in call chains and state flows. When reading source code or evaluating a framework, fix on these observation points:

    1. The complete path from user input to model invocation;
    2. The path of tool registration, parsing, execution, and result feedback;
    3. Where session state is stored and its lifecycle;
    4. The trigger conditions for memory writes and retrieval;
    5. Which layer performs permission checks;
    6. How errors and interruptions are recovered;
    7. How multiple clients or channels converge into unified events.

    Also note that frameworks iterate quickly. For technical evaluations, pin a code version or snapshot and record the evaluation date and key commits, so conclusions don’t drift with versions. For abstract analyses like this one, strip out specific version information and keep only the architectural patterns, so the findings remain reusable over time.

    Conclusion

    The same LLM placed into different agent frameworks yields different systems shaped by different harnesses. The minimal-kernel style emphasizes transparency and control; the shared-service style emphasizes multi-client consistency and centralized governance; the skill-and-memory style emphasizes experience consolidation and reuse; the multi-channel style emphasizes adapter boundaries and unified events. None is absolutely better or worse—only more or less matched to your scenario’s constraints.

    Truly professional framework selection means not comparing demo effects, but opening up the harness to examine prompt organization, tool execution, state management, safety guardrails, and observability. Map these underlying mechanisms clearly and test them rigorously—that is how the same model delivers stable value in the right framework.