Ratel

Analytics and monitoringDatabases

The self-improvement layer for AI agents. Ratel reads your agent's traces, finds what fails, recommends fixes and runs evals on real sessions before you ship. Self-hosted: one app, one Postgres. Includes the TypeScript and Python SDK.

Your AI app calls the Ratel MCP server, which does the analytics and monitoring and databases work and sends the result back to the chat.

About Ratel

Ratel is a community MCP server from ratel-ai, filed in our directory under analytics and monitoring and databases. The self-improvement layer for AI agents. Ratel reads your agent's traces, finds what fails, recommends fixes and runs evals on real sessions before you ship. Self-hosted: one app, one Postgres. Includes the TypeScript and Python SDK.

At a glance

Publisher
ratel-ai (community)
Runs
See the README for setup
Written in
TypeScript
License
MIT
GitHub stars
581

How to set up Ratel

  1. Follow the install steps in the Ratel README; it is written in TypeScript, so have that toolchain ready.
  2. Check the Ratel README for keys or settings; the registry lists none that Ratel requires.
  3. Add Ratel to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Ratel tools to confirm the connection.
  5. Run one read-only task with Ratel first, and keep your app asking before each tool call until the results look right.

Ratel compared with similar servers

  • Fastapi MCP Langgraph Template by NicholasGoh has fewer GitHub stars than Ratel (561 against 581); both are community servers, and both run locally.
  • dbt by dbt-labs has more GitHub stars than Ratel (626 against 581); dbt is official while Ratel is a community server, and both run locally.
  • Prometheus by pab1it0 has fewer GitHub stars than Ratel (527 against 581); both are community servers, and both run locally.

Before you connect Ratel

  • Give Ratel its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Ratel tool call until you trust what it does with them.
  • Treat text that Ratel fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Ratel on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Ratel

How marketing and sales teams put Ratel to work, by company size. Pick the size closest to yours and start Ratel on one use case.

Small business

  • A small business can ask Ratel where this month's customers came from and which channel is worth more budget.
  • Owners can use Ratel to get a weekly traffic and conversion summary in plain words, without learning the analytics tool.
  • A small business with its own app can ask Ratel plain questions about customers and orders, without writing SQL.
  • Ratel runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can connect Ratel to answer attribution and funnel questions in a chat, then save the useful ones as reports.
  • Growth teams can have Ratel flag drops in signups or conversion the day they happen, with the page or source that changed.
  • Marketing analysts can connect Ratel to answer campaign questions from the warehouse directly, instead of waiting on the data team's queue.
  • Start Ratel on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can expose governed metrics through Ratel, so every team's AI answers use the same definitions as finance.
  • Large analytics teams can use Ratel to triage anomalies across regions and products before the weekly business review.
  • Enterprises should point Ratel at a read replica with a read-only role, so agents query freely without risk to production data.
  • Ratel is a community server, so have security review the code and pin a version before Ratel touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Ratel README

From ratel-ai/ratel on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Ratel

See what your AI agent gets wrong, and what to change. On your own infrastructure.

Docs (ratel.sh/docs) • Skills • Discord

Introduction

Ratel is a self-hosted platform for AI agents. Your agent sends it traces and its catalog of tools and skills. Ratel reads that traffic and shows you what the agent gets wrong, what people ask it for, and which changes would make it find and finish more.

It is for anyone building or running an agent who wants to see how it behaves and keep that data on their own machines. It runs as one application and one Postgres database, and it needs nothing else:

  • Console: the pages you read and act on. See What is in the console.
  • Ingest and catalog APIs: OTLP traces and logs, SDK events, catalog pull, skills and intent graph sync, authenticated with per-project API keys.
  • Background jobs: a durable queue in Postgres, drained every minute inside the application. There is no separate worker or scheduler to run.
  • Readings: what Ratel works out from the traffic, as jobs over a ledger of your agent's turns: Agent health signals, workflows and self-corrections, topics, intent clusters and the intent graph, the tool explorer, and match quality.

Model keys are optional. With no key, Ratel makes no outbound model call. The readings that need a model report themselves skipped, workflows keep their tool-order names, and topics are named from their own asks.

Quick Start

You need Docker with Compose 2.24 or later, network access to pull images, about 5 GB of free disk in the Docker VM (the app and Postgres images take under 1 GB, the optional demo image 1.2 GB more, plus your data) and 4 GB of RAM for Docker (8 GB is comfortable). There is no build on your machine.

One command
curl -fsSL https://raw.githubusercontent.com/ratel-ai/ratel/main/install.sh | sh

