Skip to main content
Every company building agents builds the same system from scratch:
  • A server to run the agents (batch, streaming, or background mode).
  • A database for storing sessions, runs, traces, and memory.
  • Auth and RBAC, validated via JWT or service-account tokens.
This system is called an agent platform and today I’ll show you how to build the foundation once so every new agent slots into the same runtime, storage, and connectors.

Built by coding agents

The best part about building an agent platform is that coding agents can build this entire system for you. Agent code, logs, traces, evals, and the live service live in one place, so a coding agent can set up the platform, then create, improve, and evaluate the agents running on it. It would be surprising if your agent platform wasn’t agentic in itself! I’ve curated a set of prompts that you can give your coding agent to do exactly that. Pick your cloud, copy the prompt into Claude Code, Cursor or Codex, and it’ll take you from zero to a running platform:
For more details, see: AgentOS on Railway.

Build it step by step

It’s true that we only learn when we build things ourselves, the old-fashioned way. So the rest of this guide builds the same platform by hand. We’ll use the AgentOS on Railway template as our starting point, but you can swap it for your cloud provider equally as easily.
StepWhat happens
Run LocallyRun your agent platform (AgentOS + Postgres) locally using Docker.
Create an AgentCreate a new agent with Claude Code.
Improve an AgentUse Claude Code to read container logs and improve an agent.
Run on RailwayDeploy the platform to Railway with JWT auth on.
EvalsLock in behavior with regression tests.
Next StepsTeams, workflows, scheduling, and Slack interfaces.