Skip to main content

Configuration

Customize Xagent for your environment, use cases, and preferences.

Quick Start

Create a .env file in your project root:
Then start with Docker Compose:

Complete Environment Variables

Core Settings

Database

Server

Security

XAGENT_JWT_SECRET=replace-with-a-long-random-secret is a placeholder. Replace it before production deployment.
Generate a strong JWT secret with:

Model Providers

OpenAI

Inference API

DeepSeek

Anthropic / Claude

Google / Gemini

Zhipu AI

DashScope (Alibaba Cloud)

Memory Configuration

Xagent supports two memory storage types:

In-Memory Storage (Default)

Fast, non-persistent storage. No configuration required.

LanceDB Storage

Persistent vector storage for semantic search:
If embedding API keys are configured, LanceDB is used automatically for memory storage at <project_root>/memory_store/. Without embedding keys, in-memory storage is used.

Tool Configuration

Proxy Settings

Image Processing

Background Jobs

If you enable asynchronous jobs for long-running ingestion, indexing, or other deferred work, configure the worker runtime and broker:
The bundled Docker Compose deployment includes Redis plus worker processes for this mode. If you disable background jobs, keep the rest of the stack aligned with your deployment choice.

Authentication Providers

Google OIDC

Use Google as an external login provider:
FRONTEND_URL should match the user-facing URL of your Xagent deployment so browser redirects and auth hand-offs resolve correctly.

Tracing & Observability

Langfuse

Track and debug agent executions:

Frontend Configuration

For Next.js frontend, create .env.local:

Example Configuration Files

Docker Compose (.env)

Local Development (.env)

Security Best Practices

  1. Generate strong keys — Use cryptographic tools for secrets
  2. Restrict permissionschmod 600 .env
  3. Environment isolation — Different keys for dev, staging, production
  4. Regular rotation — Update secrets periodically
  5. Use vaults — AWS Secrets Manager, HashiCorp Vault for production

Next Steps