The installer works on macOS and Linux, on your machine or on a cloud VM. It checks Docker, Compose, RAM and disk, clones the repo at the latest release into ~/ratel (/opt/ratel as root), creates .env with random secrets, pulls the published image of that release, starts the stack and waits for /api/health. On a Linux server with no Docker it offers to install Docker with Docker's get.docker.com script. On a cloud VM it prints the ssh -L tunnel command to reach the console. Run it again to upgrade: it pulls the image of the latest release and restarts. This also upgrades an install that was built from source. It keeps the data volume and the values in your .env (it sets RATEL_VERSION and COMPOSE_FILE), and it stops if the checkout has local changes or is newer than the release.

Options, after sh -s --: --version <X.Y.Z> (default: the latest release; edge is the last build of main), --ref <branch|sha> (build that from source instead, about 5 minutes), --dir <path>, --yes (ask nothing) and --demo (load the demo data). For example:

curl -fsSL https://raw.githubusercontent.com/ratel-ai/ratel/main/install.sh | sh -s -- --yes --demo

On a server with a public IP, --access public puts Caddy in front of the console, on ports 80 and 443, with a Let's Encrypt certificate and a login (basic auth, user ratel). The password is new and printed once. --domain <name> sets the site name (default <public-ip>.sslip.io), --tls internal uses Caddy's own CA in place of Let's Encrypt, and --auth-hash <bcrypt> sets the password's hash. The routes that SDKs and MCP clients call with project API keys (/v1, /v2, /api/v1, /api/v2, /api/mcp) and /api/health pass without the login. A rerun keeps the mode, and --access private turns Caddy off. The installer writes Caddyfile and adds docker-compose.caddy.yml to COMPOSE_FILE in .env, so every docker compose command in the directory includes Caddy. The containers restart after a reboot.

Deploy to your cloud

From your laptop, one command creates a VM in your cloud and installs Ratel on it:

curl -fsSL https://raw.githubusercontent.com/ratel-ai/ratel/main/deploy.sh | sh

deploy.sh finds the cloud you are logged in to: AWS (aws sts get-caller-identity), Google Cloud (the account and project of gcloud), Azure (az account show), DigitalOcean (DIGITALOCEAN_TOKEN or doctl) or Hetzner (HCLOUD_TOKEN or hcloud). With several, it asks, or takes --cloud. It uses OpenTofu (tofu), or Terraform when OpenTofu is not installed. It creates one Ubuntu 24.04 LTS VM with 2 vCPU or more, 8 GB of RAM and 30 GB of disk or more, a firewall, a static IP and a dedicated SSH key. It shows the plan and a rough monthly cost per size, and asks before it creates anything. Then it follows the install and prints how to open the console. The modules are in deploy/terraform/.

There are two access modes:

  • --access public (default): Caddy with TLS and a login, as above. Ports 80 and 443 are open to all, or only to the --allow-cidr ranges (for example a VPN), and then Caddy uses its own CA because Let's Encrypt cannot reach port 80. SSH is open only to your current IP. The certificate is for --domain, or for <ip>.sslip.io with no domain. The login password is printed once, and stays only on your laptop, in ~/.ratel/deploy/<name>/login.
  • --access private: no web port. SSH is open to your current IP and the --allow-cidr ranges, and you reach the console through a tunnel: ssh -i ~/.ratel/deploy/ratel/id_ed25519 -N -L 3000:127.0.0.1:3000 ratel@<ip>.

Other options, after sh -s --: --region, --size, --name (default ratel, for more than one deploy), --version or --ref (passed to install.sh; the default is the latest release), --iac terraform|tofu and --yes. The state, the SSH key and the password stay on your laptop in ~/.ratel/deploy/<name>/ (owner-only), so the other commands need no flags:

curl -fsSL https://raw.githubusercontent.com/ratel-ai/ratel/main/deploy.sh | sh -s -- status
curl -fsSL https://raw.githubusercontent.com/ratel-ai/ratel/main/deploy.sh | sh -s -- up   # upgrade to the latest release
curl -fsSL https://raw.githubusercontent.com/ratel-ai/ratel/main/deploy.sh | sh -s -- destroy

up on an existing deploy upgrades it: it reruns install.sh on the VM over SSH with --version, or with the latest release. A deploy made with --ref <branch> stays on that branch. If your IP changed, it first opens SSH to the new one. destroy deletes the VM, its disk with all Ratel data and its IP, then the local state. Back up first (see On a server).

One-click deploy

Each button opens your cloud's console with Ratel's template, in your account. Nothing is created until you confirm there. The VM runs install.sh, as deploy.sh does, in the public mode (Caddy with TLS and a login for user ratel, with the password that you type) or in the private mode (no web port, an SSH tunnel). The template's version parameter (default latest) sets the release; its ref parameter builds a branch or commit from source instead.

Cloud Button What it opens
AWS CloudFormation quick-create, with deploy/cloudformation/ratel.yaml (default VPC, t3.large, Elastic IP)
Azure A custom deployment, with deploy/azure/azuredeploy.json (its own network, Standard_B2ms, static IP)
Google Cloud Cloud Shell, with a tutorial that runs ./deploy.sh up --cloud gcp

