Agent Configuration
Source-based development reads the root .env first; use luna-agent/.env.local only for Agent-specific overrides. Docker Compose also uses the root .env as the single authoring entry and injects only the Agent's actual logging, OpenTelemetry, database-pool, and diagnostic dependencies. Compose fixes NODE_ENV=production, AUTH_MODE=bff-hmac, and the container-internal API address.
Basic configuration
- Note: Production requires
bff-hmacand the sameAI_INTERNAL_SECRETused by API.
Production requires PostgreSQL and Luna API configuration. The readiness probe checks the database schema and
Provider configuration; it returns 503 and the Agent stops accepting new Runs while either dependency is
unavailable. Active-Run deltas remain in the current Agent process, so production deployment is fixed to one
replica. A process restart converges unfinished Runs to interrupted; committed Timeline and terminal facts remain
available from PostgreSQL.
Advanced configuration
Database connections
Observability
Context management
The Agent uses fixed context boundaries: one user turn accepts at most 128 KiB of text, and history older than 32 turns is compressed while the latest 16 turns remain intact. Tool results, summary requests, and continuation messages also use built-in limits. These limits protect request transport and process memory; they are not token counts and require no deployment tuning.
The Agent injects only the workflow references needed by the current task and does not duplicate them in history. A pure continuation such as “continue” reselects references from the latest explicit goal. User and page data plus completed interactions are replayed with fixed boundaries. A summary update starts a new cache-prefix epoch, so one cold request is expected before later turns reuse that summary prefix.
Docker Compose
Compose does not inject PUBLIC_BASE_URL, Redis, the platform encryption key, initial-administrator settings, or Worker execution policy into Agent. Set the AI_INTERNAL_SECRET shared by API and Agent once in the root .env.