Nyquist logo Nyquist
Back to overview
Architecture

How Nyquist is built.

Why a PM should care how it is built: the whole book is repriced overnight on one calculator, the agents argue over those same numbers, and every figure opens to the filing and the tick that produced it. Below — the gateway, the typed bitemporal store, the agent committee and the audit trail, for the people who want to see it.

01 — System topology

One gateway, a mesh of fault-isolated nodes.

Every request enters through one gateway and fans out to isolated services — each one can fail without taking the platform down.

CLIENT browser · SPA · MCP API GATEWAY manifest router · CORS · auth guard · circuit breakers · per-route timeouts AUTH JWT · sessions CRITICAL ADMIN tasks · models CRITICAL RISK VaR · greeks 2× WORKERS STRESS stream consumer PINNED 1× BACKTEST stream consumer PINNED 1× INGEST ~8 feed loops PINNED 1× AI-AGENTS 36 personas + ~13 MORE POSTGRES orders · fills · positions HOT PATH · AUTHORITATIVE REDIS streams · cache · pub/sub JOB QUEUE · BREAKER STATE CLICKHOUSE bitemporal ontology BACKGROUND WRITE manifest-driven registration · a failed non-critical router returns 404, the gateway stays up auth + admin critical → /health/ready 503 deregisters the replica · workers + ingest pinned 1× · per-router fault isolation
Fault-isolated by default

A failed non-critical router returns 404; the rest of the platform keeps serving. Only auth, admin and datasource-health are critical — their failure deregisters the replica.

One source of routing truth

Every router is registered through a single manifest — module · prefix · deps · critical · node. No second include path. Adding a domain is one manifest entry.

Right-sized nodes

Stateless math nodes scale to N workers; rate-limited feeds and stream consumers stay pinned to 1×. Isolated services behind one gateway.

02 — How a request flows

Two paths: fast reads inline, heavy compute on a queue.

Light calls run straight through a strict layering. Anything CPU-heavy returns a job id immediately and computes on a worker — the user never waits on a blocked request.

REQUEST client call GATEWAY route · guard SYNCHRONOUS · fast reads & light compute ROUTER api/ SERVICE compute REPOSITORY DB only here POSTGRES asyncpg ASYNCHRONOUS · heavy compute (stress · backtest) REDIS STREAM XADD WORKER XREADGROUP JOB HASH status · result 202 + job_id poll GET /job/{id} Pydantic rejects NaN/Inf at the edge · ValueError → 400 · asyncio.to_thread for CPU-bound math · at-least-once delivery · XAUTOCLAIM reclaim · job TTL 24h
Strict layering

Router → Service → Repository. Database calls live only in the repository layer — no SQL leaks into business logic.

Compute never blocks

A stress or backtest call returns 202 + job_id instantly. The client polls a job hash; the worker owns the long-running math.

Safe by construction

Every financial model rejects NaN/Inf at the boundary. ValueError → 400, payloads capped, jobs delivered at-least-once.

03 — Resilience & operations

A bad node fails fast and recovers on its own.

Every proxied node sits behind a circuit breaker. A slow or failing node trips, stops taking traffic, and probes its way back — without a human paging in.

3 failures / 10s after 30s block 1 probe ok → reset to closed CLOSED pass-through OPEN 503 fast-fail HALF-OPEN 1 trial request Redis-backed, keyed by node · liveness and circuit state are orthogonal — a healthy /health does not auto-close the circuit
Health poller

An asyncio task per replica polls each node's /health every 5s with 3-layer jitter. Liveness and circuit state stay independent.

Distributed tracing

OpenTelemetry spans on every request. 10% base sample, 1% on health checks, 100% on 5xx. An X-Trace-Id on every response.

Feature flags

Feature flags with a 60s cache. 3 SDK failures trip a 30s circuit to a safe default — flag-service downtime can never add latency.

04 — The data plane

One typed graph. Every input writes. Every agent reads.

Market data, alt-data and compute analytics flow into a single bitemporal store. Agents query typed objects — not SQL.

