Skip to content

Agent Configuration

The agent service is configured via environment variables, loaded and validated in internal/config/config.go.

VariableDescription
SLACK_BOT_TOKENSlack bot OAuth token (xoxb-...)
SLACK_SIGNING_SECRETSlack app signing secret for webhook verification
JIRA_BASE_URLJira instance URL (e.g., https://fetchrewards.atlassian.net)
JIRA_EMAILJira account email for API authentication
JIRA_API_TOKENJira API token (paired with email for basic auth)
GITHUB_APP_IDGitHub App ID
GITHUB_APP_INSTALLATION_IDGitHub App installation ID
GITHUB_APP_PRIVATE_KEYGitHub App private key (PEM format)
SOURCEGRAPH_TOKENSourcegraph API token for code search MCP
AGENT_BASE_URLPublic URL of the agent service (for callbacks)
ENVIRONMENTlocal or production identifier
VariableDefaultDescription
PORT8080HTTP server port
LOG_LEVELinfoStructured log level
JIRA_PROJECTADTDefault Jira project key for ticket creation
JIRA_WEBHOOK_SECRETSecret for verifying Jira webhook payloads
JIRA_ACCOUNT_IDJira account ID for ticket assignment
GITHUB_ORGfetch-rewardsDefault GitHub organization
GITHUB_WEBHOOK_SECRETSecret for GitHub App webhook signatures
BEDROCK_MODEL_IDus.anthropic.claude-sonnet-4-20250514-v1:0AWS Bedrock model ID
AWS_REGIONus-east-1AWS region for Bedrock
POSTHOG_PROJECT_API_KEYEnables LLM analytics and error tracking
POSTHOG_PROJECT_IDEnables /debug command trace URLs
SLACK_FEED_CHANNEL_IDChannel for post_to_feed tool
S3_IMAGE_BUCKETS3 bucket for re-hosting images
CLOUDFRONT_DOMAINCloudFront domain for permanent image URLs
DATABASE_HOSTPostgreSQL host (omit for in-memory sessions)
DATABASE_PORT5432PostgreSQL port
DATABASE_NAMEagent_sessionsPostgreSQL database name
DATABASE_USERpostgresPostgreSQL user
DATABASE_PASSWORDPostgreSQL password
DATABASE_PASSWORD_SECRET_NAMEAWS Secrets Manager name (alternative to DATABASE_PASSWORD)
Terminal window
cd agent
cp .env.example .env # fill in values
make run

For database sessions locally, start PostgreSQL with Docker:

Terminal window
cd agent
docker compose up -d

When DATABASE_HOST is unset, the agent falls back to InMemorySessionService — sessions are lost on restart but no database is needed.

The agent is deployed to ECS via FSD config at agent/ad-tools-agent.yml. The deployment config defines:

  • ECR repository: ad-tools-agent
  • Environment variables: Plain values in environment_variables
  • Secrets: Sensitive values from AWS Secrets Manager in secrets
  • IAM policy: bedrock:InvokeModel on Claude models
  • Dependencies: Aurora PostgreSQL database, S3 image bucket, CloudFront distribution

Stage/prod-specific values are configured in the variables section of the FSD config.