The password is in the user data of the VM (AWS) or in its custom data (Azure), base64-encoded. Anyone who can read the VM's configuration in your account can read it. Use deploy.sh when that matters: it gives the VM only the hash.

On your machine

The manual steps:

git clone https://github.com/ratel-ai/ratel.git
cd ratel
docker compose up -d --wait

This pulls ratelai/ratel at RATEL_VERSION: the value in .env, else the default in docker-compose.yml, which each release sets. Open http://localhost:3000. No configuration is needed.

To run your own changes, build from the checkout with the override file:

docker compose -f docker-compose.yml -f docker-compose.build.yml up -d --build --wait

Or put COMPOSE_FILE=docker-compose.yml:docker-compose.build.yml in .env, and each docker compose command uses it.

If port 3000 or 5432 is taken, set RATEL_PORT and RATEL_DB_PORT in .env (copy .env.example) and set BASE_URL to the address you open, such as http://localhost:3950. The console's snippets and the demo's links use BASE_URL.

If docker compose up --wait fails, read docker compose logs db web worker. A full Docker disk shows up only in the db log (No space left on device). On a small machine the worker can report unhealthy for the first minutes after a restart, while it catches up on queued jobs; it usually settles by itself.

The image alone

Each release publishes the image docker.io/ratelai/ratel for linux/amd64 and linux/arm64, tagged with its version (0.3.0), its minor (0.3) and latest. edge follows main. The image needs a Postgres 16 database:

docker run -d -p 127.0.0.1:3000:3000 \
  -e DATABASE_URL=postgres://ratel:ratel@<db-host>:5432/ratel -e DATABASE_SSL=disable \
  -e DATABASE_MIGRATE_ON_BOOT=1 ratelai/ratel:0.3

Without APP_ROLE, the one container serves the console and runs the jobs. GET /api/health answers 200 when it is ready. RELEASING.md tells how releases and images are made.

First steps
  1. In the console, open Settings > API keys and create a key. It is shown once.
  2. Send a first trace. The same page shows a TypeScript and a curl snippet with your endpoint; the curl one posts a single span to the traces endpoint and answers 202. Set RATEL_API_KEY to the key.
  3. To let an agent query Ratel, connect it over MCP: POST <BASE_URL>/api/mcp with Authorization: Bearer <project key>. The console's Integrations page has copy-paste setup for Claude Code, Claude Desktop, Cursor and VS Code, for example claude mcp add --transport http ratel <BASE_URL>/api/mcp --header "Authorization: Bearer $RATEL_API_KEY". Details are in web/src/lib/mcp/README.md.
Experimental features

Tasks and Ship, testing a fix before it ships, session replay and the improvement-loop MCP tools are off by default. Add RATEL_EXPERIMENTAL_FEATURES=1 to .env and run docker compose up -d --wait to turn them on; remove the line (or set 0) and run it again to turn them off. With them on, Tasks becomes a page of its own in the rail and replaces the Tasks tab under Agent health, and the MCP server lists 9 more tools (40 without).

Explore with demo data (optional)
docker compose --profile demo run --rm demo

A fresh install seeds this sample project, Site Copilot, by itself the first time the console opens with no project: 30 days of agent activity, marked as sample data, seeded once per organization (deleting it does not bring it back). Some pages fill in over the next couple of minutes. This command replaces it with a fresh copy, or restores it after a delete.

On a server

The console has no login. Anyone who reaches it is an admin. Ratel binds to 127.0.0.1 only: keep it behind your own proxy with authentication and TLS.

The one-command installer does the steps below for you, with random secrets. With --access public it also sets up the proxy (Caddy). Then set RATEL_ORG_NAME and BASE_URL in .env and run it again. By hand:

git clone https://github.com/ratel-ai/ratel.git
cd ratel
cp .env.example .env

Set these in .env before the first start. Generate each secret with openssl rand -hex 32:

RATEL_ORG_NAME=Acme
BASE_URL=https://ratel.example.com
POSTGRES_PASSWORD=<generated>
TRACE_SIGNALS_HASH_SALT=<generated>
RATEL_SECRET_KEY=<generated>

Then start it with docker compose up -d --wait. Point your proxy at 127.0.0.1:3000, and configure it so that:

  • /v1, /v2, /api/v1, /api/v2 and /api/mcp pass through without your login, because the SDKs and MCP clients authenticate with API keys (bearer project keys). /api/health can pass too, for your monitor.
  • Everything else requires your login. That includes /api/cron/drain, which only matters if you set RATEL_CRON=external; it takes CRON_SECRET as a bearer, so give your scheduler that route and nothing else.
  • It preserves Host or sets X-Forwarded-Host, otherwise console actions fail.

