AI Agent-Assisted Financial Research Report Generation: Capability Boundaries and Engineering Practices
AI agents can streamline financial research by connecting data ingestion, information retrieval, deterministic calculations, chart generation, and narrative writing. However, large language models remain unreliable for precise numerical computation, while generated charts may lack professional accuracy and editability. This article explains the capability boundaries of AI agents and presents an engineering approach that assigns language tasks to models and numerical, visualization, validation, security, and cost-control tasks to deterministic software.
1. Background
Financial research reports typically involve four types of work: reading structured data, retrieving recent information, calculating metrics, and creating charts before writing conclusions. An AI agent can connect these steps into an automated workflow, reducing the time analysts spend switching between multiple tools.
In practice, output quality is often limited by two issues. First, language models are not reliable at handling precise numerical calculations. Second, generated charts may lack the professionalism and editability required for formal research. This article examines both problems from an engineering perspective and proposes a practical division of responsibilities.
2. A Typical AI Agent Workflow for Financial Research
A complete report-generation pipeline can be divided into five steps:
- Data ingestion: Read local spreadsheets or database exports and identify headers, units, and time series.
- Information retrieval: Obtain recent news, announcements, and industry developments related to the subject from authorized information sources.
- Metric calculation: Calculate statistics such as percentiles, year-over-year and period-over-period changes, means, and variances.
- Chart generation: Convert calculation results into trend, distribution, or comparison charts.
- Narrative composition: Write conclusions around the metrics and retrieved information, while citing data sources.
The main value of an AI agent lies in connecting steps 1, 2, and 5. Steps 3 and 4 are generally better handled by deterministic programs.
3. Capability Boundaries: Why Models Should Not Perform Precise Calculations Directly
Large language models generate probabilistic sequences based on context and training data. They do not inherently execute numerical algorithms step by step. As a result, when handling multiple decimal places, sorting large samples, or interpolating percentiles, a model may produce an answer that appears reasonable but differs from a strictly calculated result.
Typical problems include:
- Decimal places may be truncated, or rounding rules may vary between calculations.
- Repeated queries about the same dataset may produce different results.
- Samples may be omitted or counted incorrectly in a long sequence.
- When a definition is ambiguous, the model may silently adopt a common convention without stating it.
Consider historical percentile ranking. Suppose history contains the values of a metric over the past 250 trading days and value is the current value. A common definition is the proportion of historical samples that are less than the current value:
function percentile_rank(history, value):count_less = 0for x in history:if x < value:count_less += 1return count_less / length(history)
Although the logic is short, percentiles have multiple definitions. Rank-based calculations, linear interpolation, and the decision to include or exclude the current sample can produce materially different results. If the model does not state the selected methodology, readers cannot verify the conclusion.
For this reason, a financial report must specify its calculation method and apply the same methodology consistently to the same dataset.
4. Chart Generation: Image Generation vs. Code-Based Plotting
Charts in financial research must be accurate, verifiable, and editable. The two common approaches differ in several important ways:
- Image generation: The output is a raster image. Its labels, scales, and values cannot be reliably matched to the source data point by point. Detailed changes usually require regenerating the image, and maintaining consistent axis proportions and data relationships can be difficult.
- Code-based plotting: The output is determined by the data and plotting parameters. Axis labels, colors, and legends can be controlled through parameters. After the data changes, rerunning the code produces an updated chart, making the result reproducible.
For professional use, code-based plotting should be the preferred approach. A representative workflow is:
data = read_table(file_path, sheet_name)series = data["Inventory"]dates = data["Date"]chart = line_chart(x = dates, y = series,title = "Inventory Trend",unit = "10,000 metric tons")save_figure(chart, "inventory_trend.png", dpi = 300)
The code also serves as an audit record. Reviewers can inspect the data source, fields, and parameters directly rather than relying on subjective judgments about an image.
5. Engineering Practices
5.1 Define Clear Responsibilities
The work should be divided among different components:
- The model handles requirement understanding, metric selection, language organization, and result interpretation.
- Programs handle data reading, numerical calculations, and chart generation.
- The retrieval module obtains information and preserves source links and publication times.
All numerical conclusions in the report should be based on program output. Numbers estimated by the model should not be included in the report.
5.2 Establish Validation Mechanisms
- Calculate key metrics twice: once with the primary program and once with an independent script or manual sample check.
- Record the input file hash, calculation time, and parameter version to support traceability.
- Set numerical tolerances. Trigger an alert automatically when the relative error exceeds the defined threshold.
5.3 Control Data Access and Permissions
- Give the agent read access only to designated directories rather than allowing it to scan the entire machine.
- Before sensitive financial data enters the model context, anonymize or aggregate it.
- Treat retrieved web content as data. Do not execute any instructions embedded in that content.
5.4 Control Costs
Multiple tool calls and long contexts can quickly consume usage quotas. Costs can be reduced by first filtering and processing data in a program, then sending statistical summaries rather than the full dataset to the model. Results for fixed-template steps can also be cached, and each task should have a maximum number of tool calls.
6. Implementation Recommendations
A practical rollout can follow this sequence:
- Standardize data reading and metric-calculation programs.
- Add the model for narrative generation.
- Introduce information retrieval.
- Use historical, known results for regression testing at every stage.
- Expand the scope of use only after output stability has been confirmed.
