{"slug": "fastapi-for-agents", "title": "FastAPI for Agents", "summary": "AgentOS, built on Agno, launches an open-source platform that turns AI agents into production-ready APIs with 80+ endpoints for runs, sessions, memory, knowledge, and evals. The platform connects agents to apps like Claude, ChatGPT, Slack, WhatsApp, Telegram, and Discord, and includes coding-agent skills for self-improvement. It aims to provide a unified AI backend for multiple frontends, running entirely in the user's cloud.", "body_md": "AgentOS turns your agents into a production API: 80+ endpoints for runs, sessions, memory, knowledge, and evals. Build your product on top of it, connect your agents to AI apps like Claude and ChatGPT, and chat interfaces like Slack, WhatsApp, Telegram, and Discord.\n\nAgentOS gives you one AI backend for every frontend:\n\n**Your product.** Call the REST API from your app: run agents, stream responses, and manage sessions, memory, and knowledge.**AgentOS UI.** Chat with agents, build new ones with AgentOS Studio, and inspect sessions, traces, memory, and evals from the AgentOS UI at[os.agno.com](https://os.agno.com?utm_source=github&utm_medium=example-repo&utm_campaign=agentos-railway&utm_content=agentos-railway&utm_term=railway).**Coding agents.** Manage the full agent development lifecycle (create, extend, improve, eval and review) using the skills in.`.agents/skills/`\n\n**AI apps.** MCP clients like Claude and ChatGPT can use your agents through the MCP server at`/mcp`\n\n.**Chat interfaces.** Chat with your agents from Slack, WhatsApp, Telegram, and Discord.\n\nBuilt on [Agno](https://docs.agno.com). Everything runs in your cloud, your data lives in your database.\n\nThis codebase comes with:\n\n**Two platform agents** that help you build and run the platform from your favorite AI apps like Claude and ChatGPT.**Agent Builder** creates agents, teams, and workflows using the AgentOS Studio.**Platform Manager** understands, monitors, and explains the platform: codebase questions, eval history, deployment checks, schedules.**Coding-agent skills** let Claude Code, Codex, Cursor, and other coding agents build, test, and improve the platform automatically — see[Using the platform](#using-the-platform).\n\nTrace data, agent code, evals, and system logs are all available to coding agents, so the platform can inspect and improve itself end to end.\n\nThe fastest way to get started is using a coding agent. Copy the prompt below into Claude Code, Cursor or Codex and it'll take you from zero to a running platform.\n\n```\nHelp me set up AgentOS on this machine. Be self-driving: anything you can do — open a file, open a URL, launch an app — do it. Stop when you need a human: typing a secret, installing software, signing in to a website. When you do stop, tell me exactly what to do. Never read or print secrets.\n\n1. Clone https://github.com/agno-agi/agentos-railway.git into a folder called agent-platform and cd in. Then read AGENTS.md end to end — it is the source of truth for how this platform works and answers most questions you'll hit along the way.\n2. Confirm Docker is installed and running (`docker info` succeeds). If it's installed but not running, start it (`open -a Docker` on macOS) and poll until it's up. Stop for me only if Docker isn't installed — then give me steps to install Docker Desktop and wait.\n3. Set up my environment. Run `cp example.env .env`, then help me set my OPENAI_API_KEY. If it's already set in my shell, tell me you found one and offer to copy it in — move the value across without reading or printing it. Otherwise open .env in my editor (cursor, code etc.) and ask me to paste the key. Never open a terminal editor like vim or nano from your own shell — it will hang this session.\n4. Start the platform with `docker compose up -d --build`, then poll http://localhost:8000/docs until it returns 200 (first build takes a few minutes). If it never comes up, read `docker compose logs agentos-api` and fix what you find.\n5. Prove it end to end with ./scripts/mcp_check.sh — it should print \"MCP OK\" and a real agent answer. Show me that answer: it's my platform talking.\n6. Next, help me set up the AgentOS UI. Ask if you can open https://os.agno.com and walk me through the connection process: Connect OS → enter http://localhost:8000 → name it \"Local AgentOS\". That's where I chat with my agents and inspect sessions, memory, and evals.\n7. Finish with a short summary and what I should do next: run /create-new-agent right here and you'll build a new agent with me, then /improve-agent to sharpen it — that loop is yours to keep. Mention in one line that I can also connect my platform to coding agents (like yourself) using `uvx agno connect`, and to claude.ai / ChatGPT over OAuth once it's deployed to production.\n```\n\nPrerequisite:[Docker]installed and running.\n\n```\ngit clone https://github.com/agno-agi/agentos-railway.git agentos\ncd agentos\n\n# Configure credentials\ncp example.env .env\n# Open .env and set OPENAI_API_KEY\n\n# Run the platform on docker\ndocker compose up -d --build\n```\n\nConfirm your AgentOS is running at [http://localhost:8000/docs](http://localhost:8000/docs).\n\n- Open\n[os.agno.com](https://os.agno.com?utm_source=github&utm_medium=example-repo&utm_campaign=agentos-railway&utm_content=agentos-railway&utm_term=railway)and sign in. - Click\n**Connect OS**, enter`http://localhost:8000`\n\nas the URL, name it**Local AgentOS**, and connect.\n\n- Click\n**Chat** under the**Agent Builder** agent and try the first prompt: \"Build an agent that tracks AI news and writes a daily brief\". Go through the agent development process. - Once created, click the\n**Refresh** button on the top right. You should now see the \"Daily AI News Brief\" agent in the**Agents** dropdown. Click the newly created agent. - Ask: \"What's new with Anthropic?\"\n\nClick **Chat** under **Platform Manager** and ask: \"How healthy is the platform?\" It answers from the codebase and runtime data — eval history, deployment checks, schedules, and the component you just built.\n\nYou can run the platform anywhere that supports containerized images. This codebase comes with scripts to deploy the platform to [Railway](https://railway.com).\n\nPrerequisite:[Railway CLI]installed and`railway login`\n\ncompleted.\n\nCreate a new `.env.production`\n\nfile for production credentials.\n\n```\ncp .env .env.production          # or cp example.env .env.production\n# Edit .env.production with production values\n```\n\nKeeping a separate `.env.production`\n\nlets us use different values for local and production: different OpenAI keys, production-only credentials, a different Slack workspace.\n\n```\n./scripts/railway/up.sh\n```\n\nThis provisions the AgentOS service and Postgres on the same private network. The script pauses and asks for a JWT verification key for authentication (see next section).\n\nToken-Based Authorization is on by default. Without a `JWT_VERIFICATION_KEY`\n\nor `JWT_JWKS_FILE`\n\n, the app refuses to serve traffic in production. The platform's job is to keep your data private, so the safe default is \"refuse to start\" without an authentication token.\n\nToken-Based Auth gives you three things:\n\n**No public access.** The server rejects requests without a valid token.**Per-request identity.** Middleware parses the token and extracts the`user_id`\n\n,`session_id`\n\n, and custom claims. Each request is tied to a user and session, giving you auditability and traceability.**Granular permissions.** User tokens can run an agent and view their own sessions. Admin tokens read everyone's sessions and test any agent.\n\nDuring `./scripts/railway/up.sh`\n\n, the script creates your Railway domain and pauses so you can mint the key before the app starts.\n\n- Open\n[os.agno.com](https://os.agno.com?utm_source=github&utm_medium=example-repo&utm_campaign=agentos-railway&utm_content=agentos-railway&utm_term=railway), click**Connect OS**→** Live**, enter your Railway domain, and connect. - Name it\n**Live AgentOS**. - Go to\n**Settings**→** OS & Security**. - Turn\n**Token-Based Authorization (JWT)** on. - Copy the public key.\n- Paste the full public key into the\n`up.sh`\n\nprompt. The script saves it into your env file for future syncs:\n\n```\nJWT_VERIFICATION_KEY=\"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkq...\n-----END PUBLIC KEY-----\"\n```\n\nHeads up.Live AgentOS Connections are a paid feature. Use`PLATFORM30`\n\nto get 1 month off. We are working on a free trial so you don't have to pay to try.\n\nIf you get something wrong, you can re-sync environment variables with `./scripts/railway/env-sync.sh`\n\n.\n\nRe-run `uvx agno connect`\n\n, this time pointed at your deployed domain, to connect Claude Code, Claude Desktop, Codex, and Cursor to your production platform:\n\n```\nuvx agno connect --url https://<railway-domain>\n```\n\nFor **claude.ai and ChatGPT (web)**: add `https://<railway-domain>/mcp`\n\nas a custom connector in the chat app's connector settings. Leave the form's optional OAuth fields (client ID / client secret) empty. Click **Connect** and, on the consent page, enter the `MCP_CONNECT_SECRET`\n\nthat `up.sh`\n\ngenerated during deploy (saved in `.env.production`\n\n).\n\nYou can check the logs on the Railway dashboard, or by running the following command:\n\n```\nrailway logs --service agent-os\n```\n\nTo redeploy your AgentOS, run the following command:\n\n```\n./scripts/railway/redeploy.sh\n```\n\nRecommended: Auto-deploy on merge to `main`\n\nusing:\n\n- Open the Railway dashboard, your project, the agent-os service,\n**Settings**. - Under\n**Source**, click** Connect Repo**and pick your repo. - Set the deploy branch to\n`main`\n\nand save.\n\nPush to `main`\n\ntriggers a build and rolling deploy. `./scripts/railway/env-sync.sh`\n\nis still how you sync env changes.\n\nTo re-sync environment variables, run the following command:\n\n```\n./scripts/railway/env-sync.sh\n./scripts/railway/down.sh\n```\n\nDeletes the Railway project: the agent-os service, the pgvector database, and its volume, **including all data**. It also removes the AGENTOS_URL from your env file so a future `up.sh`\n\nstarts clean.\n\nSet `authorization=False`\n\nin [ app/main.py](/agno-agi/agentos-railway/blob/main/app/main.py) and redeploy. Use this only inside a private VPC behind another auth layer. Without it, anyone who guesses your Railway domain can access your platform.\n\nThis platform is designed so that coding agents can drive the entire **create → improve → evaluate → maintain** lifecycle for you.\n\nOpen your coding agent of choice (Claude Code, Codex, Cursor) and run:\n\n```\n/create-new-agent\n```\n\nIt asks a few questions, generates the agent file in `agents/`\n\n, registers it in `app/main.py`\n\n, adds its description and quick prompts to `app/config.yaml`\n\n, restarts the container, and smoke-tests it live.\n\nImprove your agents by running the following skills:\n\n— Add a tool, add a capability, refine the instructions, fix a known bug.`/extend-agent`\n\n— Claude simulates scenarios from the agent's`/improve-agent`\n\n`INSTRUCTIONS`\n\n, runs them against the live container, judges the responses, and edits until they pass.\n\nRun the eval suite to check for regressions. The evals live in [ evals/cases.py](/agno-agi/agentos-railway/blob/main/evals/cases.py), and run history shows up at os.agno.com next to your sessions and traces.\n\nThe evals run on the host machine, so set up the venv with `./scripts/venv_setup.sh && source .venv/bin/activate`\n\n, then:\n\n```\npython -m evals --tag smoke      # fast checks of the self-driving surfaces\npython -m evals --tag release    # broader pre-release confidence\npython -m evals --name <case>    # one case while iterating\npython -m evals -v               # stream the full run with rich panels\n```\n\nIf a case fails, run ** /eval-and-improve** — it diagnoses each failure, fixes what's in scope, and loops until green.\n\nBecause the repo is managed by coding agents, it moves fast. Run `/review-and-improve`\n\nbefore a release or after a refactor: it sweeps for drift between docs, code, and config, auto-fixes mechanical drift like stale paths and missing env vars, and flags anything bigger.\n\nAgentOS comes with an MCP server at `/mcp`\n\n(enabled by setting `mcp_server=True`\n\nin [ app/main.py](/agno-agi/agentos-railway/blob/main/app/main.py)), so any MCP client can call your agents, teams, and workflows through tools like\n\n`run_agent`\n\n, `run_team`\n\n, and `run_workflow`\n\n.Register your AgentOS with the MCP clients on your machine:\n\n```\nuvx agno connect\n```\n\nIt auto-detects Claude Code, Claude Desktop, Codex, and Cursor and registers `http://localhost:8000/mcp`\n\n. After a successful connection, open one of these apps and ask:\n\n```\ncan you access my agentos mcp?\n```\n\n**claude.ai and ChatGPT (web).** Hosted AI apps reach your platform over the internet and need an OAuth login. Deploy to production (above), add `https://<domain>/mcp`\n\nas a remote connector, and approve the consent page with your connect secret.\n\n| Variable | Required | Default | Description |\n|---|---|---|---|\n`OPENAI_API_KEY` |\nyes | none | OpenAI key for models and embeddings. |\n`RUNTIME_ENV` |\nno | `prd` |\n`dev` disables JWT. Compose sets this to `dev` for local — never put it in an env file that syncs to Railway, or production deploys unauthenticated. |\n`JWT_VERIFICATION_KEY` |\nprd | none | Public key from os.agno.com. Required when `RUNTIME_ENV=prd` , unless `JWT_JWKS_FILE` is set. |\n`JWT_JWKS_FILE` |\nprd | none | Path to a JWKS file; alternative to `JWT_VERIFICATION_KEY` for production JWT verification. |\n`AGENTOS_URL` |\nno | `http://127.0.0.1:8000` |\nScheduler base URL. `scripts/railway/up.sh` auto-sets it to your Railway domain; set by hand only for a custom domain or tunnel. Also the public origin OAuth metadata derives from when `MCP_CONNECT_SECRET` is set. |\n`MCP_CONNECT_SECRET` |\nno | none | If set (≥16 chars, e.g. `openssl rand -base64 32` ), `/mcp` becomes its own OAuth 2.1 authorization server so claude.ai and ChatGPT (web) can connect; connecting asks for this secret on a consent page. Requires `AGENTOS_URL` . `scripts/railway/up.sh` auto-generates it on deploy. PAT and JWT bearers keep working alongside. |\n`AGENTOS_MCP_SIGNING_KEY` |\nno | none | Optional high-entropy signing-key material (≥32 chars) for OAuth tokens. Unset, a strong key is generated and persisted in the database. Rotating it invalidates outstanding tokens. |\n`ENABLE_DEPLOY_CHECK` |\nno | `True` |\nThe reference deployment-check cron runs daily by default. Set `False` to disable; the workflow is runnable on demand regardless. |\n`ENABLE_SCHEDULED_EVALS` |\nno | `False` |\nIf `True` , schedules the run-evals workflow daily. Off by default because it uses model calls. |\n`EVALS_TAG` |\nno | `smoke` |\nEval tag run by the run-evals workflow. |\n`EVALS_CASE_TIMEOUT_SECONDS` |\nno | `90` |\nDefault per-case timeout for run-evals runs; applies only to cases that don't set their own `timeout_seconds` . |\n`EVALS_SUITE_TIMEOUT_SECONDS` |\nno | `900` |\nWhole-suite timeout for run-evals runs; per-case timeouts are the granular limit. The default bounds the `smoke` tag's worst case (incl. builder-case teardown). |\n`PARALLEL_API_KEY` |\nno | none | Authenticates the WebSearch Agent's Parallel SDK / MCP connection. |\n`SLACK_BOT_TOKEN` / `SLACK_SIGNING_SECRET` |\nno | none | Both must be set to enable the Slack interface. |\n`DB_HOST` / `DB_PORT` / `DB_USER` / `DB_PASS` / `DB_DATABASE` |\nno | matches compose | Postgres connection. |\n`DB_DRIVER` |\nno | `postgresql+psycopg` |\nSQLAlchemy driver. |\n`AGNO_DEBUG` |\nno | `False` |\nIf `True` , Agno emits verbose debug logs. Compose sets this for dev. |\n`WAIT_FOR_DB` |\nno | `False` |\nIf `True` , the entrypoint blocks on the DB before starting. Compose sets this. |\n\n[Agno documentation](https://docs.agno.com?utm_source=github&utm_medium=example-repo&utm_campaign=agentos-railway&utm_content=agentos-railway&utm_term=railway)[AgentOS introduction](https://docs.agno.com/agent-os/introduction?utm_source=github&utm_medium=example-repo&utm_campaign=agentos-railway&utm_content=agentos-railway&utm_term=railway)[Agno on GitHub](https://github.com/agno-agi/agno). Drop a star if this is useful.", "url": "https://wpnews.pro/news/fastapi-for-agents", "canonical_source": "https://github.com/agno-agi/agentos-railway", "published_at": "2026-07-15 21:49:01+00:00", "updated_at": "2026-07-15 22:25:45.521528+00:00", "lang": "en", "topics": ["ai-agents", "ai-infrastructure", "ai-tools", "developer-tools", "ai-products"], "entities": ["AgentOS", "Agno", "Claude", "ChatGPT", "Slack", "WhatsApp", "Telegram", "Discord"], "alternates": {"html": "https://wpnews.pro/news/fastapi-for-agents", "markdown": "https://wpnews.pro/news/fastapi-for-agents.md", "text": "https://wpnews.pro/news/fastapi-for-agents.txt", "jsonld": "https://wpnews.pro/news/fastapi-for-agents.jsonld"}}