Model keys are optional, and every field is explained in .env.example.

TLS. Terminate it at the proxy and keep BASE_URL on the https:// address, since the console's snippets are built from it.

Backups. All state is in the Postgres volume (ratel_pgdata). Dump it with docker compose exec -T db pg_dump -U ratel ratel > ratel.sql, and restore into an empty database with docker compose exec -T db psql -U ratel ratel < ratel.sql. Keep .env too: a lost TRACE_SIGNALS_HASH_SALT splits old hashes from new, and a lost RATEL_SECRET_KEY cannot open the stored Slack secrets.

Upgrades. Rerun the installer. By hand: check out the release's tag, set RATEL_VERSION in .env to the same version and run docker compose up -d --wait. The volume stays, also when the running version was built from source: its old ratel-web and ratel-worker images can then be deleted. Migrations run on boot and only add to the schema, so a rollback means restoring the dump you took before the upgrade and running the earlier version.

Everyday commands
docker compose up -d --wait            # start, or move to a new RATEL_VERSION; migrations run on boot
docker compose down                    # stop, keeping your data
docker compose logs -f web worker      # follow the logs
docker compose down --volumes          # stop and DELETE ALL DATA

Two containers run the app from the same image: web serves the console and the API and only queues background work, and worker runs it (analysis, sweeps, model calls), so a slow job never holds up a request. To run everything in one container instead, start the image without APP_ROLE.

POSTGRES_PASSWORD is read only when the database is first created. Changing it later means deleting the data with the last command.

What is in the console

An organization holds projects, and each project is one agent's view:

Page What it shows
Overview The project at a glance: activity over the last 7 or 30 days, and what needs attention.
Agent health What your agent gets wrong. Summary lists the issues, Tasks follows what people tried to do down to each session, and Self-corrections lists the times the agent retried, switched tools, gave up or apologized. The Summary also prints as a report.
Traces Every run step by step, with spans, operations and logs, and two traces side by side.
Catalog Every tool and skill your agent can use, and how each one is found. Test a search ranks a prompt against the live catalog, with what-if edits.
Intents What people ask for. All intents lists the topics, Flows shows what people want next, ask after ask, and Map lays the intents out.
Improvements Fixes is the one list of changes that would make your agent find and finish more. Quality measures how well searches find the right tool, with misses, description rewrites and experiments. Adaptive ranking puts the tool your agent needs first, using what people asked before.
Settings Projects general settings, API keys, SDK events under Developer, and a danger zone.

Repo layout

web/                           # @ratel/platform: the console and APIs (code in web/src)
mcp-apps/                      # @ratel/mcp-apps: the MCP Apps views, built for web/'s MCP server
packages/
├── brand/                     # @ratel/brand: palette, fonts and logo assets
└── design-system/             # @ratel/design-system: semantic tokens and UI primitives
scripts/                       # Repository checks
docs/
├── adr/                       # Architecture decision records
└── assets/                    # Images and other static assets
ee/                            # Manifest for the Enterprise modules

The SDKs (the Rust core, the TypeScript and Python SDKs, adapters, rankers, telemetry and the catalog protocol) live in ratel-ai/ratel-sdk.

The application's own layout and commands are in web/README.md, and the layers of its core in web/src/lib/README.md.

Development

Ratel Platform

Prerequisites: Node 24+ and pnpm 10.28+, with Docker for the platform's Postgres.

Ratel SDK

The SDKs are developed in ratel-ai/ratel-sdk. The platform uses the published @ratel-ai/sdk and @ratel-ai/telemetry packages from npm.

Contributing

License

The ratel-ai-core engine, now in ratel-ai/ratel-sdk, is licensed under Apache-2.0, an explicit patent grant for the engine others embed. Everything else (the platform application, SDKs, telemetry helpers, examples) is MIT. See ADR-0006 for the rationale.

Questions about Ratel

What is the Ratel MCP server?

The self-improvement layer for AI agents. Ratel reads your agent's traces, finds what fails, recommends fixes and runs evals on real sessions before you ship. Self-hosted: one app, one Postgres. Includes the TypeScript and Python SDK. Ratel is maintained by ratel-ai on GitHub at ratel-ai/ratel, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Ratel MCP server?

Ratel doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (ratel-ai/ratel). Like most servers, Ratel ends with a command or URL you paste into your AI app's MCP config.

Does Ratel need an API key?

The registry lists no required keys for Ratel. Check the Ratel README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Ratel an official MCP server?

No. Ratel is a community server maintained by ratel-ai. Community servers can be excellent; read the code and the open issues before you give Ratel access to company data.

What license is Ratel under?

Ratel is released under the MIT license, according to its GitHub repository. The license covers the code of Ratel; the service it connects to has its own terms.