Quantifact · an open-source evidence compiler for investment research

Compile investment questions into evidence that can be challenged.

Quantifact limits the error space around model-generated investment analysis. Follow a real question through research definition, point-in-time data, typed compilation, controlled execution, falsification-aware review, and safe learning.

System engineering view

Separate runtime, platform controls, and governance.

The system boundary makes authority explicit. Three online subsystems compile evidence; shared services own models, data, execution and artefacts; the fourth subsystem governs learning outside the live success path.

Quantifact investment research system architecture System engineering view of Quantifact. External experts and model providers connect through explicit interfaces. Inside the system boundary, research understanding, analysis compiler, and controlled execution form the online evidence path. Shared model, point-in-time data, execution, cache, and evidence services support that path. Organisation learning is an offline governance subsystem that consumes feedback and traces, then publishes only human-approved versioned changes. QUANTIFACT Investment Research System Architecture Evidence compilation · controlled execution · governed organisational learning EXTERNAL RESEARCH EXPERT question · plan review · evidence review · approval MODEL PROVIDER planning · code generation · optional critique QUANTIFACT SYSTEM BOUNDARY models cannot bypass orchestration, data policy, execution or release gates ONLINE RUNTIME PLANE 01 · RESEARCH UNDERSTANDING Define admissible research Clarify definitions, horizon and as_of Retrieve permitted context and data Bind claims, rivals and falsifiers ResearchDesign + AnalysisPlan 02 · ANALYSIS COMPILER Constrain implementation Compile typed plan / IR Generate task functions in parallel Inspect AST and derive actual DAG CheckedFunctions + DependencyDAG 03 · CONTROLLED EXECUTION Materialise verified values Execute through PIT-bound loaders Enforce contracts and reasoning gates Cache, targeted repair, self-review VerifiedRun | NamedFailure EVIDENCE PRODUCT Reviewable evidence package Report · derived data · source code Verdicts · lineage · fingerprints · receipt Assumptions · rival explanations · limits decision support · never an autonomous trade SHARED CONTROL + PLATFORM PLANE PIT DATA + RETRIEVAL catalog · vintages · citations · entitlements Adapters are the data trust boundary MODEL GATEWAY typed provider interface · retries · traces No terminal, data or orchestration authority EXECUTION + CACHE harness · isolation boundary · value cache System invokes code; the model does not EVIDENCE + OBSERVABILITY STORE plans · code · verdicts · traces · artefacts Reproducible inputs for audit and learning OFFLINE GOVERNANCE PLANE 04 · ORGANISATION LEARNING feedback + traces → reproduce failure → benchmark → context / harness change → full regression → human approval APPROVED RELEASE ARTEFACTS context · policy · benchmarks · next version audited traces accessed only through Model Gateway typed control / evidence interface service dependency governed lifecycle FAIL CLOSED · TRACE EVERYTHING · CLAIM ONLY WHAT THE DESIGN SUPPORTS
01 · research understanding

Make the question admissible

Prevents precise answers to vague or hindsight-defined questions.

  • communicate and clarify
  • retrieve context, documents and data
  • fix definitions, claims, rivals and falsifiers
OUT → ResearchDesign + AnalysisPlan
02 · analysis compiler

Constrain implementation

Prevents generated code from silently changing the research design.

  • compile the typed plan
  • split tasks and generate functions in parallel
  • derive and cross-check the actual DAG
OUT → checked functions + DAG
03 · controlled execution

Materialise verified values

Prevents terminal autonomy, look-ahead, skipped checks and wasteful reruns.

  • static inspection and PIT loaders
  • cache, layered validation and repair
  • self-review, report and receipt
OUT → evidence package or failure
04 · organisation learning

Improve without silent drift

Prevents user feedback from becoming an untested production mutation.

  • capture and reproduce a missed failure
  • create a benchmark and candidate change
  • full regression and human approval
OUT → versioned lesson + benchmark
Investment research workflow

From expert question to compounding research memory.

The success path produces evidence. Learning is a separate governed loop: only an audited failure or expert correction enters it.

01
Expert contextidentity, permissions, workflows
02
Clarifydefinition, horizon, as_of
03
Fix the designclaims, rivals, evidence tasks
04
Compiletyped tasks, schemas, DAG
05
ExecutePIT loaders, cache, traces
06
Verifycontracts, repair, self-review
07
Deliverreport, code, receipt, lineage
08
Learn safelyfailure → benchmark → review
Governance boundary: lessons never merge themselves. A candidate change must reproduce the failure, fix it, pass the full suite, and receive human approval.
Critical investment reasoning

The plan states what the evidence may—and may not—support.

Reproducible code can still answer the wrong question. Claims, rival explanations, falsifiers, and limitations are registered before results are known.

Point-in-time

The answer only knows what was knowable then.

The same question at two knowledge dates produces two defensible answers. Late observations are never handed to generated code, and the dates cannot share a cache key.

Two dates, two evidence sets

The boundary is architectural

prices = load_series("MKT.BRENT.CO.TRI")
# loader already bound to the plan's as_of date

load_series("MKT.BRENT.CO.TRI", as_of="later")
# rejected before execution
Compiled plan

Click through the work before trusting the chart.

These are the tasks produced for the bundled research question. Each is a function contract, not a prose to-do: its inputs and output schema exist before code generation.

Reproducible benchmark

Iteration cost follows the changed subgraph.

The numbers below come from the bundled deterministic backend. Run qf bench on your machine; they describe the mechanism, not a universal latency claim.

Execution time

What the cache changes

Cache identity includes normalized code, upstream keys, data fingerprints, runtime identity, and the knowledge date. A cosmetic code change does not invalidate values; a changed definition does.

Open source

Help make research failures harder to hide.

The most valuable contributions are adapters with honest vintage semantics, workflows with explicit expected results, contracts that catch real mistakes, and evaluations that expose a missed failure.

Run the complete example locally

Synthetic data, deterministic backend, no credentials.

uv add git+https://github.com/leoncuhk/quantifact
qf ask --receipt .qf/run.json