Environment Configuration

GAIA requires various environment variables to function properly. These variables configure API keys, database connections, and feature flags.

Infisical Integration: GAIA supports Infisical for secure secret management. When configured, Infisical secrets will override local environment variables. See our Infisical Setup Guide for more details.

Backend Environment Variables

Configure API keys, database connections, and backend services for the GAIA backend application

Frontend Environment Variables

Set up API URLs, authentication secrets, and frontend configuration for the GAIA web interface

Backend Environment Variables

Create a backend/.env file with the following variables:

Infisical Integration: If you’re using Infisical for secret management, you can add these environment variables to your Infisical project instead of the .env file. Infisical secrets will automatically override any local environment variables with the same names.

Core Application Settings

# Application Environment
ENV=development
HOST=localhost
FRONTEND_URL=http://localhost:3000
DISABLE_PROFILING=true

Database Configuration

# PostgreSQL (automatically configured in Docker)
POSTGRES_URL=postgresql://postgres:postgres@postgres:5432/langgraph

# MongoDB (automatically configured in Docker)
MONGO_DB=mongodb://mongo:27017/gaia

# Redis (automatically configured in Docker)
REDIS_URL=redis://redis:6379

# ChromaDB (automatically configured in Docker)
CHROMADB_HOST=chromadb
CHROMADB_PORT=8000

# RabbitMQ (automatically configured in Docker)
RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672/

AI Model APIs

Integration APIs

Search & Weather APIs

# Bing Search API
BING_API_KEY=your-bing-search-api-key

# OpenWeather API
OPENWEATHER_API_KEY=your-openweather-api-key
OPENWEATHERMAP_API_KEY=your-openweathermap-api-key

Communication & Payments

# Email (Resend)
RESEND_API_KEY=your-resend-api-key

# Razorpay (payments)
RAZORPAY_KEY_ID=your-razorpay-key-id
RAZORPAY_KEY_SECRET=your-razorpay-key-secret

# Blog/Content
BLOG_BEARER_TOKEN=your-blog-bearer-token

Docker Specific

# Docker Compose
COMPOSE_BAKE=true

Frontend Environment Variables

Create a frontend/.env file with the following variables:

Local Configuration: Frontend environment variables are typically configured locally as they’re needed during the build process. However, you can also manage sensitive frontend secrets through Infisical if needed.

# Base url of the backend api (this url will be the same)
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000/api/v1/

# Blog management bearer token (for creating/editing/deleting blog posts)
NEXT_PUBLIC_BLOG_BEARER_TOKEN=your-blog-management-token-here

Environment File Templates

Backend .env Template

Important: If you’re using Infisical, add your environment variables to your Infisical project instead. The variables below will be overridden by Infisical secrets if they have the same names. Read more about Infisical setup.

# Core Settings
ENV=development
DEBUG=true
HOST=localhost
FRONTEND_URL=http://localhost:3000

# Databases (Docker defaults)

POSTGRES_URL=postgresql://postgres:postgres@postgres:5432/langgraph
MONGO_DB=mongodb://mongo:27017/gaia
REDIS_URL=redis://redis:6379
CHROMADB_HOST=chromadb
CHROMADB_PORT=8000
RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672/

# AI APIs (replace with your keys)

OPENAI_API_KEY=sk-your-openai-api-key
GOOGLE_API_KEY=your-google-ai-api-key
HUGGINGFACE_API_KEY=hf_your-huggingface-token

# Google OAuth

GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

# Optional APIs

BING_API_KEY=your-bing-search-api-key
OPENWEATHER_API_KEY=your-openweather-api-key
RESEND_API_KEY=your-resend-api-key
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-cloudinary-api-key
CLOUDINARY_API_SECRET=your-cloudinary-api-secret

# Add other APIs as needed

Frontend .env Template

NEXT_PUBLIC_API_BASE_URL=http://localhost:8000/api/v1/

# Blog management bearer token (for creating/editing/deleting blog posts)
NEXT_PUBLIC_BLOG_BEARER_TOKEN=your-blog-management-token-here

Next Steps