ONTOLOGY bitemporal · typed Instrument FINANCIAL Position FINANCIAL VaRReport RISK GreekSnapshot RISK RegimeState RISK VolSurface MARKET DATA PricingModel MODEL Observation ALT-DATA every input writes · every agent reads · one truth on one time axis
Financial seed Risk Model Market data Alt-data
Why this is foundation, not feature

Ask "top-10 option positions by contribution to portfolio Vega, where the vol surface is older than 30 minutes" — and a normal stack runs ad-hoc SQL across five tables with no guarantee the joins are even semantically correct. Multiply that by every desk, every regulator question, every replay request. The ontology removes that whole class of question from the human queue: every computed object is a typed first-class citizen, and the query is a typed traversal — not a SQL gamble.

Without this layer, AI agents cannot reason. With it, a multi-hop question — across positions, models, market data and stress results — answers in one traversal of one graph, with the time axis carried through every hop.

54 typed object kinds across 5 categories — financial seed, alt-data, risk, model, market data. Each typed kind is a roadmap card with its own shipping quarter. See ONT-01 → ONT-12 on the roadmap →

Bitemporal contract

Every fact carries event-time (valid_from / valid_to) and system-time (recorded_at / superseded_at). An audit replay returns what the system knew at any past moment — not what it knows today.

Typed, URN-keyed

Pydantic v2 discriminated union on kind. URN scheme nq:<kind>:<local-id>. ClickHouse ReplacingMergeTree as the materialised store. 49 typed mappers on the read path.

Background write, never blocking

A @persist_to_ontology decorator wraps compute endpoints. ClickHouse outage degrades the graph, never the user request. Native hot-path tables stay authoritative.

The architectural bet. Every audit, every replay, every cross-desk query reads from one truth on one time axis. Building this layer first is what makes every other module Nyquist ships compound instead of fragment.

05 — The agentic core

Roster, debate, orchestrator. The agent stack from three angles.

36 agents, each on a named public investing methodology and its published corpus. Every query runs as a debate cycle (claim, counter, tail-check, consensus), step-by-step logged. The orchestrator N.Y.Q.U.I.S.T. routes the swarm and recomputes every number through a deterministic calculator before delivery.

A · The roster

Named for the methodology they encode.

Each agent runs on a published corpus — books, public speeches, shareholder letters, papers. The lineage is shown in small caps. Three anchors below; all 36 in the roster.

CM
Moat-quality agent
Decision · quality
Munger school

Concentrated quality at fair price. Mental models. "Invert, always invert."

Source corpusPublished books and public speeches — Poor Charlie's Almanack, the USC Law commencement address
SD
Macro-asymmetry agent
Decision · macro
Druckenmiller school

Macro-asymmetric bets. FX/rates/commodities-aware. Position size on conviction.

Source corpusPublic lectures and speeches, including the 2017 Norges Bank talk
MS
Tail-risk agent
Risk · tail
Spitznagel school

Convex tail-risk hedging. "What kills you when nothing's wrong?"

Source corpusPublished books — The Dao of Capital, Safe Haven — and published papers
+32 shipped — contrarian-value, reflexivity, stat-arb, all-weather, margin-of-safety, growth-at-a-reasonable-price, global-value, activist, mean-variance, factor, adaptive-markets, macro-trend, execution-cost, technical, financial-instability, debt-cycle, central-bank, systemic-resilience, lender-of-last-resort, market-cycle agents, others. Each on a published corpus, mapped to a decision domain — debate, risk, execution, systemic, synthesis.

Agents are named for public investing methodologies; the lineage shown is a stylistic homage. Not affiliated with, endorsed by or connected to any named individual, their firms or their estates.

B · How they debate

A claim, a counter, a tail-check, a consensus. Every step logged.

Every query runs a debate cycle: thesis from the quality lens, counter from the macro-asymmetric lens, veto from the convex-hedge lens. Output is consensus — or marked dissent, never a single unchallenged claim.

