Skip to content

Configuration

AgentLens is configured through environment variables with sensible defaults. No config files needed.

Server Configuration

VariableDefaultDescription
PORT3400HTTP server port
CORS_ORIGIN*CORS allowed origins (comma-separated or *)
AUTH_DISABLEDfalseDisable API key authentication (dev mode only)
DB_PATH./agentlens.dbSQLite database file path
DATABASE_PATH./agentlens.dbAlias for DB_PATH
RETENTION_DAYS90Days to keep events (0 = keep forever)

Example

bash
PORT=3400 \
DB_PATH=/var/data/agentlens.db \
RETENTION_DAYS=180 \
AUTH_DISABLED=false \
npx @agentlensai/server

MCP Server Configuration

VariableDefaultDescription
AGENTLENS_API_URLhttp://localhost:3400AgentLens server URL
AGENTLENS_API_KEYAPI key for authentication
AGENTLENS_AGENT_NAMEunnamed-agentHuman-readable agent name
AGENTLENS_AGENT_VERSIONAgent version string
AGENTLENS_ENVIRONMENTdevelopmentEnvironment tag (development/staging/production)

Example

json
{
  "mcpServers": {
    "agentlens": {
      "command": "npx",
      "args": ["@agentlensai/mcp"],
      "env": {
        "AGENTLENS_API_URL": "http://localhost:3400",
        "AGENTLENS_API_KEY": "als_abc123...",
        "AGENTLENS_AGENT_NAME": "my-agent",
        "AGENTLENS_AGENT_VERSION": "2.1.0",
        "AGENTLENS_ENVIRONMENT": "production"
      }
    }
  }
}

SQLite Tuning

AgentLens uses SQLite with these performance-optimized pragmas (applied automatically):

PragmaValueWhy
journal_modeWALConcurrent read/write support
synchronousNORMALGood durability with better performance
cache_size-6400064 MB page cache
busy_timeout50005s retry on lock contention

These are set at database initialization and cannot be changed via environment variables.

Integration Secrets

Webhook secrets for integration endpoints are configured via the Settings page in the dashboard or via the config API:

bash
# Set AgentGate webhook secret
curl -X PUT http://localhost:3400/api/config \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer als_your_key" \
  -d '{"agentGateSecret": "your-hmac-secret"}'

# Set FormBridge webhook secret
curl -X PUT http://localhost:3400/api/config \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer als_your_key" \
  -d '{"formBridgeSecret": "your-hmac-secret"}'

Released under the MIT License.