検証: Bash+Pythonで自作エージェントハーネスを30分で作る
00:01:31 ・ source: https://zenn.dev/mskbhd/articles/lab-017-bash-python
Transcript
hostenToday we explore how to build an AI agent harness from scratch in just 30 minutes using Bash and Python.
guestja今日は、BashとPythonだけを使って、わずか30分でAIエージェントハーネスをゼロから構築する方法を見ていきます。
hostenAn agent harness is simply the LLM brain plus an execution environment that runs tools and manages context.
guestjaエージェントハーネスとは、LLMの脳と、ツール実行やコンテキスト管理を行う実行環境を組み合わせたものです。
hostenThe core pattern is a simple while loop: the model calls tools, the harness executes them, and results feed back.
guestja核となるパターンはシンプルなwhileループで、モデルがツール呼び出し→ハーネスが実行→結果を返すの繰り返しです。
hostenThe author successfully built a working harness with three tools: bash, file read, and file write operations.
guestja著者は実際に、bash実行・ファイル読み取り・ファイル書き込みの3つのツールを持つ動作するハーネスを作成しました。
hostenThe key insight is that all AI agent frameworks—no matter how complex—just layer protections over this simple 30-line loop.
guestja重要な気づきは、複雑なAIエージェントフレームワークも、この単純な30行のループの上に保護機構を積み上げているだけということです。
hostenBy building this yourself, you gain deep understanding and confidence that you don't need to depend on closed frameworks.
guestja自分で作ることで、エージェントの仕組みを深く理解でき、ブラックボックスのフレームワークに頼る必要がないという自信が得られます。