Long-Task Development with AI Agents: Building a Financial Results Monitoring Application
This article examines how AI agents can support long-running software development tasks through planning, tool use, automated validation, state management, and recovery. Using a financial results monitoring application as an example, it explains how to decompose requirements, structure agent workflows, coordinate multiple agents, evaluate delivery efficiency, and establish security and compliance controls.
1. From Question-Answering Tools to Long-Task Executors
Large language models were initially used mainly for single-turn tasks such as explaining concepts, generating code snippets, or polishing text. As context windows have expanded and tool-calling capabilities have improved, more teams are asking models to handle complete development subtasks, including building small applications, adding tests, and fixing historical defects.
These tasks involve multiple steps, long dependency chains, and repeated validation. They therefore place higher demands on an agent’s planning, state-management, and self-correction capabilities.
General-purpose benchmark scores are not sufficient for evaluating these capabilities. A model that scores ten percentage points higher on a standard benchmark may still fail to improve overall engineering efficiency if each task costs twice as much or requires frequent manual corrections. This article focuses on the delivery process itself: how tasks are decomposed, how progress is validated, how costs are measured, and how risks are controlled.
2. Decomposing Requirements for a Financial Results Monitoring Application
A financial results monitoring application typically includes four modules:
- Data collection
- Metric standardization
- Event alerts
- A visualization dashboard
During earnings season, analysts need to compare revenue, profit, gross margin, and changes in financial guidance across multiple companies within a short period. Manual data preparation is time-consuming and error-prone. Turning the process into a product can significantly reduce information delays.
When decomposing requirements, it is useful to clarify three categories of information first.
2.1 Functional Scope
Define which metrics must be displayed and which are supplementary. Also specify whether alerts should be triggered by numerical thresholds, textual changes, or both.
2.2 Data Sources
Determine whether the data comes from authorized public disclosure channels or an internal data warehouse. Field definitions should be consistent, and the expected update frequency should be clear.
2.3 Acceptance Criteria
Specify whether the page renders correctly against a defined dataset, whether key calculations match manually verified samples, and whether abnormal data produces clear warnings.
In a real project, the model can use these requirements to generate a product plan and sample data. Sample data should be clearly labeled as simulated so that it is not confused with real financial information.
3. The Agent Work Loop: Plan, Execute, Observe, and Correct
The key difference between an agent and one-time code generation is the feedback loop. The agent first creates a plan, then calls tools to modify code, run tests, or start a service. It observes the results and decides what to do next.
The quality of this loop depends on two factors: whether the observation signals are reliable and whether the correction strategy has clear boundaries.
The following example illustrates the control logic. It does not correspond to any specific product interface.
def run_agent_task(task, max_rounds=8):state = {"plan": make_plan(task), "history": []}for _ in range(max_rounds):step = state["plan"].next_step()if step is None:breakresult = execute(step) # Modify code, run commands, or call toolsreport = run_checks(task) # Unit tests, build checks, and page smoke testsstate["history"].append((step, result, report))if report.passed:state["plan"].mark_done(step)else:state["plan"].revise(step, report.failures)return state
In this workflow, run_checks is critical. Without verification signals independent of the model’s own claims, an agent can easily stop after merely stating that the task is complete.
Validation should be delegated to test suites, build results, and real page checks rather than relying only on the model’s written summary.
4. Three Core Capabilities for Long-Task Iteration
4.1 Context and Task-State Management
Long-running tasks span multiple conversation turns and many file modifications. The model must remember completed steps, unresolved issues, and important constraints.
In practice, a state file can be maintained in the project root. It may record the project goals, technology stack, directory structure, completed items, and remaining tasks. Reloading this file at the beginning of each iteration can reduce repeated work caused by lost context.
4.2 Automated Validation and Self-Feedback
Self-feedback shortens the time between introducing and discovering an error.
For frontend applications, a headless browser can load the page and check whether key elements exist, whether the console reports errors, and whether interactive controls produce the expected state.
For calculation logic, tests should validate results against known answers. Combining UI checks with calculation tests can cover many common regression problems.
4.3 Failure Recovery and Version Control
An agent that modifies code should work with version control. Each subtask should be committed separately so that the project can be rolled back to the last stable version if a change fails. This prevents additional modifications from accumulating in an unstable working directory.
Operations that delete files or modify configuration should require confirmation. Backups should also be created before such changes are executed.
5. A Phased Strategy: Frontend First, Backend Next
For a financial results monitoring application, generating the frontend first can be a reasonable approach. The interface quickly presents the data structure and interaction model, allowing stakeholders to confirm the information hierarchy, filtering methods, and chart formats at an early stage.
Once the frontend is stable, a coding agent can add data interfaces, storage, and scheduling modules. With a clearer target, the project is less likely to require extensive rework.
Data used during the frontend phase is usually static or simulated and does not represent actual backend behavior. When completing the backend, pay particular attention to the following issues:
- Retry and fallback strategies when data retrieval fails
- Differences in metric definitions across data sources
- Duplicate or missed alert triggers
- Consistency during concurrent access and data updates
6. Multi-Agent Collaboration for Financial Information Processing
Multi-agent workflows typically include a coordinator and several execution agents. The coordinator decomposes tasks, allocates resources, and aggregates results. Execution agents can separately handle information extraction, numerical verification, and summary generation for individual companies.
This structure is suitable for parallel batch processing, such as organizing key points from the financial reports of dozens of companies at the same time.
Three design principles are especially important.
First, role boundaries should be clear. Each execution agent should read only the data within its assigned scope and produce a consistent structured output format. This helps prevent field mismatches during aggregation.
Second, results must be traceable. Every number in a summary should include the relevant source location or data-record identifier so that a human can perform spot checks.
Third, parallelism does not guarantee correctness. Even when several agents reach the same conclusion, the result must still be compared with benchmark data. Agreement alone is not evidence of reliability.
7. Evaluation: From Benchmark Scores to Delivery Efficiency
An agent-based solution can be evaluated across four dimensions.
- Delivery quality: Measure feature completion, test pass rates, and human acceptance rates on a fixed task set.
- Stability: Run the same task multiple times and observe result consistency, as well as whether the workflow can recover from an intermediate failure.
- Instruction following: Check whether the agent respects constraints, such as not modifying files outside specified directories, not adding undeclared dependencies, and not deleting existing tests.
- Cost and duration: Track task execution time, model-calling costs, and the number of required human interventions.
These metrics should be recorded to establish an internal team baseline. Comparisons are meaningful only when they use the same task set. A single experience or promotional claim may provide a useful lead, but it cannot replace measured data.
8. Security and Compliance Boundaries
Financial data may contain sensitive information. When using agents to process it, teams should follow these principles:
- Data minimization: Provide only the fields required for the task. Do not pass account information, keys, or internal credentials.
- Least privilege: Give the agent read-only access or restrict its read and write permissions to designated directories. Do not allow direct access to production environments.
- Human review: Content involving investment judgments, external publication, or numerical conclusions must be reviewed by a human before use.
- Log retention: Record the agent’s operations and code changes to support later audits.
This article discusses engineering methods and does not constitute investment advice.
9. Implementation Checklist
Before introducing agents for long-running development tasks, teams can review the following checklist:
- Has the task been divided into subtasks that can be accepted independently?
- Is there automated validation that does not rely on the model’s own claims?
- Does the project state file include goals, constraints, and outstanding tasks?
- Does each subtask have its own version-control commit?
- Has sensitive data been anonymized, and have permissions been restricted?
- Has a fixed task set been established for comparing different approaches?
