Million-Token Context and Long-Running Agents: Capabilities, Limits, and Cost

    Million-token context windows can reduce reliance on RAG for some tasks, but they do not eliminate the need for retrieval, external data management, or careful cost controls. This article examines where long-context models and autonomous agents work well, how to manage tool-use and financial workflows, how to interpret vendor-reported safety and hallucination metrics, and how caching affects per-request costs. It concludes with a practical checklist for evaluating these capabilities with your own workloads.

    Can a Million-Token Context Replace RAG?

    A million-token context window can reduce reliance on retrieval-augmented generation (RAG) in some scenarios, particularly when the codebase is relatively small, the documentation is well structured, and the task requires a holistic understanding of the available material. However, it cannot fully replace RAG.

    There are three main reasons:

    1. As the context becomes longer, the model’s ability to reliably retrieve information from the middle of the input requires separate validation.
    2. Knowledge updates, freshness, and access control still need to be managed by an external data layer.
    3. Loading a large volume of content into every request increases latency and cost.

    In practice, teams can first place all relevant materials in the context window as a baseline, then compare that approach with a RAG implementation using accuracy, latency, and per-request cost as evaluation criteria.

    What Long-Running Agents Can and Cannot Do

    A long-running agent is a model that can independently plan, execute, verify, and correct its actions across a multi-step task. Examples include configuring an environment, installing dependencies, writing code, and running tests.

    Vendors have reported clear progress on some terminal-task benchmarks. However, when the benchmark name, model version, and evaluation date cannot be verified, specific scores should not be cited. The most reliable way to determine whether a model fits a particular workflow is to run it against an internal task set and record:

    • Completion rate
    • Number of human interventions
    • Steps that produced errors
    • Total execution time

    Key risks include accidentally deleting files, executing unauthorized commands, and repeatedly failing in a loop while consuming large amounts of tokens. Before deployment, organizations should provide a sandbox environment, define a permissions allowlist, set a maximum number of execution steps, and require human confirmation for critical operations.

    How to Implement Tool Calling

    The effectiveness of external tool use depends on the clarity of the interface documentation, the accuracy of tool descriptions, and the structure of returned results.

    For example, when working with graphics software, a model may generate control scripts from natural-language instructions. Those scripts still need to be tested against parameter limits and software-version compatibility in a controlled environment.

    A claim that a system achieved a “combined score above 92%” should not be used as a selection criterion when the benchmark definition and scoring methodology are unavailable.

    What Financial Workflows Require

    In financial modeling, report parsing, and first drafts of research reports, models can reduce a significant amount of repetitive organization work. Financial content demands a high level of numerical accuracy, so every output should undergo human review, especially amounts, dates, accounting conventions, and cited sources.

    A practical way to handle model output is to divide it into three categories:

    1. Formatted content that can be used directly
    2. Numbers and conclusions that require verification
    3. Investment recommendations or other judgments that must be made by qualified professionals

    A reported score of “approximately 64” is likewise unsuitable for model selection when the evaluation name and sample details are not provided.

    How to Interpret Vendor-Reported Hallucination and Safety Data

    Vendors often publish statistics showing lower hallucination rates or changes in capability resulting from safety filters. These figures can be useful, but they should be evaluated against three questions:

    • Is the result based on a public benchmark?
    • Does the test set resemble everyday production tasks?
    • Are there trade-offs in other capabilities?

    Safety filters may reduce the pass rate for some coding tasks while lowering the risk that a model will be used to generate malicious code. Enterprises should have compliance and business teams evaluate this trade-off together rather than relying on a single score.

    Common methods for reducing hallucinations include requiring the model to cite the relevant source passage, performing a second verification of critical facts, and allowing the model to respond that it cannot confirm an answer when it is uncertain.

    Cost Estimation: Pricing and Caching Strategies

    The following table reproduces example prices provided in the source material. The source does not specify whether the figures include taxes, which regions they apply to, or how long they remain valid. Actual prices should be confirmed on the provider’s official pricing page.

    Model Type Base Input (CNY per Million Tokens) Base Output (CNY per Million Tokens) Cache Hit (CNY per Million Tokens) Short-Term Cache Write (CNY per Million Tokens) Long-Term Cache Write (CNY per Million Tokens)
    Standard large model 13.00 68.00 1.30 13.00 26.00
    High-speed large model 26.00 136.00 1.30 26.00 52.00

    A cache hit means that the request prefix exactly matches content already stored in the cache, allowing the lower cache-hit rate to apply. Even a one-character difference in the prefix prevents a hit.

    A cache write is the charge incurred when content is stored for the first time. The difference between short-term and long-term writes is the retention period, with long-term storage carrying a higher write price.

    The source material states that the high-speed version is approximately twice as fast as the standard version and costs roughly twice as much. This makes it more suitable for latency-sensitive interactive scenarios.

    Per-request cost can be estimated in three steps:

    1. Measure the length of the fixed prefix in each request, such as the system prompt and codebase.
    2. Estimate how many times the same prefix will be reused during the cache validity period, or estimate the cache hit rate.
    3. Calculate the total as the cost of the fixed prefix plus variable input costs plus output costs.

    For example, consider the standard model with a fixed prefix of 0.5 million tokens per request. If the prefix is cached, the input cost for that prefix is approximately CNY 0.65:

    0.5 × 1.30 = 0.65

    If the prefix is not cached, it is charged at the base input rate, or approximately CNY 6.50:

    0.5 × 13.00 = 6.50

    The difference is tenfold, making the cache hit rate a critical variable in cost estimation.

    Pre-Selection Checklist

    1. Does the task genuinely require more than one million tokens of context, or would RAG combined with a shorter context be sufficient?
    2. Is there a reproducible internal evaluation set for comparing different models?
    3. Can per-request cost and cache hit rate be estimated, and can the request prefix remain stable?
    4. Are tool permissions configured according to the principle of least privilege?
    5. Is there a clearly defined human review step before outputs enter a business workflow?

    Large-scale models have expanded what is possible in long-context and agent-based workflows. However, their capabilities, costs, and risks must be validated with the organization’s own data. Starting with a small set of tasks and scaling investment only after the results are clear is usually the more reliable approach.