David ŠarlákJournal
Journal · EN · 6 min read

A Rust starter kit for AI agent apps

David Šarlák · 5 November 2026

Every SaaS with an AI feature starts the same way: sign up, log in, sessions, a database, and an endpoint that talks to a model. None of that is your product, but you rebuild it every time. I got tired of that, so I packaged my own starting point and open-sourced it: rust-agent-starter.

What you get

AreaWhat it does
AuthEmail and password signup, login and logout. Passwords hashed with Argon2id, sessions stored in Postgres with 30-day httpOnly cookies, so restarts do not log anyone out.
DatabasePostgres with sqlx 0.8 and plain SQL migrations. No query! macros, so builds do not need a live database.
AgentAn Anthropic messages API client with a bounded tool-use loop and one example tool you can copy. The loop caps at 5 tool rounds per request.
PagesServer-rendered landing, signup, login and dashboard with maud, so the HTML is type-safe Rust.
OpsDocker setup and GitHub Actions CI running cargo check, clippy -D warnings and tests on every push.

Why Rust

For an agent backend you mostly wait on the model API, so any language works. I still pick Rust: one small binary to deploy, no runtime surprises, and the compiler catches the boring mistakes before my users do. axum 0.8 keeps the routing simple and sqlx keeps the SQL honest.

Run it

cp .env.example .env          # add ANTHROPIC_API_KEY
docker compose up -d db       # start Postgres
cargo run                     # migrates, then serves on :3000

Create an account, open the dashboard and ask the agent something. Then make it yours: add a migration for your tables, add tools in src/agent.rs, restyle the pages.

What it is not

A starting point, not a finished product. Rate limiting, email verification and billing are deliberately left out, because they depend on what you are building. The code is on GitHub: github.com/davidko119/rust-agent-starter.

Product

Rust + AI Agent Starter Kit

The full kit is free and open source on GitHub. A packaged version with extras and setup support is coming to Whop.

View on GitHub
← All articles