Why the Same LLM API Performs Differently in Different Tools: Understanding LLM, Agent, Prompt, Context, RAG, and Harness

    Many developers notice that the same LLM API behaves very differently across tools—one gives mediocre answers while another seems far smarter. This article explains why: the model sets the capability ceiling, but the engineering harness determines how much of it is actually realized. It covers the nature and three inherent limitations of LLMs, breaks down the four key components of a harness—Prompt, Context, RAG, and Tools—explains how these components come together to form an Agent, and offers practical guidance for teams building AI applications.

    Why the Same LLM API Performs Differently in Different Tools?

    A Common Confusion

    Many developers have run into this situation: you connect the same LLM API, ask a question in Tool A and get a mediocre or even irrelevant answer; then you switch to Tool B, ask the same question, and suddenly the model “gets it”—it proactively clarifies requirements, calls search, and reasons step by step, as if it were a completely different model.

    The model didn’t change, so why did the results? The answer can be summed up in a popular industry saying:

    The model determines the capability ceiling; the harness determines how much of that capability actually gets used.

    Some express it as an even simpler formula: Agent = LLM + Harness. The LLM is the engine; the Harness is the rest of the car—no matter how powerful the engine, a car with a poor chassis, transmission, or fuel system won’t go fast.

    Understanding the Engine: What an LLM Really Is and Its Three Inherent Limitations

    To understand why the Harness matters, you first need to see what an LLM actually is.

    1. The Nature of an LLM: A Text Completion Program

    A large language model (such as mainstream open-source or commercial models) is essentially a program that has “read” massive amounts of text. It does only one thing: given the text you provide, it predicts the most likely next text, continuing token by token.

    From an engineering perspective, the API is extremely simple:

    1. Input: a piece of text (Prompt / Context)
    2. Output: a piece of text (Completion)

    Text in, text out—nothing more. There is no magic.

    2. Three Inherent Limitations

    Simple as it sounds, this “completion” mechanism leaves LLMs with three inherent flaws. Nearly every concept covered later exists to patch them:

    Inherent Limitation Plain Explanation What Patches It
    No memory Every call starts from amnesia; without resending the history, it remembers nothing Context, Memory
    Limited knowledge It only knows what it learned during training—nothing about your private documents or recent events RAG, web search
    Can only talk, not act It can only output text; it cannot read files, call APIs, or run code Tools, Agents

    Note the third point: an LLM cannot even verify whether what it says is correct—its output is essentially “text that probabilistically looks like an answer,” not “verified fact.”

    The Four Components of a Harness

    The Harness (engineering shell) is the umbrella term for all the engineering infrastructure built around the LLM. Prompts, Context, RAG, and Tools are all components in its toolbox.

    1. Prompt: How the Instructions Are Written

    A Prompt is the instruction text sent to the model, including the task description, output format requirements, and role settings. With the same model, a well-written Prompt versus a poorly written one can produce output that differs in quality by several times. A good Harness quietly assembles a well-structured system prompt behind the scenes, injects tool usage guidelines, and constrains output to structured formats like JSON—the few words you type into the chat box are only a small part of the full Prompt.

    2. Context: How Much “Working Memory” It Gets

    Since the model has no persistent memory, the Harness must reassemble the full context with every request: system instructions + conversation history + tool results + the user’s current input.

    1. [Final content sent to the model]
    2. System Prompt (role, rules, tool descriptions)
    3. + Conversation history summary
    4. + Relevant retrieved chunks (RAG)
    5. + Current user input

    This raises two key engineering problems:

    • Limited window: the context length has an upper bound; when history grows too long, it must be truncated or summarized;
    • Content selection: what to include and what to leave out directly determines model performance. The difference between two tools often comes down to their context management strategies.

    3. RAG: Giving It an External Knowledge Base

    Retrieval-Augmented Generation (RAG) can be summarized as a two-step process:

    1. Retrieve: convert the user’s question into a vector and find the most relevant document chunks in a knowledge base (typically relying on a vector database or vector search capabilities);
    2. Generate: insert the chunks into the context so the model answers “while looking at the material.”

    RAG patches the “limited knowledge” flaw: internal enterprise documents, recent news, and private data can all be injected in real time via retrieval, without retraining the model. When building RAG applications, document chunking granularity, vector search recall quality, and reranking strategies are all decisive factors for effectiveness—this is also Harness-level engineering work.

    4. Tools: From “Talking” to “Doing”

    If you simply give the model a description of a “calculator tool,” then when it needs to compute something, it doesn’t execute the calculation—it outputs specially formatted text (such as JSON):

    1. { "tool": "calculator", "args": { "expression": "123 * 456" } }

    What actually executes this call is the Harness. It parses the model output, runs the tool, and sends the result back to the model, looping as needed. This is the essence of Function Calling / Tool Use: the model only decides what to do; the Harness actually does it.

    Agent: A System Assembled from Components

    When the Harness assembles these components and adds looping and planning capabilities—allowing the model to repeatedly “think → call a tool → observe the result → think again”—you get an Agent.

    A typical Agent execution loop:

    1. while task not complete:
    2. Based on the current context, the model decides to:
    3. a) Answer directly → end
    4. b) Call a tool → the Harness executes it and appends the result to the context
    5. c) Request more information → trigger retrieval and append the result to the context

    Look closely and you’ll see: an Agent doesn’t add any “intelligence” to the model—it simply places the model’s judgment inside a feedback loop. The model makes decisions; the Harness handles execution, memory, and error correction.

    Back to the Original Question: Why Different Shells Produce Different Results

    Now the answer is clear. The same model API performs differently across tools because of what the Harness does (or fails to do) along these dimensions:

    1. Prompt quality: whether carefully designed system prompts and output specifications are injected;
    2. Context management: how history is compressed, how tool results are truncated, and what information is kept or dropped;
    3. Tool configuration: which tools the model is given, how clearly they are described, and how errors are handled;
    4. Retrieval capabilities: whether there are external information sources such as knowledge base retrieval or web search;
    5. Looping and planning strategies: whether the model is allowed to iterate over multiple rounds, and whether retries and self-correction mechanisms exist for failures.

    In other words, you are not comparing models—you are comparing two engineering systems.

    Practical Recommendations

    For teams preparing to build AI applications, remember three principles:

    • Don’t rely on a single model call: model capability is fully realized only through the coordination of Context management, RAG, and Tools;
    • Hand the deterministic parts to engineering: format validation, parameter assembly, and result filtering are more reliable in code than in the model;
    • Evaluate systematically: use a fixed test question set to compare the effects of different Harness strategies (changing Prompts, changing retrieval, adding tools), rather than judging whether the model “got smarter” based on subjective impressions.

    When choosing cloud capabilities, pay attention to the supporting infrastructure beyond model services: vector search, object storage, logging and monitoring, elastic scaling, and so on form the engineering foundation of the Harness. A mature solution should let developers focus on orchestration and user experience instead of repeatedly reinventing the wheel.

    Conclusion

    The model sets the ceiling; the Harness sets the floor and determines how much capability is realized. Understand the “text in, text out” nature of the API, and the patching logic for memory, knowledge, and action, and you can see through appearances to the essence: when “switching tools makes the model smarter,” it’s really the engineering shell doing a great deal of work the model cannot do itself. Building AI applications means half the work is on the model—and the other half is all in the Harness.