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 the entire system for you. Agent code, logs, traces, evals, and service configuration live in one place and a coding agent can set up the platform, create, improve, and evaluate the agents running on it. Choose the template for your deployment target and paste its prompt into Claude Code, Cursor, or Codex. The prompt clones the template, starts it locally, verifies the MCP endpoint, connects the AgentOS UI, and builds your first agent. Run /deploy-platform from the cloned repository when you are ready to deploy.
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 just as easily.