How to Evaluate and Select LLM Agents: A Five-Stage Testing Framework

    Choosing the right LLM for an AI agent requires more than comparing benchmark scores. This article presents a controlled evaluation method that fixes memory, skills, system constraints, tools, and runtime conditions so that only the underlying model changes. It defines five progressive test stages—skill packaging, front-end page development, presentation and copywriting, knowledge base governance, and browser automation—along with a four-dimension scoring rubric covering task completion, protocol compliance, stability, and cost efficiency. Readers will learn common failure modes at each stage, how to measure cost per task instead of relying on price lists, and practical engineering recommendations for placing high-cost models in short, high-value interactions while keeping stable, low-cost models in the main loop.

    1. Background: Why a Model-Only Comparison Matters

    In real-world agent engineering, the model is never an isolated variable. Memory strategies, skill loading mechanisms, system prompt constraints, tool registration, and permission boundaries all have a significant impact on final performance. If these variables change at the same time, the resulting conclusions cannot be attributed to any single factor. A credible horizontal comparison must therefore keep everything except the model fixed: the same memory content and retrieval strategy, the same skill set and loading order, the same system-level constraints, and the same tool-calling capabilities in both scope and quantity. Only the underlying inference model is swapped, and all runs use the same tasks, the same inputs, and the same evaluation criteria.

    Several types of feedback from hands-on practice illustrate why this kind of evaluation is necessary. Some models fail to reliably recognize locally defined skills within an agent framework. Some skip the confirmation step before executing high-risk actions. Some consume significantly more tokens on the same task. Others burn through their quota extremely fast, with a short coding task eating up most of the allowance. None of this information is reflected in leaderboard scores; it can only be observed inside a real framework.

    It is worth noting that a high-cost, quota-limited model is not necessarily unsuitable for agents. It is simply unsuitable for the always-online main loop. It is better suited to short, high-value scenarios such as interactive design and solution exploration. The essence of model selection is matching, not ranking.

    2. Evaluation Design: Controlled Variables, Task Tiers, and Scoring Criteria

    2.1 Controlled Variable Checklist

    • Memory: identical entries, identical write and eviction policies, identical retrieval Top-K.
    • Skills: identical skill packages, identical metadata, identical trigger descriptions.
    • System constraints: identical role settings, output formats, and confirmation policies for dangerous actions.
    • Tools: identical tool names, identical parameter schemas, identical timeouts and retries.
    • Runtime environment: identical working directories, identical dependency versions, identical network conditions.
    • Reasoning tier: select the highest available reasoning tier consistently where options exist, and record what actually took effect.

    2.2 Task Tiers: Five Progressive Stages

    Stage one is capability packaging. A long design specification prompt must be turned into a publishable, installable skill package that can be triggered automatically, with a self-check that outputs potential failure points. This stage tests the ability to turn experience into reusable assets, not the ability to copy text.

    Stage two is page development. Given interaction and visual constraints, the model must produce a runnable front-end page, testing structural completeness, state handling, and accessibility.

    Stage three is presentation and copywriting. The same source material must be converted into a clearly structured presentation outline with accompanying copy, testing information compression and hierarchical organization.

    Stage four is knowledge base governance. A batch of mixed documents must be deduplicated, classified, chunked, and given indexing recommendations, testing trade-offs and consistency in long contexts.

    Stage five is browser automation. Multi-step operations, cross-page navigation, waiting, and backtracking make this the high-pressure zone for token consumption and failure rates.

    2.3 Scoring Criteria

    A four-dimension score is recommended: task completion (whether the goal was genuinely achieved), protocol compliance (format, tool calls, confirmation policy), stability (variance across multiple runs), and cost efficiency (token and quota consumption, cost per task). Each dimension has a veto item. For example, failing to recognize a skill definition, executing a dangerous action without confirmation, or producing output that does not run results in an automatic fail.

    An illustrative scoring table structure:

    1. Task Completion Protocol Stability Cost Verdict
    2. Capability pack 0-5 0-5 Variance Cost per task Pass/Fail
    3. Page development 0-5 0-5 Variance Cost per task Pass/Fail
    4. Presentation copy 0-5 0-5 Variance Cost per task Pass/Fail
    5. Knowledge base 0-5 0-5 Variance Cost per task Pass/Fail
    6. Browser automation 0-5 0-5 Variance Cost per task Pass/Fail

    3. The Five Stages in Detail and Common Failure Modes

    Stage One: Packaging a Prompt into a Publishable Skill

    The requirement is not to restate the original text but to abstract trigger conditions, input/output contracts, boundaries, and failure handling. A passing output should include skill metadata, a trigger description, a parameter schema, execution steps, and a self-check list. Common failures include missing metadata that prevents the skill from being retrieved, overly broad trigger descriptions that cause false triggers, and no fallback path for failures.

    A reusable skill skeleton example:

    1. name: design-spec-pack
    2. description: Use when the user asks to organize a design specification into a reusable capability package
    3. inputs:
    4. source_path: string
    5. target_format: [yaml, markdown]
    6. steps:
    7. - Read and extract constraint items
    8. - Consolidate into trigger conditions / output contract / boundaries
    9. - Generate the skill package and run a self-check
    10. guardrails:
    11. - Confirm before overwriting files
    12. - Do not output unverified interface names

    Stage Two: Page Development

    The focus is whether the model can deliver a runnable structure in one pass and handle empty, error, and loading states. Typical failures include providing visuals without states, interactions that depend on nonexistent APIs, and styles tightly coupled with structure, making maintenance difficult.

    Stage Three: Presentation and Copywriting

    This stage tests the ability to compress long material into expression that leads with conclusions and has clear hierarchy. Failure modes include moving content over paragraph by paragraph, muddled hierarchy, and no adaptation to the audience.

    Stage Four: Knowledge Base Governance

    This stage tests trade-offs in long contexts: deduplication, classification, chunk granularity, and index field recommendations. Failure modes include duplicate ingestion, chunks that are too large and introduce retrieval noise, and inconsistent classification standards.

    Stage Five: Browser Automation

    This is the stress test for cost and stability. Observe whether the model has step planning, waiting strategies, failure fallback, and an awareness of minimal necessary operations. Failure modes include ineffective repeated clicks, timing errors caused by missing waits, and absent logs that make post-mortems difficult.

    4. Cost Observation and Engineering Recommendations

    Do not make decisions from a single price table. Instead, record the cost per task: total tokens consumed, number of tool calls, number of retries, and elapsed time. Set a budget cap for each stage, and terminate and flag any run that exceeds it, so that an individual task cannot drain the overall quota.

    Four recommendations are practical to implement. First, enforce mandatory confirmation and whitelists for dangerous actions. Second, make skill and tool descriptions precise to reduce false triggers. Third, add logs and snapshots for long-running flows to support post-mortems. Fourth, place high-cost models in short, high-value steps and stable, low-cost models in the always-online main loop.

    5. Conclusion

    The reliable path to agent selection is controlled variables, tiered tasks, explicit veto items, and quantified cost. The five progressive stages cover five key dimensions: capability packaging, generation quality, information organization, long-context governance, and process stability. The final choice should follow the scenario: an always-online main loop prioritizes stability and cost efficiency, while short, high-value steps can tolerate a higher unit price. If general capabilities such as model services, container platforms, logging services, and monitoring alerts are already available on Baidu AI Cloud, the evaluation process above can be turned into a routine regression, so decisions are made with data rather than impressions.