Configuration & Environment
Complete guide to configuring the AI Agent Automation Platform using environment variables and configuration files.
The .env File
The primary way to configure the backend engine is through environment variables. Copy the.env.example file to .env in the backend directory.
Server Settings
PORTThe port the Express server will listen on (default: 5000).NODE_ENVSet to 'production' or 'development'.Database Configuration
MONGODB_URIThe connection string for your MongoDB instance.DB_NAMEThe name of the database to use (default: agent_automation).AI Provider Settings
OPENAI_API_KEYYour OpenAI API key for LLM and embeddings.ANTHROPIC_API_KEYOptional: Your Anthropic API key for Claude models.GOOGLE_API_KEYOptional: Your Google API key for Gemini models.Security & Secret
JWT_SECRETA strong secret for signing authentication tokens.ENCRYPTION_KEYA 32-character key for encrypting sensitive tools data.Advanced Configuration
For more granular control, you can modify the configuration objects in src/config/index.ts. This includes settings for:
Worker Settings
Adjust the number of concurrent workflow executions and retry intervals.
Embedding Config
Switch between different embedding models and chunk sizes for RAG.
Logging Policies
Configure log retention periods and verbosity levels.
Scheduler Intervals
Change how often the scheduler polls for pending jobs.
Example .env
PORT=5000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/agent_automation
OPENAI_API_KEY=sk-your-key-here
JWT_SECRET=your-super-secret-jwt-key
ENCRYPTION_KEY=your-32-char-encryption-key-herePro-Tip: Local LLMs
You can use local LLMs (via Ollama or LocalAI) by overriding the BASE_URL for the OpenAI provider. Update the configuration in src/config/ai.ts to point to your local endpoint.