Brian Douglas - The beginners guide to training AI on your own code - AI Native DevCon June 2026
Summary
This talk outlines a closed-loop system for training AI agents using proprietary code execution traces. The core concept involves capturing every agent interaction (telemetry) via an open-source proxy (tapes.dev), structuring this data into a content-addressable Merkle DAG. This raw trace data is then processed by streaming tools like Kafka and Flink SQL to detect anomalies, which feeds back into the agent's next run—creating a 'self-healing loop.' The captured traces are used for supervised fine-tuning (SFT) or Direct Preference Optimization (DPO) to embed learned skills directly into local models, eliminating reliance on external training data.
Key takeaways
-
Closed-Loop Agent Training
3:50
Agents generate data by running in an environment; this telemetry is captured and used immediately for model improvement. This creates a self-healing infrastructure loop, allowing agents to learn from failures (anomalies) and successes.
-
Data Capture Infrastructure
10:30
The open-source proxy, tapes.dev, intercepts LLM API calls to build a content-addressable Merkle DAG of every conversation turn, requiring zero instrumentation.
-
Anomaly Detection and Feedback
2:00
Streaming pipelines (Kafka/Flink SQL) run continuous anomaly detection on session data (e.g., stuck loops, token spikes). Alerts generated by Flink are read by the agent before its next execution, enabling self-correction.
-
Knowledge Transfer Methods
22:00
Captured traces can be used for Specialized Fine-Tuning (SFT) or Direct Preference Optimization (DPO). SFT embeds skills into the model, while DPO uses preference data derived from successful vs. failed sessions.
Technical details
-
Data Structure and Capture
820s
Tapes.dev captures agent sessions into a Merkle DAG (Directed Acyclic Graph), ensuring every conversation turn is content-addressable and filterable, even across multiple parallel agents.
-
Streaming Pipeline
120s
The pipeline involves publishing events to Kafka, where Flink SQL runs continuous anomaly detection queries (e.g., stuck loop detection in tumbling windows) before generating alerts for the agent.
-
Model Fine-Tuning
1320s
The process involves using raw telemetry to generate clean training datasets, which are then used to fine-tune local models. Specialized Fine-Tuning (SFT) is described as adding 'notes' or skills into the model's knowledge base.
-
Computational Constraints
1580s
The speaker notes that while advanced techniques like DPO are possible, they are computationally expensive (e.g., requiring specialized hardware like H100s) and may not be practical for general use.
Mentioned resources
- tapes.dev
- Kafka / Flink SQL
- Pi Game Boy
Channel & topics
Watch on YouTube · Back to latest
This independent, AI-assisted summary is provided for commentary and informational purposes. It may contain errors or omit important context. Please watch the original video for the creator's complete presentation. Video, thumbnail, and related copyrights belong to their respective owners.