Skip to main content
This template runs AgentOS and PostgreSQL with pgvector on Railway. It includes example agents ready to use after deployment, automatic HTTPS (handled by Railway) and public domain (your-app.up.railway.app).

Prerequisites

Step-by-Step Guide

1

Set up Python environment

uv venv --python 3.12
source .venv/bin/activate
2

Install Agno

uv pip install -U 'agno[infra]'
3

Create project codebase from template

ag infra create --template agentos-railway --name my-agentos
cd my-agentos
The template includes the following agents ready to use after deployment:

Pal

Personal assistant that learns from you. Stores notes, bookmarks, and research findings.

Knowledge Agent

RAG agent that answers questions from your documents. Pre-loaded with Agno docs.

MCP Agent

Connects to external tools via MCP. Extensible with any MCP-compatible service.
4

Set your API key

export OPENAI_API_KEY=sk-***
5

Login and deploy to Railway

railway login
./scripts/railway_up.sh
It takes ~2 min and creates the project, provisions PostgreSQL with pgvector, and deploys your AgentOS.
6

Get your domain

railway open
Find your URL in the dashboard (e.g., my-agentos.up.railway.app). Navigate to <railway-domain>/docs to see your AgentOS API.
7

Connect to your AgentOS Control Plane

  1. Go to os.agno.com
  2. Click “Connect OS” → Select “Live”
  3. Paste your Railway domain
AgentOS connection dialog
Your AgentOS is live on Railway! Manage it from os.agno.com

Tips

TaskCommand
Deploy updatesrailway up --service agent_os -d
View logsrailway logs --service agent_os
Open dashboardrailway open
Set env variablerailway variables set KEY=value
Stop servicerailway down --service agent_os
Scale replicasEdit railway.json: {"deploy": {"numReplicas": 2}}
Switch modelrailway variables set ANTHROPIC_API_KEY=sk-ant-***

Troubleshooting

Install: brew install railway (Mac) or npm install -g @railway/cli
Run railway init first, then ./scripts/railway_up.sh again.
PostgreSQL takes ~30s. Check: railway logs --service pgvector
Container starting. Wait 1-2 min. Check: railway logs --service agent_os