CM
Moat-quality agent
Munger school · quality
SD
Macro-asymmetry agent
Druckenmiller school · macro
MS
Tail-risk agent
Spitznagel school · tail
N
N.Y.Q.U.I.S.T.
Orchestrator · debate
ThesisAAPL · 7-yr ROIC stable
CounterFX-headwind 2026 · EM rotate
Tailleft-σ=2.4 · convex hedge
Consensushold · size 0.6×
Consensushold · size 0.6×
Consensushold · size 0.6×
Scenario · AAPL · equity
Audit trail · debate #a47fc · pgrep-replayable
14:32:01.04 moat-quality → THESIS AAPL · quality at fair price · 7-yr ROIC stable, capital-light
14:32:03.21 macro-asym → COUNTER FX-headwind 2026 priced in? China rev. -8% YoY underweighted
14:32:05.62 tail-risk → TAIL left-tail σ=2.4 vs SPX 1.7 · OTM put ladder, 80bp drag accepted
14:32:07.88 n.y.q.u.i.s.t → CONSENSUS hold · size 0.6× · 3 dissents logged · numerics recomputed by calculator layer
C · The orchestrator

N.Y.Q.U.I.S.T. — the agent that runs the agents.

A backronym that is a contract. Every letter is a constraint in production code, not a marketing line. The orchestrator routes the 36-agent swarm, recomputes every number through a deterministic calculator, and emits an audit trail at a financial regulator's evidentiary grade.

N
Networked
36 agents share memory. Debate runs in private channels; contested claims surface with explicit dissent.
Y
Yield-aware
Native fixed income, derivatives, rate models. Recommendations are duration-sized and convexity-aware before the desk sees them.
Q
Quantitative
Numbers come from calculators (CVXPY · NumPy · SciPy), not from a language model; the model writes prose around them.
U
Unified
One assistant across all 53 hubs. No surface switching, no context loss.
I
Intelligence
Compact domain SLM on 7,553 regulatory documents. MOEX, FI conventions, ECB stress, IFRS9 CECL — first-pass, not RAG. Not yet serving — no inference capacity, see /roadmap.
S
Synthesis
The moat-quality lens vs the macro-asymmetry lens vs the tail-risk check — all in the audit log. Consensus or marked dissent.
T
Terminal
Bloomberg command-line ergonomics. ⌘K, slash, inline answer. Same muscle memory as a 30-year analyst's tool.

Why it's defensible. Investing is a debate between frameworks. The orchestrator surfaces that debate — agreements, dissents, route taken — instead of hiding it behind one confident answer. Wins the IC meeting and the inspection.

Who decides — and who doesn't. The swarm briefs, argues, recomputes, logs. It never places an order, signs off on a number, or commits capital on its own. Treat it as a research desk on a senior PM's calendar — it does the homework, surfaces the dissent, drafts the memo. The decision, the signature and the accountability stay with the human operator.

Auditable AI

AI that finance teams and regulators can actually trust in production.

A pure calculator recomputes every number before delivery. The model can draft and explain — it cannot invent a final number. What passes the CRO's bar passes the regulator's.

A · Deterministic validation pipeline

A pure calculator recomputes every number before delivery.

LLM call → schema validation → pure-function recompute → drift check → audit log. A language model cannot ship a risk number that hasn't been sanity-checked by deterministic code.

B · Policy-constrained control plane

The AI can only touch what it is allowed to touch.

Domain SLM fine-tuned on 7,553 regulatory documents; runtime through NVIDIA NIM, deployable on-prem or in our managed cloud — not yet serving, see /roadmap. Whitelisted tool registry, enforcement before dispatch. CRO-grade permission model day one.

How every AI-assisted computation flows
Step 01
LLM tool call
Policy-gated dispatch; only whitelisted tools reach handlers.
Step 02
Schema validation
Pydantic types reject malformed or out-of-range outputs.
Step 03
Deterministic recompute
Pure-function calculator runs the same inputs; drift check fires if outputs diverge.
Step 04
Audit log
Append-only record of inputs, LLM output, reference, drift, reviewer.

Thesis: AI becomes usable in regulated finance by making the workflow controllable, auditable and safe. Not by making the model smarter.

See it live

The architecture, running on your data.

Full demo in your browser — no calls, no scheduling. Watch the agents debate, query the ontology, inspect every reasoning step.

In closed beta
Closed beta, by invitation. Seats by request and conversation — start with the pilot form.