A simple AI agent loop built with Bash, jq, and curl

A experiment shows that a REPL loop can be built with basic such as Bash, jq, and curl. The agent is a thin wrapper made from several small programs. It uses pipes, text streams, and an append-only history file to pass input, call a model, and continue the conversation.

The design avoids extra runtimes such as Python or Node.js, so the core pieces should work on many Unix-like systems. The connection between the agent and the model is kept inside one , which makes it easier to switch s. Memory and context are stored in a simple append-only history file, so they can be inspected, edited, rewound, or audited by hand.

Extra tools can also be inserted into different stages of the loop to inspect, filter, redirect, or audit what the agent is doing.

Key points

  • The agent REPL loop uses Bash, jq, curl, pipes, and text streams.
  • It avoids Python, Node.js, and other larger .
  • The model connection sits behind one , making provider changes easier.
  • Memory and context live in an append-only history file that can be checked or edited.
  • The loop can add inspection, filtering, redirection, and audit steps between stages.
Read original