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:- Environment variables —
OMNI_API_URLandOMNI_API_KEY - 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 viaravi 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:- Route match — highest priority matching route for the instance
- Instance agent — default agent configured on the instance
- Default agent — global
defaultAgentsetting
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). Themain agent is automatically granted superadmin.
Managing Permissions
Relations
Entity Types
Subjects and objects usetype:id notation. Valid types:
agent, system, group, session, contact, cron, trigger, team, tool, executable, toolgroup
Resolution Order
Permission checks resolve in this order:- No agent context (CLI direct) — always allowed
- Superadmin — check
(agent, admin, system, *) - Direct relation — exact match on subject, relation, object
- Wildcard —
object:*covers all objects of that type - Pattern match — glob patterns like
session:dev-* - Tool group — check if tool belongs to a granted toolgroup
Permission Templates
Apply predefined permission sets withravi 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.