Skip to main content

Environment Variables

All environment variables are loaded from ~/.ravi/.env. The file is read on daemon startup and CLI invocation. Existing environment variables are never overridden — values set in the shell take precedence. Edit with:

Authentication (required — one of these)

Omni Connection (required for channel support)

Ravi discovers omni via two methods, checked in order:
  1. Environment variablesOMNI_API_URL and OMNI_API_KEY
  2. Omni config file~/.omni/config.json (written by omni CLI)
If neither source is available, the daemon starts without channel support (no WhatsApp/Telegram/Discord).

NATS

AI Services (optional)

Model Overrides (optional)

Example .env File

Agents

Agents are the core processing units in Ravi. Each agent has its own working directory, model, session scoping, and permissions.

Creating Agents

Agent Configuration Fields

All fields are set via ravi agents set <id> <key> <value>.

DM Scopes

Controls how direct messages are grouped into sessions.

Agent Modes

Instances

Instances represent channel connections (WhatsApp accounts, Telegram bots, etc). Each instance has its own policies, agent mapping, and routes.

Managing Instances

Instance Fields

Policies

DM Policies: Group Policies:

Multi-Account Setup

Connect multiple accounts, each mapped to a different agent:

Routes

Routes control which agent handles messages matching a pattern. Routes belong to instances and are checked in priority order.

Managing Routes

Route Fields

Route Examples

Agent Resolution Order

Messages are routed to agents in this priority:
  1. Route match — highest priority matching route for the instance
  2. Instance agent — default agent configured on the instance
  3. Default agent — global defaultAgent setting

Settings

Global settings are stored in SQLite and managed via CLI.

Available Settings

Legacy account.* rows are no longer part of the normal settings surface. They are shadowed by instances, hidden from ravi settings list by default, and should be replaced with instance configuration:

Permissions (REBAC)

Fine-grained relation-based access control. New agents are closed by default (no permissions). The main agent is automatically granted superadmin.

Managing Permissions

Relations

Entity Types

Subjects and objects use type:id notation. Valid types: agent, system, group, session, contact, cron, trigger, team, tool, executable, toolgroup

Resolution Order

Permission checks resolve in this order:
  1. No agent context (CLI direct) — always allowed
  2. Superadmin — check (agent, admin, system, *)
  3. Direct relation — exact match on subject, relation, object
  4. Wildcardobject:* covers all objects of that type
  5. Pattern match — glob patterns like session:dev-*
  6. Tool group — check if tool belongs to a granted toolgroup

Permission Templates

Apply predefined permission sets with ravi permissions init <subject> <template>:

Tool Groups

Groups of SDK tools for bulk permission grants:

Config-Synced Permissions

Some agent config fields automatically generate REBAC relations on daemon boot: These relations have source config and are re-synced on every daemon start. Manual relations (source manual) are preserved.

Storage