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
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.
# OpenAI API (recommended)OPENAI_API_KEY=sk-your-openai-api-key# Google AI/GeminiGEMINI_API_KEY=your-gemini-api-key# Hugging FaceHUGGINGFACE_API_KEY=hf_your-huggingface-token# LlamaIndexLLAMA_INDEX_KEY=llx-your-llamaindex-key
# Google OAuthGOOGLE_CLIENT_ID=your-google-client-idGOOGLE_CLIENT_SECRET=your-google-client-secret# Google Cloud Pub/SubGCP_TOPIC_NAME=your-pubsub-topic
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.
Copy
# 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
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.
Copy
# Core SettingsENV=developmentDEBUG=trueHOST=localhostFRONTEND_URL=http://localhost:3000# Databases (Docker defaults)POSTGRES_URL=postgresql://postgres:postgres@postgres:5432/langgraphMONGO_DB=mongodb://mongo:27017/gaiaREDIS_URL=redis://redis:6379CHROMADB_HOST=chromadbCHROMADB_PORT=8000RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672/# AI APIs (replace with your keys)OPENAI_API_KEY=sk-your-openai-api-keyGOOGLE_API_KEY=your-google-ai-api-keyHUGGINGFACE_API_KEY=hf_your-huggingface-token# Google OAuthGOOGLE_CLIENT_ID=your-google-client-idGOOGLE_CLIENT_SECRET=your-google-client-secret# Optional APIsBING_API_KEY=your-bing-search-api-keyOPENWEATHER_API_KEY=your-openweather-api-keyRESEND_API_KEY=your-resend-api-keyCLOUDINARY_CLOUD_NAME=your-cloud-nameCLOUDINARY_API_KEY=your-cloudinary-api-keyCLOUDINARY_API_SECRET=your-cloudinary-api-secret# Add other APIs as needed
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