Deploy a multi-agent system on Railway.
| Agent | Pattern | Description |
|---|---|---|
| Knowledge Agent | Agentic RAG | Answers questions from a knowledge base. |
| MCP Agent | MCP Tool Use | Connects to external services via MCP. |
# Clone the repo
git clone https://github.com/agno-agi/agentos-railway-template.git agentos-railway
cd agentos-railway
# Add OPENAI_API_KEY
cp example.env .env
# Edit .env and add your key
# Start the application
docker compose up -d --build
# Load documents for the knowledge agent
docker exec -it agentos-api python -m agents.knowledge_agentConfirm AgentOS is running at http://localhost:8000/docs.
- Open os.agno.com and login
- Add OS → Local →
http://localhost:8000 - Click "Connect"
Requires:
- Railway CLI
OPENAI_API_KEYset in your environment
railway login
./scripts/railway_up.shThe script provisions PostgreSQL, configures environment variables, and deploys your application.
- Open os.agno.com
- Click "Add OS" → "Live"
- Enter your Railway domain
railway logs --service agent-os # View logs
railway open # Open dashboard
railway up --service agent-os -d # Update after changesTo stop services:
railway down --service agent-os
railway down --service pgvectorAnswers questions using hybrid search over a vector database (Agentic RAG).
Load documents:
# Local
docker exec -it agentos-api python -m agents.knowledge_agent
# Railway
railway run python -m agents.knowledge_agentTry it:
What is Agno?
How do I create my first agent?
What documents are in your knowledge base?
Connects to external tools via the Model Context Protocol.
Try it:
What tools do you have access to?
Search the docs for how to use LearningMachine
Find examples of agents with memory
- Create
agents/my_agent.py:
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from db import get_postgres_db
my_agent = Agent(
id="my-agent",
name="My Agent",
model=OpenAIResponses(id="gpt-5.2"),
db=get_postgres_db(),
instructions="You are a helpful assistant.",
)- Register in
app/main.py:
from agents.my_agent import my_agent
agent_os = AgentOS(
name="AgentOS",
agents=[knowledge_agent, mcp_agent, my_agent],
...
)- Restart:
docker compose restart
Agno includes 100+ tool integrations. See the full list.
from agno.tools.slack import SlackTools
from agno.tools.google_calendar import GoogleCalendarTools
my_agent = Agent(
...
tools=[
SlackTools(),
GoogleCalendarTools(),
],
)- Edit
pyproject.toml - Regenerate requirements:
./scripts/generate_requirements.sh - Rebuild:
docker compose up -d --build
- Add your API key to
.env(e.g.,ANTHROPIC_API_KEY) - Update agents to use the new provider:
from agno.models.anthropic import Claude
model=Claude(id="claude-sonnet-4-5")- Add dependency:
anthropicinpyproject.toml
For development without Docker:
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Setup environment
./scripts/venv_setup.sh
source .venv/bin/activate
# Start PostgreSQL (required)
docker compose up -d agentos-db
# Run the app
python -m app.main| Variable | Required | Default | Description |
|---|---|---|---|
OPENAI_API_KEY |
Yes | - | OpenAI API key |
PORT |
No | 8000 |
API server port |
DB_HOST |
No | localhost |
Database host |
DB_PORT |
No | 5432 |
Database port |
DB_USER |
No | ai |
Database user |
DB_PASS |
No | ai |
Database password |
DB_DATABASE |
No | ai |
Database name |
RUNTIME_ENV |
No | prd |
Set to dev for auto-reload |