miramarlabs.ai
Architecture Overview

Platform

Four independent reasoning loops. One agent identifies opportunities, A second researches companies of interest, a third agent decides whether. A fourth agent decides when. All four route through the same human approval gateway. Everything hitting the brokerage is intent/outcome-recorded.

Key Platform Components

The platform's architecture was using start of the art agentic concepts

Reflection loops in a verifiable domain

Miramar Labs' domain is natively verifiable: the reflection loop compares agent decisions against what the tape actually did. A daily end-of-session post-mortem grades entry, exit, and re-entry calls against realized outcomes; a monthly loop reviews the full corpus of decisions. Neither modifies live behavior directly — the output is human-consumed improvement candidates, one to two reflection passes is the sensible cost ceiling before diminishing returns.

Multi-agent decomposition

Miramar Labs runs multiple coordinated reasoning agents rather than one monolithic one: a primary agent that answers whether a security warrants a position, and a separate intraday agent that answers when within the trading day to open it. They share state, the human approval gateway, and the audit ledger — but reason independently on distinct problems. Coordination primacy (deliberate contracts between the agents' shared stores) and cost awareness (per-agent budgets) — the two dimensions cited as absent from standard multi-agent evals — are built into the architecture rather than bolted on.

Trace-based evaluation

Trajectory-level evaluation isn't retrofitted onto Miramar Labs — it's a property of the state-checkpointing infrastructure. The reasoning agent's stateful graph writes to a persistent store after every node execution, so any historical decision replays node-by-node: which tools were called, what raw data came back, how the reasoning progressed, what the validator said, what the operator decided. The forensic material for trajectory scoring exists by construction; a dedicated evaluation layer grades those trajectories against realized outcomes at multiple horizons — see the design below.

Learning without retraining memory taxonomy

Episodic memory isn't passive storage — it's queried before the reasoning engine fires. The agent first retrieves the platform's prior decisions on the same name at comparable price and thesis conditions: earlier HOLD verdicts, prior BUY proposals that succeeded or failed, and the justification the reasoner recorded at the time. A ticker that was passed on last week with the same setup does not get re-reasoned from scratch this week — the prior verdict is surfaced as context, and the agent must either confirm the earlier call or explicitly justify overriding it.

Risk-tiered human-in-the-loop

The human approval gateway is non-bypassable and creates a friction gate + audit trail — but it is not the primary defense. Structural limits run first: capital allocation caps, per-symbol position guards, account and hostname verification, volatility-aware exit floors with an absolute cap even on operator overrides, and structural risk checks with auto-pass semantics on re-entry contradictions. Every force override is audit-logged with the platform's chosen value, the operator's value, and the operator's stated reason. This matches the risk-tiered HITL pattern the 2026 EU AI Act high-risk obligations (effective August 2, 2026) require for AI in regulated industries.

The through-line across all five points: the platform treats structural correctness — verifiable outcomes, decomposed agents, trajectory-recorded state, typed memory, pre-approval guards — as the primary safety substrate. Human review and reflection are the slower, higher-quality outer loops. Neither layer is asked to do the other's job.


Multiple agentic reasoning loops

Most systems conflate distinct decisions into a single reasoning pass — whether a security warrants a position, and when within the trading day to open it. Miramar Labs separates them into independently-scheduled agents that share state, the approval gateway, and the audit ledger, and reason independently on distinct problems.

Primary agent — whether

Evaluates fundamentals, event history, sentiment, technical posture, institutional flow, and cross-market risk. Produces a structured trade proposal with a natural-language justification.

Intraday agent — when

For each security the primary agent has approved, watches the intraday tape for the platform's entry pattern to form and sustain. Setups are scored by cosine similarity between the current market-state feature vector and reference vectors of prior high-quality entries — pattern matching in vector space rather than a rule-based threshold cascade. Only when the similarity, the sustain-verification checkpoint, and the universal risk gate all pass does it propose an entry.

Agentic research

Behind the decision loops sits a continuous research pipeline. It's a chain of specialist agents — each a purpose-built reasoner producing a structured artifact — that collectively maintain the context the primary agent will reason over. The reasoning engine doesn't fetch the world at decision time; it inherits a pre-digested, always-fresh view of the world that the research pipeline keeps current.

The specialists cover:

A synthesis agent then reads across all of the specialists, cross-references them against the cross-market risk gate, and produces a ranked briefing the operator can consult at any time. The primary reasoning agent — the one deciding whether a security warrants a position — consumes the briefing as tool-callable context rather than re-fetching every input from scratch.

Isolation by construction. None of the research agents place orders. None of them touch the state the trading daemons depend on. Their output is markdown artifacts and structured JSON. A stale or failed research run is visible to the operator — the briefing simply reflects the last successful pass — but cannot cause a bad trade. It can only fail to inform a good one.

The reasoning engine

A central LLM agent operates as the sole trade decision authority. It's implemented as a directed stateful graph; state is checkpointed to a persistent store after every node execution. Full crash recovery. Full replay. Full audit.

Its distinguishing choice: the agent receives raw source values with human-readable annotations — RSI with threshold notes, MACD with trend classification, historical event outcome records with per-period surprise, sentiment score with article count. Never a pre-cooked composite score. This lets the reasoner apply domain knowledge directly to source values rather than inheriting brittle threshold tuning from a scoring layer above it.

Trace-based evaluation

The reasoning engine's audit trail isn't just for forensics — it's the input to a two-layer post-hoc evaluation that grades every decision against what the market actually did.

Judge over the trace

Once outcomes have settled, an LLM judge re-reads the original decision trajectory — the tools invoked, the raw data returned, the reasoning steps recorded, the validator verdict, the trap-scan result — alongside the realized outcome, and scores whether the reasoning path was correct in retrospect. Not "did the trade make money," but "given what the agent saw and how it reasoned, was the verdict defensible?"

Self Learning

Aggregate verdicts feed a static calibration document that is injected into the reasoning agent's system prompt at daemon start. Yesterday's misses inform today's decisions: patterns the judge consistently flagged as poorly-reasoned become explicit guidance at the top of the next reasoning cycle. No fine-tuning, no gradient updates, no model retraining. The behavior of the reasoner shifts by editing the context the reasoner reads — which is auditable, versionable, and reversible in a way that weight updates are not.

Dual-pass validation

Every proposal produced by the reasoning engine passes through an independent rule-based validator. The LLM catches qualitative issues: poor signal quality, adverse market conditions, weak fundamental support, contradictory technicals. The rule layer catches quantitative constraint violations: position size limits, portfolio concentration, exclusion list, confidence floor. Neither layer alone is sufficient.


← Back to home  ·  About →