> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-codex-docs-audit-20260719-0149.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Coda

> A code companion that lives in Slack. It reviews PRs, triages issues, and answers architecture questions.

**Coda is a code companion that lives in Slack.**

Coding agents help us write code faster, but most engineering work is understanding how things work, reviewing PRs, figuring out what broke and why, triaging the backlog, and deciding what's safe to change. That work happens in Slack and GitHub, not in an editor.

Coda fills that gap. It answers architecture questions like "how does auth work" or "where is the model API call". It reviews PRs and open branches, diffs them against your conventions, and leaves comments. It reads open issues and flags the urgent ones worth tackling next. And it does all of this in Slack, alongside your team.

The code is public at [agno-agi/coda](https://github.com/agno-agi/coda).

## How it works

Coda is a team of up to five specialist agents coordinated by a leader:

| Agent          | Role                                                                                                                   |
| -------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **Explorer**   | Searches local code without modifying it, answers architecture questions, and can post GitHub review or issue comments |
| **Coder**      | Writes code in isolated worktrees, opens PRs                                                                           |
| **Planner**    | Breaks features into ordered GitHub issues                                                                             |
| **Triager**    | Labels, comments on, and closes issues based on code analysis                                                          |
| **Researcher** | Searches the web for docs, APIs, and error messages when `PARALLEL_API_KEY` is set                                     |

Coda's instructions direct the Coder to use git worktrees on `coda/*` branches and open pull requests for review. The repo-sync task updates each configured main checkout. `CodingTools` also exposes shell and git access, so branch protections remain the enforcement point for protected branches and human review.

Coda runs in your infrastructure and calls the services you configure. Model prompts go to the model provider. Repository operations, diffs, and comments use GitHub. Messages and digests use Slack. The optional Researcher sends research queries to Parallel.

Between them, the agents cover:

| Capability            | What it does                                                                  |
| --------------------- | ----------------------------------------------------------------------------- |
| **Architecture Q\&A** | Answers "how does auth work" with file paths and line numbers                 |
| **PR reviews**        | Pulls the diff, checks it against your conventions, leaves inline comments    |
| **Issue triage**      | Categorizes, labels, flags duplicates, closes junk                            |
| **Planning**          | Turns a feature request into ordered, well-scoped GitHub issues               |
| **Web research**      | Brings back framework docs, library APIs, and error explanations with sources |
| **Code writing**      | Ships changes from isolated worktrees as PRs                                  |

### Scheduled tasks

Coda also shows up on its own. Two background tasks register at startup:

| Task             | What it does                                                             |
| ---------------- | ------------------------------------------------------------------------ |
| **Daily digest** | Posts a morning summary: what merged, what needs review, what went stale |
| **Repo sync**    | Pulls the latest changes from configured repos every 5 minutes           |

Repo sync always runs. The daily digest only registers when both `DIGEST_CHANNEL` and `SLACK_TOKEN` are set in `.env`. Set `DIGEST_CHANNEL` to the Slack channel ID the summary should post to (right-click a channel in Slack, then View details to copy the ID).

### Self-learning

Coda can record coding standards, conventions, and patterns for later retrieval. The learning tools come from Agno's [Learning Machines](/learning/overview):

| Week 1                                     | Week 4                                                                                                     |
| ------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
| Writes working code using generic patterns | Follows your service layer conventions, uses your team's error handling pattern, matches your naming style |

## Run locally

The [Coda README](https://github.com/agno-agi/coda#readme) walks through this in more detail.

```bash theme={null}
git clone https://github.com/agno-agi/coda.git && cd coda

cp example.env .env
# Edit .env: add OPENAI_API_KEY and GITHUB_ACCESS_TOKEN
```

`OPENAI_API_KEY` comes from [platform.openai.com](https://platform.openai.com/api-keys). For `GITHUB_ACCESS_TOKEN`, create a fine-grained Personal Access Token with Contents (read and write), Pull requests (read and write), Issues (read and write), and Metadata (read). The full walkthrough is in [docs/GITHUB\_ACCESS.md](https://github.com/agno-agi/coda/blob/main/docs/GITHUB_ACCESS.md). `PARALLEL_API_KEY` (from [parallel.ai](https://parallel.ai)) is optional; it enables the Researcher agent. Without it the team runs with no web research.

Tell Coda which repos to learn by editing `repos.yaml`:

```yaml theme={null}
repos:
  - url: https://github.com/your-org/your-repo
    branch: main
```

The agno repo makes a good starting point, so you have some test questions to play around with.

Then start Coda (Docker needs to be running):

```bash theme={null}
docker compose up -d --build
```

Confirm it's up at [localhost:8000/docs](http://localhost:8000/docs).

### Connect to the AgentOS UI

1. Open [os.agno.com](https://os.agno.com) and sign in.
2. Click **Connect OS** → **Local** and enter `http://localhost:8000`.

This gives you a web UI to chat with Coda directly, plus sessions, traces, metrics, memory, and evaluations.

## Deploy to Railway

You'll need the [Railway CLI](https://docs.railway.app/guides/cli) installed and `railway login` completed.

```bash theme={null}
# First-time setup (creates project, database)
./scripts/railway_up.sh

# Sync env vars after changing .env (handles multiline keys like PEM)
./scripts/railway_env.sh

# Redeploy after code changes
./scripts/railway_redeploy.sh
```

`railway_up.sh` provisions a pgvector database, creates the `coda` service with the variables from your `.env`, deploys, and creates a public domain. If `.env` has no `JWT_VERIFICATION_KEY`, the initial process exits after the domain is created. Copy that domain, generate the key below, sync it, and redeploy. The domain can take about 5 minutes; inspect startup with `railway logs --service coda`. See `railway.json` to adjust CPU, memory, and replica settings.

Production runs with RBAC on (`RUNTIME_ENV=prd` is the default). Without `JWT_VERIFICATION_KEY`, the process exits during startup. After the key is configured, protected AgentOS routes require a valid token. The operational and documentation routes `/`, `/health`, `/info`, `/docs`, `/redoc`, `/openapi.json`, and `/docs/oauth2-redirect` remain public.

1. Open [os.agno.com](https://os.agno.com), click **Connect OS** → **Live**, and enter the Railway domain created by `railway_up.sh`.
2. Go to **Settings** and generate a key pair.
3. Add the public key to `.env` as `JWT_VERIFICATION_KEY` (paste the full PEM block).
4. Push it and redeploy:

```bash theme={null}
./scripts/railway_env.sh
./scripts/railway_redeploy.sh
```

`railway_env.sh` handles multiline values, so the PEM key syncs correctly.

## Connect to Slack

<Frame>
  <video autoPlay muted loop controls playsInline style={{ borderRadius: "0.5rem", width: "100%", height: "auto" }}>
    <source src="https://mintcdn.com/agno-v2-codex-docs-audit-20260719-0149/pW8PmtN5WDvNK9a4/videos/slack-coda-demo.mp4?fit=max&auto=format&n=pW8PmtN5WDvNK9a4&q=85&s=cc4cad5cae05b847e251cc125e118c23" type="video/mp4" data-path="videos/slack-coda-demo.mp4" />
  </video>
</Frame>

With Coda running, follow the [Slack setup guide](/agent-os/interfaces/slack/setup) to create your Slack app, then add the credentials to `.env`:

```bash theme={null}
SLACK_TOKEN="xoxb-***"
SLACK_SIGNING_SECRET="***"
```

Restart to pick up the credentials:

```bash theme={null}
docker compose up -d
```

There are two ways to talk to Coda:

| Where          | How                                                                   |
| -------------- | --------------------------------------------------------------------- |
| Direct message | Find Coda under **Apps** in the Slack sidebar and message it directly |
| In a channel   | Run `/invite @Coda`, then mention **@Coda** in any message            |

Each thread is its own conversation. Follow-ups in the same thread don't need to @mention Coda again.

If Coda is deployed, point your Slack app's **Event Subscriptions** Request URL at `https://<your-domain>/slack/events` and wait for Slack to verify it.

## Example prompts

Try these once your repos are configured:

```
@Coda where is the webhook handler for Stripe events?
@Coda review PR #42
@Coda triage the open issues and label them
@Coda plan out adding webhook support to the payments service
@Coda what changed in FastAPI 0.135?
```

## Run evals

Five eval categories cover the team's behavior:

| Category        | What it tests                                                                     |
| --------------- | --------------------------------------------------------------------------------- |
| **security**    | Responses never leak keys, tokens, or credentials                                 |
| **routing**     | The leader delegates to the right specialist and tools                            |
| **exploration** | Answers point to the correct files and code                                       |
| **synthesis**   | Answers lead with the result, cite file paths, and suggest next steps             |
| **refusal**     | The team declines dangerous requests and asks for clarification on ambiguous ones |

Evals call the real team, so set up a virtual environment and start the database first:

```bash theme={null}
./scripts/venv_setup.sh && source .venv/bin/activate
docker compose up -d coda-db

python -m evals.run                      # All categories
python -m evals.run --category security  # One category
python -m evals.run --verbose            # Show response previews
```

## Source

Coda is open source at [agno-agi/coda](https://github.com/agno-agi/coda). The in-repo docs cover [GitHub access](https://github.com/agno-agi/coda/blob/main/docs/GITHUB_ACCESS.md) and [Slack setup](https://github.com/agno-agi/coda/blob/main/docs/SLACK_CONNECT.md) in detail.
