- Home
- Case Studies
- LLM Financial-Research Reporting Pipeline
LLM Financial-Research Reporting Pipeline
A research reporting workflow that turns inputs into a structured draft with cited sources for human review.
- financial research reporting pipeline
- LLM financial research reporting
- automated financial research documents
- financial reporting pipeline engineering
- structured market data reporting
- financial research automation
Operational outcome
LLM Financial-Research Reporting Pipeline
AI Systems
Measured result
Structured research draft with source citations for review.
Recorded results
improved Structured output reliability
every generation run is validated against the JSON schema before proceeding.
enforced Citation integrity
published citations are verified against regional source data before release.
deterministic Chart rendering
no dependency on browser-side JavaScript execution in the PDF path.
The pipeline replaced a process with multiple silent failure points with one that is deterministic, verified at every stage, and structurally incapable of shipping empty or malformed output.
The challenge
From fragile output to dependable pipeline
The organization's research workflow depended on a sequence of manual and semi-automated steps. Analysts curated content, templates assembled sections, and a rendering step produced the final documents. The process worked well enough when volumes were low and timelines were flexible, but it did not scale, and it failed in ways that were difficult to detect until after documents had already been distributed. The problems clustered around four failure modes, each of which undermined trust in the output.
Octacer's approach was to make the pipeline deterministic where it mattered, verifiable at every stage, and incapable of shipping unvalidated output. The design principle was simple: the pipeline should fail loudly before distribution, not silently after it. The solution addressed each failure mode at its root rather than patching symptoms. Chart rendering moved out of the browser runtime. Citation verification became a first-class pipeline stage. Structured output was validated against a schema before it could proceed. And a final verification gate checked every document before release.
What was at risk
-
Unreliable structured output
The pipeline was expected to produce structured data alongside human-readable research documents. In practice, the structured output was often malformed or incomplete. Downstream systems that consumed the data had to handle missing fields, incorrect types, and occasional outright parsing failures. This created a hidden tax: every consumer of the output needed defensive parsing logic, and every parsing failure required manual investigation. The structured data (which was supposed to reduce operational overhead) was generating additional work.
-
Citations that could not be trusted
Research documents required regional citations: references to specific sources that supported the analysis. The citation step did not reliably verify that the cited source existed or that the reference was accurate. Some citations pointed to sources that could not be located, while others were plausible but unverifiable. For a financial-research organization, citation integrity is not a nice-to-have. Documents with unreliable citations erode credibility and create risk if the underlying source is challenged.
-
Charts lost in rendering
The chart-rendering step depended on browser-side execution inside the PDF generation process. Charts were generated via client-side JavaScript, and the PDF engine captured the page before the chart lifecycle finished. The result: PDFs that occasionally shipped with blank or partially rendered charts. The failure was intermittent, which made it the most insidious problem in the pipeline. A document could render correctly ten times in a row, then fail on the eleventh, with no change in input or configuration. The team could not reproduce the failure on demand, which meant it could not be fixed reliably.
-
No safety net for empty output
The pipeline had no final verification step. If any stage produced empty or incomplete output (whether a blank chart, a missing section, or an empty data payload) the document proceeded to distribution anyway. There was no gate that said "this output is incomplete, do not ship it." The absence of a verification layer meant that quality problems surfaced after distribution, when the cost of correction was highest and the damage to credibility was already done.
- Industry
- Financial research
- Project
- Reporting pipeline engineering
- Octacer's role
- Full development
- Status
- Shipped
What we built
How the workflow works
Rebuilt around verified output, not hopeful rendering.
-
n8n
orchestrated research gathering, LLM generation, validation, and PDF rendering workflows.
-
LLM (Structured Output)
generated structured market analysis and financial narrative constrained to a JSON cont…
-
Defensive JSON Parser
stripped markdown fences, cleaned inline tags, repaired common syntax issues, and surfa…
-
Domain Whitelist & Blacklist
enforced four-layer source filtering to block social feeds and keep citations region-re…
-
Inline SVG Charts
rendered deterministic 5-year column charts, CAGR badges, and ROI markers directly in H…
-
HTML-to-PDF Renderer
converted validated HTML and inline SVG assets into print-ready PDF research reports.
-
Step 1: Source filtering and structured LLM drafting
Research inputs pass through whitelist/blacklist rules before the LLM outputs narrative analysis and projections as JSON.
-
Step 2: Defensive parse, inline SVG chart render, and PDF export
Inline SVG ChartsA repair-capable parser validates the JSON, generates inline SVG charts inside HTML, and renders a print-ready PDF.
Deliverables
What we delivered
-
Schema-validated structured output
The pipeline generated structured research output against an explicit JSON schema. Every field had a defined type, required fields were enforced, and unexpected values were rejected at generation time.
- Downstream systems consume data without defensive parsing
- Malformed output is caught at the source, not at the consumer
- The schema serves as documentation of what the pipeline guarantees
-
Regional citation verification
A dedicated verification stage checked every regional citation against its source before the document could proceed. Citations that could not be verified were routed to human review.
- Every published citation is traceable to a verified source
- Human attention is reserved for uncertain cases
- Citation integrity is enforced by the pipeline, not by manual diligence
-
Deterministic chart generation
Charts were generated server-side from the same structured data that fed the document. The PDF renderer received complete images, eliminating the asynchronous rendering race entirely.
- No dependency on browser-side execution
- Identical input produces identical output
- Chart failures surface as pipeline errors, not blank PDF pages
-
Pre-distribution verification gate
A final pipeline stage verified the complete document before release: sections present, charts rendered, citations verified, structured output schema-valid.
- Silent failures are structurally impossible
- Held documents include the specific reason for the hold
- Quality control shifts from after distribution to before it
-
Human review queue for uncertain output
Documents that failed any verification check were routed to a review queue with the specific failure reason attached. Reviewers could correct, approve, or reject the document without investigating what went wrong.
- Failure diagnosis is immediate, no investigation required
- Review work is scoped to the specific issue
- The queue prevents incomplete documents from reaching distribution
-
Research document packaging for distribution
Validated structured output, verified citations, and server-rendered charts are assembled into the distributable research document only after the pre-distribution verification gate clears.
- Packaging consumes only gate-approved artifacts
- Charts and citations travel with the same verified payload
- Uncertain runs stay in the human review queue instead of shipping
Engineering decisions
Two decisions that shaped the build
Generate charts as hand-written inline SVG inside the HTML step
Headless HTML-to-PDF renderers intermittently fail on client-side chart scripts and external image fetches; inline SVG renders deterministically every run.
Pair prompt constraints with a defensive JSON parser and explicit row selection
A corrupt leading spreadsheet row previously caused silent empty AI sections; explicit record targeting and defensive parsing prevent silent omissions.
Validation
What we verified
| Status | What the record shows |
|---|---|
| Tested | Verified inline SVG charts survive headless HTML-to-PDF conversion without missing renders. |
| Tested | Confirmed defensive JSON parser handles markdown fences and surfaces exact failing snippets, and four-layer filtering blocks junk citation domains. |
Outcomes
What changed
- Human review is now concentrated on genuinely uncertain cases (unverifiable citations and documents that fail validation) rather than routine output inspection
- The pipeline provides a reusable foundation for additional report types, since schema, verification, and rendering stages are all data-driven
- Debugging is simpler because every stage is deterministic and every failure includes its specific reason
- The verification gate gives the organization a reliable release decision point for every research document
Need reliable AI-generated PDF reports without broken charts?
We harden LLM-to-PDF pipelines with strict schemas, source filtering, and deterministic rendering.
Need something like this? See the related service: Automation Sprint.
Tell us about your project