From Surge to Slow Decline: Risk Analysis Practice with Financial Agents
This article explains how to put large language models inside an auditable financial research workflow rather than using them as one-shot Q&A tools. It covers a layered architecture, evidence collection and verification, risk transmission graphs, scenario analysis, and an interactive HTML risk dashboard, with emphasis on traceability, human review, and engineering quality control.
From Surge to Slow Decline: Risk Analysis Practice with Financial Agents
1. Problem definition: the goal is an evidence chain, not a single conclusion
Price paths that rise quickly and then grind lower are common in capital markets. On the surface they look like valuation and sentiment shifts. Underneath, they are often risk factors that surface at different times: growth narratives hide them early, high-frequency data disturbs them in the middle, and only later do they appear in orders, inventory, delivery, cash flow, or compliance constraints. The hard part for researchers is not explaining the story after the fact, but spotting hidden risk and its transmission path while information is fragmented, inconsistent, and noisy.
This article therefore does not treat a large language model as a Q&A box that issues conclusions. The model is placed in an auditable research workflow: it decomposes tasks, calls tools, extracts facts, and proposes risk hypotheses. A rules engine checks time, entity, numbers, and source independence. Domain experts confirm key assumptions. Structured data then drives an interactive risk dashboard. The work splits into three stages:
- Multi-channel collection and fact verification, producing a traceable evidence store and event timeline.
- Risk-candidate extraction on that store, a transmission graph, and baseline, stress, and tail scenarios.
- Rendering of results as an interactive HTML risk dashboard with filtering, traceability, scenario controls, and audit export.
The core outputs are verifiable data structures and a complete reasoning chain—not a report that merely looks like research. Agent output is engineering-ready only when evidence, risks, transmission links, scenario assumptions, and monitoring metrics can be traced to one another.
2. Overall architecture: turn research into an executable data flow
A production financial-risk agent should use a layered design: data, evidence, analysis, and interaction.
Multi-source materials-> ingest, parse, entity alignment-> Evidence Store-> fact verification and conflict detection-> Event Timeline-> Risk Candidates-> Transmission Graph-> Scenario Engine-> structured research report (JSON)-> interactive HTML risk dashboard
Four cross-cutting capabilities sit beside the pipeline: task orchestration, access control and audit, human review, and quality evaluation. Orchestration makes ingest, parse, verify, analyze, and page generation rerunnable. Audit ties every conclusion to a data snapshot and model version. Human review stops high-impact edges and scenarios from being accepted solely because the model asserted them. Quality evaluation tracks citation coverage, conflict rate, unsupported-statement rate, and page-data consistency.
3. Stage one: multi-channel collection and fact verification
3.1 Define a unified evidence model before collection
Many agent projects fail not because the model is weak, but because there is no data contract. Filings are long text, financials are tables, industry series use statistical definitions, market data is time series, and news and interviews mix opinion. Without a structured evidence object at the door, analysis collapses into concatenated summaries.
A minimum evidence object:
{"evidence_id": "E-001","target_entity": "anonymous sample company","source_type": "official_disclosure","source_authority": "high","published_at": "YYYY-MM-DD","event_at": "YYYY-MM-DD","retrieved_at": "YYYY-MM-DDTHH:mm:ss","claim": "the sample company disclosed a change in a business metric over a given period","metric": "metric_name","value": "{{value}}","unit": "{{unit}}","period": "{{period}}","quote": "{{short_quote}}","entity_path": ["sample company", "business segment"],"independence_group": "source_family_id","confidence": 0.0}
Keep published_at and event_at separate. Backtests must not leak future information: material disclosed after an event cannot be used at an earlier as-of date. independence_group identifies reprints, same-family copy, and secondary citations so one source is not counted many times. entity_path handles parent/subsidiary, segment, product-line, and regional mismatches.
3.2 Multi-source is not the same as stacking channels
Collection should span financial disclosures, regulatory filings, industry statistics, public interviews, market data, and public supply-chain information. Multiple channels are not automatically independent. Three articles quoting the same press release are one independent evidence item. The ingest module should record source family, citation links, and publish time, and mark original versus derived sources.
Parsing must handle table extraction, unit normalization, currency conversion, period alignment, and accounting-definition mapping. For key metrics, store original value, normalized value, and review value: the original preserves a traceable snippet, the normalized value is used in computation, and the review value supports human check. Models can help locate tables and paragraphs; numbers must still pass deterministic validation before they enter the store.
3.3 Five verification checks
First, time: event date, disclosure date, and data cutoff must be consistent. Second, entity: confirm whether a metric belongs to parent, subsidiary, or a named segment. Third, numbers: unit, currency, period, year-over-year versus sequential change, and accounting basis. Fourth, source independence: whether several items share one origin. Fifth, conflicts: when sources disagree, do not force the model to pick a winner; mark an unresolved conflict and keep both sides.
Verification flow in pseudocode:
def verify_claim(claim, evidence_list, as_of):valid = []for ev in evidence_list:if ev.published_at > as_of:continueif not entity_compatible(claim.target, ev.entity_path):continueif not period_compatible(claim.period, ev.period):continueif not unit_compatible(claim.unit, ev.unit):continuevalid.append(ev)independent_sources = group_by(valid, key="independence_group")conflicts = detect_numeric_conflict(valid, tolerance=0.01)return {"status": "supported" if valid and not conflicts else "unresolved","evidence_ids": [ev.evidence_id for ev in valid],"independent_source_count": len(independent_sources),"conflicts": conflicts}
The aim is not fully automatic ground truth. The system should distinguish supported, partially supported, conflicted, and unverified. For the last two, the agent may emit risk leads, not deterministic conclusions.
3.4 The event timeline is the skeleton of risk analysis
After verification, organize evidence into a timeline: financing and capex, product launches, capacity, orders and delivery, prices and inventory, compliance, and management guidance. Each event needs event date, disclosure date, affected object, direction of impact, evidence IDs, and confidence.
The timeline shows how risk accumulates, not only a snapshot of one quarter. Rising demand expectations may lift revenue forecasts, then capex, then inventory and delivery stress. Looking only at the latest financials often misses that chain.
4. Stage two: risk extraction, transmission modeling, and scenarios
4.1 Risk candidates: keep facts, inferences, and hypotheses apart
Candidates should be generated under a defined taxonomy, not free-form. Typical classes include market and expectation risk, supply-chain and delivery risk, customer concentration, inventory and price risk, capex and cash-flow risk, compliance, and technology-path risk. Each object should include:
- name and class;
- trigger conditions;
- exposure;
- related evidence IDs;
- leading indicators;
- counter-evidence or mitigants;
- confidence and status.
The binding constraint: every model output must be labeled fact, inference, or hypothesis. Facts need evidence IDs; inferences need reasoning steps; hypotheses need observables that can confirm or falsify them. Unevidenced risks may stay as leads; they must not enter high-confidence conclusions.
4.2 Transmission graph: possible paths, not claimed causality
Risks are rarely isolated. Customer concentration can affect order stability; supply concentration can affect delivery; delayed delivery can affect revenue recognition and cash, then valuation and expectations. Represent this as a directed graph:
- nodes: risk factors, events, operating metrics, financial metrics, market factors;
- edges: direction, sign, lag, mechanism, evidence IDs, confidence, counter-evidence.
Example:
Risk factor: supply concentration--negative, lag 1-2 quarters, mechanism: constraint at a critical step reduces delivery-->Operating metric: delivery capacity--negative, lag 0-1 quarter, mechanism: short delivery impairs revenue recognition-->Financial metric: revenue growth
Edges are transmission hypotheses, not proven causality. Each edge needs a mechanism and evidence IDs; counter-evidence belongs on the edge. High-impact edges need expert review.
def add_edge(graph, src, dst, sign, lag, mechanism, evidence_ids, confidence):if not evidence_ids:raise ValueError("risk edge requires evidence")if mechanism is None or len(mechanism.strip()) == 0:raise ValueError("risk edge requires mechanism")graph.append({"from": src,"to": dst,"sign": sign,"lag": lag,"mechanism": mechanism,"evidence_ids": evidence_ids,"confidence": confidence,"status": "hypothesis"})
Priority can mix rules and the model—probability, impact, lag, evidence strength, observability. Weights should be preset and versioned so scoring logic does not drift run to run.
4.3 Scenario modeling: ranges and boundary conditions instead of point forecasts
Scenarios test how risk moves under combinations of assumptions, not precise prediction. Use at least baseline, stress, and tail. Variables may include demand growth, price change, delivery capacity, capex intensity, compliance constraints, and inventory turns. Give low, mid, and high ranges and cite the basis.
A simplified sensitivity sketch:
revenue change ≈ volume change + price change + delivery-constraint effectcash-flow change ≈ revenue change - working-capital change - capex change
Parameterize formulas and map each parameter to evidence or an explicit assumption. For auditability, start with deterministic scenario tables, then add sensitivity and interval simulation as needed. The dashboard may let users move sliders such as demand-growth adjustment or delivery-constraint intensity and recompute ranges, but it must always show current assumptions, evidence, and uncertainty.
5. Stage three: an interactive HTML risk dashboard
5.1 Define an output contract, then render the page
The UI should not be improvised frontend code from the model. Render a structured research result. The contract should include as-of time, entity, risk list, timeline, graph, scenario parameters, evidence index, and audit metadata. The page displays and interacts; it does not invent conclusions.
Simplified contract:
{"as_of": "AS_OF","entity": "anonymous sample company","risks": [{"id": "R1","name": "demand-expectation pullback","score": 0.72,"confidence": 0.63,"evidence_ids": ["E-001", "E-004"]},{"id": "R2","name": "supply-concentration constraint","score": 0.58,"confidence": 0.70,"evidence_ids": ["E-002", "E-003"]}],"graph": {"nodes": [{"id": "R1", "label": "demand-expectation pullback", "type": "risk"},{"id": "M1", "label": "revenue growth", "type": "metric"},{"id": "R2", "label": "supply-concentration constraint", "type": "risk"},{"id": "M2", "label": "delivery capacity", "type": "metric"}],"edges": [{"from": "R1","to": "M1","sign": "-","lag": "0-1Q","mechanism": "expectation pullback leads to order adjustments","evidence_ids": ["E-001"]},{"from": "R2","to": "M2","sign": "-","lag": "1-2Q","mechanism": "supply constraint affects delivery","evidence_ids": ["E-002", "E-003"]}]}}
5.2 Page structure: every conclusion must walk back to evidence
Six regions work well:
- Risk overview: heat, confidence, and direction by class.
- Event timeline: key events, disclosure times, evidence links.
- Transmission view: nodes and edges for hypothesized paths.
- Scenario cockpit: sliders or inputs and metric ranges.
- Evidence drawer: source snippet, type, time, conflict status when a risk or edge is selected.
- Audit export: structured data, assumption notes, and review records.
Minimal standard-web example of data-driven rendering, evidence IDs, and scenario controls:
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Risk Dashboard</title></head><body><div id="app"></div><script>const DATA = {asOf: "AS_OF",entity: "anonymous sample company",risks: [{id: "R1", name: "demand-expectation pullback", score: 0.72, confidence: 0.63, evidence: ["E-001", "E-004"]},{id: "R2", name: "supply-concentration constraint", score: 0.58, confidence: 0.70, evidence: ["E-002", "E-003"]}]};function esc(value) {return String(value).replace(/[&<>"']/g, function (c) {return {"&": "&", "<": "<", ">": ">", '"': """, "'": "'"}[c];});}function renderRiskCards(container, risks) {container.innerHTML = risks.map(function (r) {return ["<section class=\"risk-card\">","<h3>" + esc(r.name) + "</h3>","<p>Risk heat: " + (r.score * 100).toFixed(0) + "%</p>","<p>Evidence confidence: " + (r.confidence * 100).toFixed(0) + "%</p>","<p>Evidence IDs: " + r.evidence.map(esc).join(", ") + "</p>","</section>"].join("");}).join("");}document.getElementById("app").innerHTML = ["<h1>Risk Dashboard · " + esc(DATA.entity) + "</h1>","<p>As of: " + esc(DATA.asOf) + "</p>","<div id=\"risks\"></div>","<section>","<label>Demand-growth adjustment: <input id=\"demand\" type=\"range\" min=\"-30\" max=\"30\" value=\"0\"></label>","<p id=\"scenario-output\"></p>","</section>"].join("");renderRiskCards(document.getElementById("risks"), DATA.risks);document.getElementById("demand").addEventListener("input", function (event) {const delta = Number(event.target.value);document.getElementById("scenario-output").textContent ="Revenue sensitivity adjustment under the current stress case: " + delta + "%. Note: UI interaction only; production calculation must bind to validated model parameters.";});</script></body></html>
The point is constraint, not frontend technique: cards come from structured data; evidence IDs are look-ups; sliders change declared parameters only; as-of time is always visible so a historical snapshot is not mistaken for a live conclusion.
5.3 Safety, access, and auditability
Escape all dynamic content; do not splice untrusted text into the page. Minimize privileges for scripts, styles, and external resources. Multi-user pages need access control, operation logs, and export watermarks. Bind each page to a research-run record: data snapshot, model version, prompt version, rule version, human-review status, and evidence index. When conclusions change, the team can tell whether data, model, or assumptions moved.
6. Six points of engineering quality control
First, rerunnable orchestration: ingest, parse, verify, extract, scenario compute, and page generation should be idempotent and restartable from any stage. Second, data versioning: bind each run to a snapshot and evidence set. Third, separate rules from the model: numeric, time, and access checks in deterministic code; the model summarizes and hypothesizes. Fourth, mandatory citation: high-risk conclusions need evidence or they stay in a to-verify zone. Fifth, human review on high-impact edges, key scenario parameters, and public pages. Sixth, a closed evaluation loop: citation coverage, conflict detection, unsupported statements, page-data consistency, and review-rejection reasons feed iteration.
7. Common mistakes and how to avoid them
Mistake one: treating fluent model prose as a research conclusion. Define the evidence model and output contract first. Mistake two: single-source summaries. Check independence and citation graphs. Mistake three: invented precision. Use placeholders, ranges, and explicit assumptions; numbers come from the evidence store or expert input. Mistake four: writing correlation as causation. Mark edges as hypotheses with mechanism, lag, and counter-evidence. Mistake five: a polished UI with no trace. Drive the page by evidence IDs. Mistake six: ignoring as-of time. Set as_of per run and ban future data in backtests.
8. Rollout path: one entity, few risks, strong audit first
Do not start with every industry and every risk class. A safer path: one anonymous sample entity, 8–12 core fields, 3–5 risk classes; wire collection, verification, risk graph, two scenario types, and a single-page dashboard; add human review and run records; then expand channels, taxonomy, and interaction. Stage one is traceability, stage two reuse, stage three more automated generation and refresh.
9. Closing
A surge followed by a slow decline is an outcome. Hidden risk usually sits in evidence gaps, definition conflicts, transmission lags, and scenario assumptions. A financial research agent is valuable not because it delivers a seemingly certain answer, but because it turns multi-channel material into an evidence store, expresses risk as a reviewable graph, turns uncertainty into adjustable scenarios, and deposits results in an interactive, auditable dashboard. In high-volatility, information-dense industries, that engineering capability matters more than a single Q&A turn and better supports durable, explainable risk research.
