Ryan Yang

Featured projectsProject

IBKR Agent Harness

Research tools · Open source

An investment memo you can trace back to its inputs.

IBKR Agent Harness combines local brokerage data with public market and filing research. A stateful workflow keeps the investment policy, inputs and approvals available across research steps.

IBKR Agent Harness commands in a terminal on a tablet, in window light.
Role
Author
Timeline
Nov. 2026
Platform
Python 3.11+ · MCP
Status
Open source · MIT

01

Overview

A local-first investment workspace for Interactive Brokers: brokerage statements and free public data become policy checks, valuation, risk and research workflows, with a language model doing the reading and plain Python doing every number.

02

Contributions

  1. 01

    Kept every number deterministic: reconciliation, DCF, covariance risk, Black–Scholes and backtests run in plain Python with Decimal, so the model never does arithmetic.

  2. 02

    Split the MCP server into two planes. Private ledger tools bind to a local model, and --public-only removes them from the process before any research is sent to a cloud API.

  3. 03

    Compressed the first-turn portfolio state from about 60 KB to 3.8 KB (93.7%) so it fits a 32K-context local model.

  4. 04

    Built seven stateful workflows that checkpoint in SQLite and stop at awaiting_approval. The model has no approval tool; only the person can commit a decision.

Research workflow

ibkr-agent import-flex activity_flex.xml

Import the statement

Read an Interactive Brokers Activity Flex statement into the local workspace.

ibkr-agent filing-delta NVDA --sync

Compare the filings

Inspect changes in SEC filings alongside the assumptions used in valuation.

ibkr-agent workflows

Review the workflow

List the available workflows, review the resulting research and inspect outstanding approvals.

Python · SQLite WAL · SQLite FTS5 · MCP · Streamlit · Interactive Brokers Flex · SEC EDGAR

System design

Built a Python MCP research harness that checkpoints human approval in SQLite, isolates private ledger tools from cloud research, and keeps financial calculations deterministic.

Implementation notes

Data sources and coverage

03

Outcome

Open source under MIT: 37 read-only MCP tools, a 46-assertion verification suite, 10 of 10 golden evaluation cases passing, and no path to place a trade.

Core stack

Discuss the work

Need implementation detail or engineering context?

Email a specific question about the architecture, trade-offs, or validation approach.

Next project IBKR Portfolio Analyzer Portfolio analytics · Desktop

The studio

Back to the room it all began in.

Every page here is on the computer in that room.

Enter the studio