# 🤖 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(28%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 production web platform that turns a natural-language request into a > complete, reproducible quantitative financial report. A reasoning-augmented LLM acts as planner > and synthesizer; all numerical work is delegated to a deterministic execution substrate: an > agentic orchestration loop over 200+ tools (265+ market-data endpoints, four web-research > services, a 17-library Python sandbox), a two-stage context-management algorithm for unbounded > conversations, a single-call computation paradigm (data → estimation → figures in one sandboxed > execution), and a unified document pipeline emitting PDF, DOCX, Beamer and spreadsheets with live > formulas from one Markdown artifact. The paper documents each mechanism as implemented so the > design can be reproduced. --- ## 📌 Status | Item | Value | |---|---| | Version | 1.0 (June 2026) | | SSRN | not yet submitted | | Journal | — | | Code & data | methodology / system paper — no empirical pipeline; the platform's source code lives in the spbgit repository `vquant.git` | ## 🎯 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-augmented LLM with a deterministic execution substrate, and argues that the resulting design pattern — *the model plans and synthesizes, auditable code computes* — is reusable beyond finance. Four mechanisms are documented at implementation level: 1. an **agentic orchestration loop** exposing 200+ financial and analytical tools through a constrained function-calling protocol (recursive tool-calling loop, tool-use/tool-result invariant, batched-execution throttle); 2. a **context-management algorithm** preserving coherence over effectively unbounded histories via adaptive summarization under a token budget (two-stage machinery, token-accounting correction); 3. a **single-call computation paradigm** that consolidates data acquisition, estimation and figure rendering into one sandboxed Python execution (inter-process sandbox that exec's model-authored code and captures its figures); 4. a **unified document pipeline** emitting PDF, DOCX, LaTeX Beamer decks and spreadsheet workbooks with live formulas from a single Markdown artifact, streamed through a Server-Sent-Event protocol with eight-way event dispatch. The classical quantitative methods the platform automates are conventional and relegated to the appendix. ## 🏆 Headline results | Object | Value | |---|---| | Tools exposed to the model | 200+ (265+ market-data endpoints, 4 web-research services, Python sandbox) | | Scientific libraries in the sandbox | 17 | | Model round trips per computation | 1 (single-call paradigm) vs. several in a naïve agent | | Output formats from one artifact | PDF, DOCX, Beamer, XLSX (live formulas) | | Streaming protocol | SSE, 8 event types | ## 🗂 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, models, events, robustness ``` No `src/`, `scripts/` or `data/`: the paper has no empirical pipeline. ## 🚀 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, invariants and protocols are specified as implemented (§3–§4). 2. **Mechanism walkthroughs** — orchestration loop, context management, single-call computation, document pipeline (§4). 3. **Design evaluation** — qualitative robustness discussion of failure modes and mitigations (§6). 4. **Appendix** — the conventional quantitative methods automated by the platform. ## 🖼 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, models, streaming events, robustness. ## ⚠️ Limitations - Descriptive system paper: no benchmark against alternative agent frameworks is reported. - Tool counts and endpoint inventories reflect the platform as of June 2026. - Reproducibility of the *design* is documented; 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 = {June} } ``` ## 👤 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 - 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”. - The VQuant platform code is not in this repository (spbgit `vquant.git`).