QuantLink AI · AI Agents

An AI notebook agent that checks its own work.

I built a grounded, self-checking AI agent that writes and edits research notebook cells against a live Python kernel. Before an edit can be applied, the agent parses the code, validates every SQL query and grounds it to the real datasets, and checks its numbers against cited evidence. I also built the runtime underneath: isolated kernels, signed and renewable access grants, and live recovery.

No edit lands unchecked.

The model proposes code; deterministic checks decide whether it can be applied.

  • Every proposal and edit is parsed as Python, held to the notebook cell contract, and each static SQL query is validated with the data layer's own guard and grounded to the dataset that publishes it. Failures return to the model with the exact problems so it repairs and retries: a JOIN on an unpublished table is refused, never guessed at.
  • Grounded in what actually exists: token-scored search over a hash-sealed manifest of 725 analytics operators, warehouse discovery that reads catalog metadata without fetching data, and numeric grounding that matches reported figures to cited evidence by exact Decimal comparison.
  • Context engineering under a hard five-tool budget: a compact notebook index plus a read tool for full cell source.

A runtime built for untrusted code.

Agent-written code runs in real Jupyter kernels, so every run is isolated and every credential is short-lived.

  • Isolated runs: each gets a fresh kernel and a private workspace, under a signed grant bound to the run, the notebook and its exact revision.
  • Renewable access without leaks: short-lived data grants are refreshed into a running kernel through a silent, history-free execution and masked in all output, so credentials never surface in a notebook.
  • Recovery without surprises: live kernels survive reconnects with state intact and no cell ever replayed, while dead kernels are caught by a bounded liveness check and replaced. Streamed agent events persist with idempotent retries and replay with their original boundaries; provider rate limits retry within a strict budget.

Merged into the product; agent access gated.

  • Verified end to end on staging: Python, Markdown, DataFrames, interactive Plotly, an authenticated data fetch, and save and reopen. In production, notebooks run on this runtime and are open to paid users; the AI agent stays limited to internal and pilot teams.
  • Notebooks reach 115 warehouse datasets through the authorized catalog, with access and plan checks first. In the flagship demo the agent builds a sector-rotation study stage by stage (universe, signal, backtest with 10 bps costs, evaluation). Executed outputs like these also power Notebook Dashboards.