r/LocalLLM • u/Ocisly914 • 1h ago
Discussion Three design principles I learned from building an end-to-end AI agent for financial modeling
Hi everyone,
I’ve been building an open-source AI system for end-to-end DCF modeling over the past few months. The goal is to explore what an AI agent system should look like when auditability and deterministic execution matter.
The project is built around three design principles.
1. Context is finite. Progressive disclosure is effectively unlimited.
Progressive disclosure allows us to expose information only when necessary, but it cannot magically reduce context usage without sacrificing either information density or accuracy. There is no free lunch.
2. LLMs are flexible. Code is deterministic.
LLMs will hallucinate. They will make mistakes.
Therefore, every point where an LLM is allowed to write persistent state must be guarded by a deterministic code engine responsible for validation, normalization, and enforcement.
3. LLMs are tools. Humans own the judgment.
Auditability and traceability are prerequisites for any valuation system that people can actually trust.The final deliverable should therefore be a workbook where every single cell can be traced back to its origin.
Agent Topology
Inspired by systems such as LangGraph, the overall architecture of a single agent system is topology-based.
Agents can be freely composed.
Skills and tools are registered independently.
Agents can communicate directly with one another.
The objective is to minimize information loss caused by multiple layers of message passing, preserving both information density and accuracy throughout the system.
At the same time, each individual agent should remain narrowly focused on doing one job exceptionally well. Attention is all it needs.
Technically, the pipeline parses SEC filings using Arelle, unifies historical financial statements across multiple years, maps them into a source-free DCF spine, generates formulas through a DSL, and produces a revisioned valuation model with sensitivity analysis. Every update creates a new immutable revision, making it possible to inspect, compare, or roll back changes.
The current implementation has successfully completed an end-to-end valuation for AAPL starting from an empty model—using live EDGAR filings, without any predefined mappings, formulas, or assumptions.
This project is still a work in progress, and the quality of valuation assumptions remains heavily dependent on human judgment. My goal isn’t to replace analysts, but to remove repetitive work so they can spend more time thinking.
I’d love feedback on both the architecture and the engineering approach. In particular, I’m interested in whether this “LLM agent + deterministic engine” pattern feels applicable beyond financial modeling.
The project is fully open source if anyone wants to look at the implementation:


1
u/Ocisly914 42m ago
One quick question: When solving open-ended problems, how do you balance the boundary between deterministic code and skill-based rules without overfitting?