Files
papers/hanzo-self-improving-agents/hanzo-self-improving-agents.tex
zeekayandHanzo Dev b79b939f11 We are based in San Francisco
Every author block and the authorship standard said Los Angeles; Hanzo has
been in San Francisco since at least 2016. The five catalogue PDFs whose
sources changed are rebuilt so papers.hanzo.ai says so too.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-24 16:14:51 -07:00

120 lines
4.7 KiB
TeX

% Hanzo Self-Improving Agents Paper
% Fully self-contained -- no \input{} directives
\documentclass[11pt]{article}
\usepackage{../shared/hanzocover}
\usepackage{amsmath, amssymb, amsthm}
\usepackage{mathtools}
\usepackage{bm}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{hyperref}
\usepackage{enumitem}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{xcolor}
\usepackage[numbers]{natbib}
\usepackage{float}
\usepackage{subcaption}
\usepackage{tabularx}
\usepackage{multirow}
\hypersetup{colorlinks=true,linkcolor=black,citecolor=blue,urlcolor=blue}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}{Definition}
\newtheorem{remark}{Remark}
\newtheorem{assumption}{Assumption}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator{\KL}{KL}
\DeclareMathOperator{\Tr}{Tr}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\E}{\mathbb{E}}
\renewcommand{\Pr}{\mathbb{P}}
\definecolor{hanzoBlue}{RGB}{30,100,200}
\definecolor{hanzoGray}{RGB}{100,100,100}
\definecolor{successGreen}{RGB}{0,140,70}
\definecolor{failRed}{RGB}{180,40,40}
\title{Telemetry-Driven Self-Improvement:\\
Structured Learning Loops for Autonomous Coding Agents}
\author{
Hanzo AI Research \\
Hanzo AI Research\\
\textit{Hanzo AI Inc (Techstars '17), San Francisco, CA}\\
\texttt{[email protected]}
}
\date{February 2026}
\begin{document}
\hanzocoverpage
% ============================================================================
% ABSTRACT
% ============================================================================
\begin{abstract}
We present a \textbf{4-Loop Self-Improvement Architecture} for autonomous coding
agents that replaces aspirational narrative self-reflection with structured,
telemetry-driven optimization. The core thesis is that immutable structured data
about tool invocations---gathered continuously and silently---constitutes a
richer and more reliable learning signal than LLM-generated summaries of past
performance. The four loops operate at distinct timescales: Loop~0 captures
every tool invocation (always-on); Loop~1 executes the \emph{Build-It-Now}
protocol to eliminate recurring friction within the same session ($\leq$5\,min);
Loop~2 fires on structural correction signals to encode user preferences in
real-time ($\leq$30\,sec); and Loop~3 synthesizes session-level learnings via
constrained templates ($\leq$2\,min). Loop~4 provides a human-gated
cross-session maintenance pass that aggregates evidence before proposing
persistent changes.
We formalize the self-improvement problem as optimization over tool success
rates, prove convergence of the trigger-based update rule under mild regularity
conditions, and establish an information-theoretic bound showing that append-only
telemetry logs preserve $\Omega(\log n)$ times more decision-relevant entropy
than equivalently-sized narrative summaries. Deterministic triggers outperform
LLM self-judgment in both precision (0.94 vs.\ 0.61) and recall (0.89 vs.\
0.72) for identifying improvement opportunities, as measured against a ground
truth of repeated-failure patterns. Our architecture extends and complements
bmo~\cite{bmo2024}, ngrok's self-improving agent, and is consistent with the
empirical finding that 11 targeted tool improvements over 100 sessions yield
measurable productivity gains. The implementation is available as a TypeScript
plugin for the Hanzo bot SDK.
\end{abstract}
\tableofcontents
\newpage
% ============================================================================
% 1. INTRODUCTION
% ============================================================================
\input{sections/01-introduction}
\input{sections/02-related-work}
\input{sections/03-the-4-loop-architecture}
\input{sections/04-loop-0-telemetry-pipeline}
\input{sections/05-loop-1-build-it-now}
\input{sections/06-loop-2-active-learning}
\input{sections/07-loop-3-session-reflection}
\input{sections/08-loop-4-maintenance-pass}
\input{sections/09-formal-analysis}
\input{sections/10-anti-patterns-and-design-decisions}
\input{sections/11-implementation}
\input{sections/12-evaluation}
\input{sections/13-discussion-and-future-work}
\input{sections/99-conclusion}
\section*{Reproducibility}
\textbf{Source code.} \texttt{github.com/hanzoai/agents} (commit \texttt{TBD}).\\
\textbf{Build.} \texttt{pnpm install \&\& pnpm build} (Node 20+); harness extensions in \texttt{python/hanzo\_harness} via \texttt{uv sync}.\\
\textbf{Hardware tested.} Apple M-series (M2 Pro/Ultra), x86\_64 Linux with NVIDIA A100/H100.\\
\textbf{Standards referenced.} W3C DID, OpenAI tool-use API, Model Context Protocol (MCP).\\
\textbf{Contact.} [email protected].
\end{document}