Get the latest tech news

Coding agent in 94 lines of Ruby


“It’s not that hard to build a fully functioning, code-editing agent.” Thorsten Ball

Under the hood, tools are simply functions with descriptions of their purpose and expected parameters, formatted in LLM-recognizable ways. Remarkably, adding just these 3 tools to an LLM-connected chat loop transforms the program into a coding agent capable of building your next startup. The gem recognizes this format, translates it to a tool instance method call, and passes the response back to the LLM.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of ruby

ruby

Photo of agent

agent

Photo of lines

lines

Related news:

News photo

Forget IPs: using cryptography to verify bot and agent traffic

News photo

Ruby 3.5 Feature: Namespace on read

News photo

LSP client in Clojure in 200 lines of code