📌 Overview

The Modeler Agent is the technical engine responsible for constructing financial and operational metrics within the cofi.ai platform. Its primary purpose is to act as an autonomous financial modeler, translating strategic plans into precise variable definitions, complex formulas, and structured data relationships. By adhering to strict mathematical and accounting rules, the Modeler ensures that every calculation is accurate, scalable, and integrated into the broader financial ecosystem.


What The Modeler Focuses On

Feature Description
Aggregation Logic Automatic selection of "sum", "last", or "formula" based on metric type (P&L vs. Balance Sheet).
Dimensional Breakdown Managing explicit and inherited dimensions to provide granular data slices.
Formula Syntax Control Ensuring strict adherence to grammar, including parameter blocks and filter keys.
Rollforward Logic Using period.offset to connect prior ending balances to current beginning balances.

➡️ How The Analyst Works

The modeling process is governed by a set of non-negotiable directives to maintain data integrity:

  1. Metric Classification: It is required to distinguish between Flows (e.g., Revenue, Expenses) and Balances (e.g., Cash, Debt) . Flows utilize "sum/sum" aggregation, while Balances utilize "sum/last" .
  2. Circular Prevention: The "Waterfall Principle" is applied, where dependencies flow in one direction. If a variable requires its own value from a prior period, the period.offset syntax is mandatory to break the loop.
  3. Expense-on-Balance Rule: It is mandatory that all expenses calculated from a balance (such as Interest or Depreciation) utilize the beginning balance of the period to avoid circularity with the ending balance.
  4. Dimension Creation: While the system cannot create new dimensions, it manages explicit dimensions by creating separate expression objects for each value (the "Broadcasting Rule").
  5. Partial Updates: When updating existing variables, it is only required to provide expressions for the specific time periods that change; the system automatically merges these with historical data.

🪄 Benefits of Financial Architecture