Configuration

Environment variables and API key setup for RA-OS

Configuration

RA-OS uses environment variables for configuration. Create a .env.local file in the root directory with your settings.

Required: AI Provider Keys

You need at least one AI provider configured. RA-OS supports:

OpenAI

OPENAI_API_KEY=sk-...

Used for embeddings and chat (GPT-4o, GPT-4o-mini).

Anthropic

ANTHROPIC_API_KEY=sk-ant-...

Used for chat (Claude 3.5 Sonnet, Claude 3 Haiku).

OpenRouter

OPENROUTER_API_KEY=sk-or-...

Provides access to multiple models through a single API.

Optional Settings

Database Path

Override the default database location:

DATABASE_PATH=/path/to/your/rah.sqlite

Default: ~/Library/Application Support/RA-H/rah.sqlite

Embedding Model

Choose which model to use for embeddings:

EMBEDDING_MODEL=text-embedding-3-small

Options:

  • text-embedding-3-small (default, faster, cheaper)
  • text-embedding-3-large (more accurate, slower)

Chat Model

Set the default chat model:

CHAT_MODEL=gpt-4o-mini

Options vary by provider. Common choices:

  • gpt-4o-mini (fast, cheap)
  • gpt-4o (more capable)
  • claude-3-5-sonnet-20241022 (Anthropic)

Example .env.local

# AI Providers (at least one required)
OPENAI_API_KEY=sk-your-openai-key
ANTHROPIC_API_KEY=sk-ant-your-anthropic-key

# Optional: OpenRouter for more models
OPENROUTER_API_KEY=sk-or-your-openrouter-key

# Optional: Custom settings
DATABASE_PATH=~/Documents/my-knowledge-graph/rah.sqlite
EMBEDDING_MODEL=text-embedding-3-small
CHAT_MODEL=gpt-4o-mini

Verifying Configuration

After setting up your environment variables:

  1. Restart the development server
  2. Open the app in your browser
  3. Go to Settings (gear icon)
  4. Check that your API keys are detected

If keys are missing, you'll see warnings in the Settings panel.

Security Notes

  • Never commit .env.local — It's already in .gitignore
  • Use environment variables in production — Don't hardcode keys
  • Rotate keys periodically — Especially if you suspect they've been exposed

Next Steps