Welcome to Agent OS Railway: a robust, production-ready application for serving Agentic Applications as an API on Railway. It includes:
- An AgentOS instance: An API-based interface for production-ready Agentic Applications.
- A PostgreSQL database for storing Agent sessions, knowledge, and memories.
- A set of pre-built Agents, Teams and Workflows to use as a starting point.
For more information, checkout Agno and give it a ⭐️
Follow these steps to get your Agent OS up and running:
Get Docker Desktop should be installed and running. Get OpenAI API key
git clone https://github.com/agno-agi/agent-infra-railway.git
cd agent-infra-railwayWe use GPT 5 as the default model, please export the OPENAI_API_KEY environment variable to get started.
export OPENAI_API_KEY="YOUR_API_KEY_HERE"Note: You can use any model provider, just update the respective agents, teams and workflows and add the required library in the
pyproject.tomlandrequirements.txtfile.
The application can be run on two environments:
Locally using Docker Compose or on Railway using the Railway CLI.
Run the application using docker compose (Remove the --build flag if you already have the image built):
docker compose up -d --buildThis command starts:
- The AgentOS instance, which is a FastAPI server, running on http://localhost:8000.
- The PostgreSQL database, accessible on
localhost:5432.
Once started, you can:
- Test the API at http://localhost:8000/docs.
- Open the Agno AgentOS UI.
- Connect your OS with
http://localhost:8000as the endpoint. You can name itAgentOS(or any name you prefer). - Explore all the features of AgentOS or go straight to the Chat page to interact with your Agents, Teams and Workflows.
When you're done, stop the application using:
docker compose downTo deploy the application on Railway, please follow the steps below:
- Install the Railway CLI (More details here):
brew install railway- Login to your Railway account:
railway loginNote: Remember to either export the OPENAI_API_KEY environment variable.
- Run the deployment script:
./scripts/railway_up.sh- Monitor the deployment (Optional):
railway logs --service agent_os- Access the application via the Railway UI:
railway open-
In the CLI, you will see the domain of your application. Click on it to access your AgentOS FastAPI server. You can navigate to
<railway-domain>/docsto access the API documentation. -
On Agno AgentOS UI, connect your OS with the domain you just created.
- Open the Agno AgentOS UI.
- Connect your OS with
<railway-domain>as the endpoint.
Congratulations! You have successfully deployed Agent OS on Railway. Your OS is now live and ready to use. You can now start using your Agents, Teams and Workflows as well as take a look at your Sessions, Memories, Knowledge and Metrics.
To update your Railway deployment, you can run the following command after making changes to the application:
railway up --service agent_os -dThis will trigger a new deployment of your application by creating a new docker image and deploying it to Railway.
To stop your Railway deployment, you can run the following command:
railway down --service agent_os
railway down --service pgvectorThis will stop your services on Railway.
Note: In order to start services again, in the same project on railway, you can run the ./scripts/railway_up.sh script again but make sure to remove the railway init command as that will create a new project on Railway.
The script does the following:
- Initializes a new project on Railway
- Deploys PgVector database on Railway
- Creates the application service with environment variables already set (DB_DRIVER, DB_USER, DB_PASS, DB_HOST, DB_PORT, DB_DATABASE, OPENAI_API_KEY)
- Deploys the application
- Creates a domain for your application
The /agents folder contains pre-built agents, teams and workflows that you can use as a starting point.
#TODO: Add documentation for agents, teams and workflows
Run the dev_setup.sh script. This will create a virtual environment and install project dependencies:
./scripts/dev_setup.shActivate the created virtual environment:
source .venv/bin/activate(On Windows, the command might differ, e.g., .venv\Scripts\activate)
If you need to add or update python dependencies:
Add or update your desired Python package dependencies in the [dependencies] section of the pyproject.toml file.
The requirements.txt file is used to build the application image. After modifying pyproject.toml, regenerate requirements.txt using:
./scripts/generate_requirements.shTo upgrade all existing dependencies to their latest compatible versions, run:
./scripts/generate_requirements.sh upgradeRebuild your Docker images to include the updated dependencies:
docker compose up -d --buildThis project comes with a set of integration tests that you can use to ensure the application is working as expected.
First, start the application:
docker compose up -dThen, run the tests:
pytest tests/Then close the application again:
docker compose downNeed help, have a question, or want to connect with the community?
- 📚 Read the Agno Docs for more in-depth information.
- 💬 Chat with us on Discord for live discussions.
- ❓ Ask a question on Discourse for community support.
- 🐛 Report an Issue on GitHub if you find a bug or have a feature request.