# πŸ€– VQuant: An Agentic Large Language Model Architecture for Automated Quantitative Financial Analysis and Document Generation **UQO Working Paper No. 13** β€” *Reasoning-Augmented Tool Orchestration, In-Loop Numerical Computation, and Multi-Format Reporting* [![Paper](https://img.shields.io/badge/paper-PDF%20(41%20p.)-b31b1b?logo=latex&logoColor=white)](paper/main.pdf) [![Type](https://img.shields.io/badge/type-system%20%2F%20methodology%20paper-4051b5)](paper/main.tex) [![Platform](https://img.shields.io/badge/platform-VQuant%20(spbgit%20vquant.git)-4051b5)](#-data) [![Institution](https://img.shields.io/badge/UQO-D%C3%A9pt.%20des%20sciences%20administratives-16365c)](https://uqo.ca) [![Author](https://img.shields.io/badge/author-Simon--Pierre%20Boucher-16365c)](mailto:simon-pierre.boucher@uqo.ca) > **TL;DR** β€” VQuant is a deployed web platform that turns a natural-language request into a > quantitative financial report in which every number comes from live data retrieval or auditable > code rather than from the model. This is a **design-science system description, audited line by > line against the platform's source code** (spbgit `vquant.git`, commit `e2a148a`, 2026-10-02): > a recursive, batched, streaming tool-calling loop over **245 schema-defined tools** (two > market-data providers, 249 typed wrappers over 233 endpoint paths; three web-research services; > a Python sandbox pre-loading 29 packages), a **three-stage context-management procedure** > (3,000/15,000-char truncation at execution, 5,000-char re-send cap, adaptive summarisation at > 10^5 tokens keeping the last 5 messages), a **single-call computation convention**, and a > document pipeline (PDF via Puppeteer+KaTeX, DOCX via Pandoc, Beamer via a second model call + > two pdflatex passes, live-formula XLSX). **No empirical evaluation is reported** (no accuracy, > hallucination, latency or cost measurements); a pre-registered evaluation protocol is specified > as future work. --- ## πŸ“Œ Status | Item | Value | |---|---| | Version | **1.1 (October 2026)** β€” revised 2026-10-17 (editorial-board review; `docs/REVIEW-REPORT.md`, `docs/CHANGELOG-REVISION.md`). v1.0 = June 2026 (`docs/main_pre-revision-20261017.pdf`, 28 p.) | | SSRN | not yet submitted | | Journal | not yet submitted; candidate venues *Journal of Financial Data Science*, *Decision Support Systems*, *Expert Systems with Applications* β€” **only after the evaluation protocol of Β§6.6 has been executed** | | Code & data | design/system paper β€” no empirical pipeline. The platform's source code lives in the spbgit repository `vquant.git`; the paper describes commit `e2a148a` (2026-10-02). The audit script and its outputs are in `docs/verify/` | ## 🎯 What this paper does Large language models are fluent in financial discourse, but fluency does not guarantee numerically rigorous, reproducible or citable analysis. This paper describes the **architecture** of VQuant, a platform that couples a reasoning-capable LLM with a deterministic execution substrate, under the principle *the model plans and synthesises, auditable code computes*. It is written as a design-science contribution (Hevner et al. 2004; Gregor & Hevner 2013): a situated implementation plus a demonstration, with the evaluation step specified but not performed. Four mechanisms are documented at implementation level, with their actual constants, and audited against the code (Appendix E maps every claim to a source file): 1. an **agentic orchestration loop** over 245 tools (recursive tool-calling, batches of 5 with 500 ms spacing, tool-use/tool-result pairing, prompt-level routing by request complexity); 2. a **three-stage context-management procedure** (per-result truncation at execution, re-send cap, adaptive summarisation under a 10^5-token budget) and a **token-accounting correction** (max of provider count and a local BPE count β€” an approximation, not an exact count); 3. a **single-call computation convention** (data β†’ estimation β†’ figures in one sandboxed Python execution; process-isolated child, 90 s timeout, figure sweep at 150 dpi); 4. a **document pipeline** (PDF, DOCX, Beamer, live-formula XLSX from one Markdown artifact). The revision corrected several statements of v1.0 that the code audit contradicted: tool count, tokenizer, reachability of the pre-built numerical routines (only the option pricer is in the catalogue), the model layer (now multi-provider), and three features (SSO, daily caps, bring-your-own-keys) that do not exist in any committed version. ## πŸ† Headline results There are **no empirical results**. The table lists verified design facts (commit `e2a148a`). | Object | Value (audited) | |---|---| | Tools exposed to the model | 245 schema-defined tools (17 families, Table 3) | | Market-data wrappers | 249 typed functions over 233 endpoint paths (FMP) + 8 EODHD tools | | Web-research tools | 14 (Firecrawl 7, Tavily 5, Exa 2) | | Sandbox packages attempted at start-up | 29 (platform docs say 17) | | Loop constants | batches of 5, 500 ms; truncation 3,000/15,000 chars; re-send cap 5,000; Ο„ = 10^5 tokens, k = 5 | | Model layer | Anthropic reference path (default `claude-fable-5`, adaptive thinking on 5 models, 64,000-token cap, temperature 1); OpenAI-compatible adapter limited to the first 128 tools | | Output formats from one artifact | PDF, DOCX, Beamer, XLSX (live formulas) | | Measurements of accuracy, hallucination, latency, cost | none (protocol in Β§6.6, not executed) | ## πŸ—‚ Repository layout ``` vquant-llm-quant-platform/ β”œβ”€β”€ paper/ # main.tex + sections/ + figures/ (TikZ diagrams) + tables/ + appendix/ β†’ main.pdf β”‚ β”œβ”€β”€ figures/ # architecture, loop, context, sandbox, streaming, docpipeline (TikZ) β”‚ └── tables/ # tools (generated by docs/verify/audit_vquant_code.py), models, events, robustness (= design rationale) └── docs/ # REVIEW-REPORT.md, CHANGELOG-REVISION.md, main_pre-revision-20261017.pdf, verify/ (audit script + JSON) ``` No `src/`, `scripts/` or `data/`: the paper has no empirical pipeline. `docs/verify/audit_vquant_code.py ` regenerates `paper/tables/tools.tex` and the code facts used in the text. ## πŸš€ Quick start ```bash cd paper && make # latexmk β†’ main.pdf (pdflatex + bibtex, TikZ diagrams compiled inline) ``` ## πŸ—ƒ Data Not applicable. The paper describes a software system; the platform itself (TypeScript/Python) is maintained in the spbgit repository `vquant.git` and deployed on the MacLustr cluster. ## πŸ”¬ Methodology 1. **Architecture description** β€” components, data layer, model layer, as implemented at commit `e2a148a` (Β§3). 2. **Mechanism specification** β€” transport, recursive loop (Algorithm 1), batching, routing, three-stage context management (Algorithm 2), token correction, single-call convention (Β§4). 3. **Execution substrate, document pipeline, illustrative walk-through** β€” no numbers reported (Β§5). 4. **Design rationale, threats to validity, reproducibility, proposed evaluation protocol (not executed)** β€” task suite, metrics (incl. unsupported-number rate), ablations, baselines, controls (Β§6). 5. **Appendix** β€” prompt structure, persistence schema, numerical closed forms, event types, and the claim-by-claim **audit table against the code**. ## πŸ–Ό Figures & tables inventory | Figure (TikZ) | Content | |---|---| | `figures/architecture.tex` | end-to-end platform architecture | | `figures/loop.tex` | recursive tool-calling loop | | `figures/context.tex` | two-stage context management | | `figures/sandbox.tex` | inter-process Python sandbox | | `figures/streaming.tex` | SSE event dispatch | | `figures/docpipeline.tex` | unified document pipeline | Tables (`paper/tables/*.tex`): tool catalogue (generated), model layer, streaming events, design rationale; appendix tables: persisted entities, code audit (longtable). ## ⚠️ Limitations - Design-science description only: **no evaluation** (accuracy, hallucination rate, latency, cost, ablations, baselines). The protocol of Β§6.6 is pre-registered in the text but has not been run. - Describes one commit (`e2a148a`, 2026-10-02) of a system that keeps changing; counts and constants are facts about that commit. - Outputs are not strictly reproducible (temperature 1, no seeds, model-authored code); the design is. - Known defects surfaced by the audit and not yet fixed in the code: no recursion-depth bound; single $3/$15 price schedule for all models; six numerical handlers unreachable (not in the catalogue) while the prompt still advertises two of them; the sandbox is process isolation, not a security boundary. - Reproducing the *platform* requires the private `vquant.git` code base and API keys. ## πŸ“ Citation ```bibtex @techreport{boucher2026vquant, author = {Boucher, Simon-Pierre}, title = {VQuant: An Agentic Large Language Model Architecture for Automated Quantitative Financial Analysis and Document Generation}, institution = {Universit\'e du Qu\'ebec en Outaouais, D\'epartement des sciences administratives}, type = {Working Paper}, number = {13}, year = {2026}, month = {October}, note = {Version 1.1} } ``` ## πŸ‘€ Author & contact **Simon-Pierre Boucher** β€” DΓ©partement des sciences administratives, UniversitΓ© du QuΓ©bec en Outaouais (UQO), Gatineau, QC. πŸ“§ [simon-pierre.boucher@uqo.ca](mailto:simon-pierre.boucher@uqo.ca) ## πŸ—’ Notes - **Revision 2026-10-17 (v1.1)**: full editorial-board review β€” `docs/REVIEW-REPORT.md` (diagnosis, methodology verdicts, literature, maturity) and `docs/CHANGELOG-REVISION.md` (every corrected statement with its evidence in the code, references added, items not executed). Pre-revision state: git tag `pre-revision-20261017`, `docs/main_pre-revision-20261017.pdf`. Bibliography 20 β†’ 46 entries, all verified (Crossref, arXiv, conference proceedings; one entry flagged as withdrawn by its authors). Sections 5 and 6 were renamed from "Results"/"Performance, Reliability, and Security" to "Execution Substrate … and an Illustrative Walk-Through" and "Design Rationale, Threats to Validity, and a Proposed Evaluation". - Numbering: first circulated as β€œWorking Paper No. 10” (June 2026); renumbered **13** on 2026-10-17 because No. 10 is *The Assessment Gap in Quebec* (see `Recherche-UQO/HARMONISATION.md`). - Cover date normalised from β€œJune 13, 2026” to β€œJune 2026” (harmonisation), then β€œOctober 2026” (revision). - The VQuant platform code is not in this repository (spbgit `vquant.git`); `docs/verify/` contains the audit script and its JSON outputs, not the code.