Tiny Rust agent with persistent memory. Super simple, just to understand how it all works.
cp .env.example .env
# Edit .env and add your Anthropic API key
cargo runA REPL (Read-Eval-Print Loop) that reads a prompt from stdin, sends it to the Anthropic Messages API, and prints the response. Single-turn only: no conversation history, no system prompt, no memory.
┌─────────────────────────────────────────────────────┐
│ REPL Loop │
│ │
│ ┌───────────┐ ┌───────────┐ ┌─────────────┐ │
│ │ Read │───▶│ Build │───▶│ Call │ │
│ │ user │ │ API │ │ Anthropic │ │
│ │ input │ │ request │ │ API (HTTP) │ │
│ └───────────┘ └───────────┘ └──────┬──────┘ │
│ │ │
│ ┌───────────┐ ┌───────────┐ │ │
│ │ Print │◀── │ Extract │◀──────────┘ │
│ │ to │ │ reply │ │
│ │ stdout │ │ from JSON │ │
│ └───────────┘ └───────────┘ │
│ │ │
│ └──────── loop back to "Read user input" ─────│
└─────────────────────────────────────────────────────┘