Abstract
Pythia Analytics is an investment research system built around a strict boundary: deterministic financial logic owns the numbers, while AI helps explain, check, and operationalize the research. The product combines valuation models, saved analyses, portfolio workflows, app-run execution, Supabase persistence, approval gates, and public documentation into one stateful workflow.
The diagrams below are the shortest accurate version of the architecture.

1. Why The App Exists
The original problem was not "build an AI stock picker." It was more practical: investment research falls apart when evidence, valuation work, notes, portfolio decisions, and trade follow-through live in separate places.
Pythia tries to make that work stateful. A single analysis should become durable research state. A portfolio decision should be connected to the research that justified it. A trade outcome should be reviewed against the thesis that created it. AI can help compress and explain the system, but it should not replace the system.
2. The Core Architecture
The app is a Dash application with route-level pages, shared services, deterministic valuation logic, and Supabase-backed persistence.
The important boundary is not framework-specific. It is epistemic:
- UI surfaces let the user inspect and act.
- Deterministic services compute prices, metrics, valuation outputs, freshness, and policy gates.
- Supabase and
app_runspreserve durable state and audit history. - LLM/agent layers interpret, summarize, draft, and propose next actions.
- Human approvals remain the gate for durable writes and sensitive actions.
That is why the diagram separates user surfaces, Pythia services, app-run runtime, Supabase, and orchestration instead of showing one giant AI box.
3. Saved Analysis Is The Product Spine

The strongest product idea in Pythia is that saved analysis is not a PDF-style output. It is reusable app state.
A ticker run can produce deterministic valuation tables, peer context, market evidence, commentary, and recommendation logic. Once saved, that record can be revisited and reused by Portfolio Lab, Master Synthesis, recommendation review, thesis tracking, and later comparisons. The app becomes more useful as research accumulates because prior work remains queryable and operational.
4. Quant First, AI Second

The quantitative layer includes financial statements, metrics, industry averages, competitor context, historical comparisons, valuation methods, blended fair value, and structured evidence bundles. Commentary is downstream of that layer.
This is the most important technical claim in the app: AI does not create the financial truth. It interprets an evidence package that the deterministic pipeline prepared. That keeps the work inspectable. It also gives the model something better to do than guess: explain the contradiction, compare the peer set, challenge a valuation assumption, or write a thesis-breaker.
5. Runtime, Agents, And Approvals
Pythia uses app_runs and app_run_events as the durable runtime backbone. Background work can be queued, logged, inspected, retried, and surfaced through Activity Center. AG-UI-style live streaming can make the UI feel immediate, but it projects existing run events rather than replacing them.
Agent workflows follow the same rule. The agent can classify intent, read substrate data, prepare drafts, and create approval requests. It should not silently write a portfolio, promote memory, or trigger expensive actions without the user seeing the decision boundary.
6. Tenant Boundary

The security model has to preserve user-scoped research, portfolios, settings, approvals, and drafts. Browser sessions, app routes, Supabase RLS, service-role background workers, and public launch assets are different trust zones.
That distinction matters because some background workers need service-role access outside a browser request. Service role does not mean unbounded product behavior. The worker still needs user identity, run context, table scope, and audit records.
7. What This Proves
Pythia is not impressive because it has an AI layer. Many apps do. The more interesting part is that the AI layer is constrained by a product architecture: deterministic valuation, durable saved research, user-scoped persistence, approval gates, and replayable workflows.
That is the technical thesis: a useful AI finance product should make the underlying evidence more inspectable, not less.