Configuration
Learn how to configure your AgenticPacks application.
AgenticPacks reads its settings from a .env file at the root of the repository. .env.example is the template that ships with the repo. It lists every name the app and Docker Compose actually read. Your .env is the copy you edit, and it stays out of git.
Configuration is scoped to the pack. OSS and Pro do not share a template, and a variable that exists in one .env.example is not implied in the other. Use the tab for the repository you cloned.
This page covers the settings for local development, and the values production Compose checks before it will start.
Environment file
Copy the template once. After that, change values in .env only.
cp .env.example .envDatabase
DATABASE_URL is the Postgres connection string. Local Docker, Neon, Supabase, and Railway all use the same variable. Compose publishes Postgres on DB_PORT, which defaults to 5432. The process inside the container still uses its own port. Only the host connection string changes when you move DB_PORT.
# Host connection. The password here matches docker-compose.dev.yml.
DATABASE_URL="postgresql://postgres:postgrespassword@localhost:5432/agenticpacks_oss"
# Host ports. The app container still listens on 3000.
PORT=3000
DB_PORT=5432Authentication
Auth.js builds callback URLs from AUTH_URL and signs the session with AUTH_SECRET. For local development the origin is http://localhost:3000. Generate a new secret per machine. openssl rand -hex 32 is enough.
Google is optional. Empty AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET leave Google disabled. Email and password still work.
# Public origin. Auth.js builds callback URLs from this.
AUTH_URL="http://localhost:3000"
# Session signing secret. Replace before you share a deployment.
AUTH_SECRET="replace-with-openssl-rand-hex-32"
# Optional. Leave empty to keep Google sign-in off.
AUTH_GOOGLE_ID=""
AUTH_GOOGLE_SECRET=""If you change PORT, set AUTH_URL to the same origin. A mismatch is what breaks the Google callback and the session cookie.
AI
OSS calls one model, gpt-5-mini, through the AI SDK. OPENAI_API_KEY is required for that call. When the key is missing, POST /api/chat returns 400 and does not open a stream.
CHAT_MAX_TOKENS caps a streamed completion. The default is 4096. The chat route reads it from the environment. It is not part of the validated env schema, so a typo in the name is ignored and the default stays in place.
# Required for chat. Without it, POST /api/chat returns 400.
OPENAI_API_KEY="sk-..."
# Optional ceiling for one completion. Default is 4096.
CHAT_MAX_TOKENS="4096"Billing
Stripe is what your customers pay inside the app: Free, and Hobby at $19 a month. The code still names the $19 plan Pro. Leaving the Stripe keys empty is valid. The app boots, and Checkout stays off until both secrets are set.
STRIPE_APP_ID is stamped on Checkout and subscription metadata. It identifies this installation. It is not a hostname. A webhook whose appId does not match is acknowledged and does not change the plan or the credit balance.
# Leave empty to boot without Checkout.
STRIPE_SECRET_KEY=""
STRIPE_WEBHOOK_SECRET=""
# Stable name for this installation, copied onto Stripe metadata.
STRIPE_APP_ID="agenticpacks-oss"Database
Locally, the Next.js process reads DATABASE_URL. Production Compose does not use that string. It builds the URL from POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB, and it will not start when any of them is empty. There is no postgres / admin fallback.
The password has to stay URL-safe. @, :, /, and # break the connection string Compose assembles.
# Used by Next.js on the host (npm run dev).
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/agenticpacks?schema=public"
# Used by production Compose to build DATABASE_URL. All three are required there.
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=agenticpacksApplication URL
NEXT_PUBLIC_APP_URL is the origin the browser uses. NEXTAUTH_URL is the origin Auth.js uses for callbacks. In production they are the same https:// URL. DOMAIN is what Caddy reads when it requests a certificate.
DOMAIN="yourdomain.com"
NEXT_PUBLIC_APP_URL="https://yourdomain.com"
NEXTAUTH_URL="https://yourdomain.com"
# Session signing secret. Generate a new one per environment.
AUTH_SECRET="replace-with-openssl-rand-hex-32"Production Compose also requires GF_SECURITY_ADMIN_PASSWORD. That password is the Grafana login. The stack does not invent an admin password for you.
Authentication providers
Google and Resend are both optional for local development, because the seed accounts sign in with a password. Set them when you want those providers on a deployed app.
# Optional in development. Demo login works without them.
AUTH_GOOGLE_ID=""
AUTH_GOOGLE_SECRET=""
# Magic links and team invites. Leave empty until you send real email.
RESEND_API_KEY=""
EMAIL_FROM="AgenticPacks <[email protected]>"AI and search
Chat and the research agent can run against OpenAI, Anthropic, or Google. A provider disappears from the model selector when its key is empty, and a missing key uses the local mock stream so the screen still completes.
File search is different. Embeddings are OpenAI text-embedding-3-small. Without OPENAI_API_KEY, uploads fail. An Anthropic or Google key does not index documents.
ALLOW_MOCK_EMBEDDINGS exists for local experiments. It stores hash vectors, which are not semantic search. Leave it unset on any shared or production environment.
The researcher calls Tavily. Without TAVILY_API_KEY, that step has no web results.
OPENAI_API_KEY="sk-..."
ANTHROPIC_API_KEY="sk-ant-..."
GOOGLE_GENERATIVE_AI_API_KEY=""
TAVILY_API_KEY="tvly-..."
# Dev only. Never true in production.
ALLOW_MOCK_EMBEDDINGS="false"
REDIS_URL="redis://redis:6379"Inside Compose, REDIS_URL is redis://redis:6379. On the host, with Redis published locally, it is redis://localhost:6379.
Billing
Stripe in this app is what your customers pay: Hobby $19, Plus $49, and Team $99. Checkout builds the price in code. There is no publishable key and no Dashboard Price ID to paste.
STRIPE_APP_ID is copied onto the Checkout session and the subscription. Use a stable name for this installation, not a hostname. An event whose appId belongs to another installation returns 200 and does not change the database.
STRIPE_SECRET_KEY="sk_live_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
STRIPE_APP_ID="agenticpacks-pro"Values production Compose requires
Compose refuses to start when any of these is missing. They are the database identity, the public origin, the session secret, and the Grafana password. Empty strings are treated as missing.
AUTH_SECRETPOSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_DBNEXTAUTH_URLNEXT_PUBLIC_APP_URLGF_SECURITY_ADMIN_PASSWORD
Where to go next
Provider setup for sign-in is covered in Authentication. Customer prices and the webhook are covered in Billing.
