LLM Agents for Quantitative Analysis and Research Report Generation: A Practical Guide

    This article explains why LLM agents should orchestrate tasks rather than compute numbers directly in quantitative analysis and financial research report generation. It covers the shift from single-turn Q&A to multi-step task execution, key capabilities such as automatic task planning, script execution, multi-step retrieval, and document synthesis, a reliable six-step workflow, evaluation observations on numerical drift, and engineering recommendations for building reproducible, auditable analysis systems.

    LLM Agents for Quantitative Analysis and Research Report Generation in Practice

    1. Background: Why “Writing Code” Matters More Than “Giving Answers Directly”

    In scenarios like quantitative analysis, financial research reports, and daily business reports, users often want a large model to do more than understand natural-language requests. They want it to complete an entire data-processing workflow: reading structured tables, computing factors, retrieving news, drawing charts, organizing conclusions, and finally producing a document that combines text and visuals. The important shift in the new generation of LLM agents is the move from “single-turn Q&A” to “multi-step task execution.” An agent can first break down a task, then call scripts, retrieval tools, charting tools, and document-generation tools, and finally aggregate the results.

    But these scenarios demand extremely high numerical precision. Metrics such as inventory quantiles, basis quantiles, returns, volatility, and factor exposures can produce results that look plausible but are not reproducible if the model “computes them in its head” or guesses from context. The reason is straightforward: a large model performs probabilistic generation. It is good at language organization and task orchestration, but not naturally good at strict decimal arithmetic or complex rule-based computation. Letting the model output precise numbers directly is essentially using a probabilistic model to replace a computation engine.

    A more reliable path is to have the agent act as an “orchestrator of the analysis workflow” and a “programmer,” delegating the actual computation to scripts. Scripting languages are deterministic: with the same input and the same logic, the output is the same. Table reading, quantile computation, chart coordinates, and document merging are all handled by code, which significantly reduces the risk of hallucination when processing structured information. The model is responsible for understanding requirements, generating code, checking results, and explaining conclusions—not for replacing a calculator.

    2. Notable Capabilities: From a Task List to a Deliverable Document

    From a practical standpoint, the capabilities of LLM agents in quantitative analysis and report generation worth attention are mainly concentrated in the following areas.

    First, automatic task planning. Facing a compound request like “read the table, compute quantiles, retrieve news, generate a daily report,” an agent can first create a to-do list and break the task into steps such as data reading, metric computation, news retrieval, chart generation, and document composition. The value of a task list is not just that it “looks organized”; more importantly, it makes intermediate results inspectable, interruptible, and re-runnable. Developers can use it to determine whether a failure occurred at the data layer, the computation layer, or the document layer.

    Second, script execution and tool calling. An agent can automatically generate and run scripts to parse tables, call visualization libraries to draw charts, and invoke document-export capabilities to produce reports in a portable document format. The core point here is not “whether the model can draw,” but whether every point in a chart is computed from real data. Script-based charting libraries typically render graphics from data coordinates, offering precision and professionalism clearly higher than pixel images generated probabilistically. For financial research reports, axes, quantile lines, bar comparisons, and annotations must all be traceable.

    Third, multi-step retrieval and context integration. A quantitative daily report often needs to combine market news, factor changes, and a local news repository. Beyond script-based computation, an agent can retrieve local materials by keyword or fetch public information online, then merge news summaries with metric results. It is worth emphasizing that retrieved content is used for explanation and supplementation and should not feed back into numerical computation. Computation stays with computation, and narrative stays with narrative; the two must have a clear boundary.

    Fourth, document synthesis and delivery. An agent can explicitly state in the output requirements “automatically generate figures and merge the daily report content with the figures into a portable document format,” thereby closing the loop from data to document. For enterprise users, this capability reduces repetitive work and frees analysts from formatting tasks—but on the premise that templates, fields, chart specifications, and validation rules are defined in advance.

    A relatively reliable agent analysis pipeline can be broken into six steps:

    1. Requirement parsing: Clarify the data files, field meanings, computation conventions, output format, and acceptance criteria.
    2. Task planning: Generate a to-do list, marking which steps must be executed by scripts and which allow the model to summarize.
    3. Data reading: Scripts read the table files and check field types, missing values, duplicates, and outliers.
    4. Metric computation: Scripts perform calculations such as quantiles, differencing, year-over-year, and period-over-period, and output intermediate result files.
    5. Chart and document generation: Scripts draw charts against a fixed template, the model writes explanatory text, and the two are merged and exported.
    6. Result validation: Recompute key numbers a second time, check whether charts and tables are consistent, and verify that the numbers in the document come from script output.

    This division of labor can be expressed with the following pseudocode:

    1. function build_daily_report(table_path, factor_source):
    2. rows = read_table(table_path)
    3. cleaned = validate_and_clean(rows)
    4. metrics = compute_quantiles(cleaned, fields=["inventory", "basis"])
    5. news = search_local_or_online(keywords = build_keywords(metrics))
    6. charts = render_charts(metrics, logic = factor_source.logic)
    7. report = compose_report(metrics, news, charts)
    8. export_document(report, "daily_report")
    9. return metrics, report

    The point of this pseudocode is not the specific syntax but the boundaries of responsibility: the model can generate it, modify it, and explain it, but the final numbers are produced by deterministic functions like compute_quantiles. As long as the input and the function logic are fixed, the result is reproducible.

    4. Evaluation Observations: Numerical Drift Is a Major Risk for Agent Adoption

    On the same structured dataset, different agent approaches can produce noticeably different outputs for inventory quantiles and basis quantiles. In testing, some approaches showed inventory quantiles varying roughly between 21% and 30%, and basis quantiles varying roughly between 55% and 68%; whereas recomputing with scripts under a fixed convention should yield a single, explainable result. Such differences do not necessarily mean an approach “cannot analyze,” but rather that when a model is allowed to output numbers directly, it may approximate and guess based on training data, context, and language habits instead of strictly following mathematical rules.

    Therefore, when evaluating agents, one should not only look at “whether the report reads well,” but focus on checking:

    • Whether key numbers come from script output rather than the model’s mental math;
    • Whether intermediate results can be exported, re-examined, and re-run;
    • Whether chart coordinates match the table values;
    • Whether the conclusions in the document correspond to the computation results;
    • Whether a failure can be traced to a specific step;
    • Whether fixed templates and field-level validation are supported;
    • Whether tool calls, inputs and outputs, and exception logs are recorded.

    For financial research report scenarios, convention validation should also be added. For example, which interpolation method is used for quantiles, how the sample interval is truncated, and how missing values are handled should all be explicitly defined in scripts. Otherwise, even if the model does not “invent numbers,” different conventions will still cause result differences. The value of an agent lies in solidifying these rules into an executable process, rather than re-explaining them in every conversation.

    5. Engineering Recommendations

    First, write “prohibit the model from computing directly” into the system constraints. The prompt should make clear that all numbers must be computed and returned by scripts, and the model may only cite script output; if a script fails, it should report the failure reason and must not guess the result.

    Second, establish templated output. The sections, chart types, metric names, units, and decimal places of the daily report should be fixed. The more explicit the template, the less room the model has to improvise, and the more stable the results.

    Third, retain intermediate artifacts. Data-cleaning results, metric tables, chart files, news summaries, and the final document should all be persisted to disk for auditing and review. For cloud environments, artifacts can be stored with object storage, the call chain can be recorded with logging services, and task failures can be detected with monitoring and alerting.

    Fourth, distinguish “generated images” from “data charts.” Data charts must be rendered by scripts from the numbers; probabilistically generated images are suitable for illustration but not as report figures. Enterprises should explicitly prohibit replacing data charts with generative images in their specifications.

    Fifth, set up secondary validation. Another script or a rules engine can sample and recompute key metrics, or the model can act only as an “explainer” that summarizes script output in natural language without being allowed to alter the numbers.

    6. Conclusion

    The real highlight of LLM agents in quantitative analysis and financial research report generation is not “writing a paragraph for someone,” but chaining task planning, script execution, data retrieval, chart drawing, and document synthesis into an executable pipeline. In terms of user experience, it can indeed significantly improve efficiency from data to report, but on the premise that developers understand the boundaries clearly: the model is good at understanding intent and organizing workflows, while scripts are good at precise computation and stable reproduction. Only by letting the agent orchestrate and deterministic tools compute can probabilistic hallucinations be kept away from key numbers, and a truly deployable, auditable, and reproducible analysis system be built.