brain / deploy /env.heavy.example
Leon4gr45's picture
Deploy complete BrainAPI source 42cde77950db
6663ad4 verified
Raw History Blame Contribute Delete
10.2 kB
# BrainAPI deploy profile: heavy
# Pair with deploy/docker-compose.heavy.yaml
# Stack: Neo4j + Milvus + Mongo + Redis; LLMs: GCP small + Azure large/embeddings
# LLM Implementation envs
LLM_SMALL_PROVIDER="gcp_vertex"
LLM_LARGE_PROVIDER="azure"
EMBEDDINGS_PROVIDER="azure"
AZURE_SMALL_LLM_MODEL="gpt-4o-mini"
AZURE_LARGE_LLM_MODEL="gpt-4o"
AZURE_LLM_API_VERSION="2024-12-01-preview"
AZURE_LLM_ENDPOINT="https://yourproject.openai.azure.com"
AZURE_LLM_SUBSCRIPTION_KEY="xyz"
GCP_EXTRA_SMALL_LLM_MODEL="gemini-3-flash-preview"
GCP_SMALL_LLM_MODEL="gemini-3-flash-preview"
GCP_LARGE_LLM_MODEL="gemini-3-flash-preview"
GCP_EMBEDDING_MODEL="text-embedding-005"
GCP_PROJECT_ID="your-project-id"
GCP_CREDENTIALS_PATH=".path-to-credentials-file.json"
BEDROCK_REGION="us-east-1"
BEDROCK_ACCESS_KEY_ID="your-access-key-id"
BEDROCK_SECRET_ACCESS_KEY="your-secret-access-key"
BEDROCK_SESSION_TOKEN=""
BEDROCK_SMALL_LLM_MODEL="us.anthropic.claude-3-5-haiku-20241022-v1:0"
BEDROCK_LARGE_LLM_MODEL="us.anthropic.claude-3-7-sonnet-20250219-v1:0"
BEDROCK_EMBEDDING_MODEL="amazon.titan-embed-text-v2:0"
OPENAI_API_KEY="sk-..."
OPENAI_BASE_URL=""
OPENAI_SMALL_LLM_MODEL="gpt-4o-mini"
OPENAI_LARGE_LLM_MODEL="gpt-4o"
OPENAI_EMBEDDING_MODEL="text-embedding-3-large"
# DeepSeek chat (OpenAI-compatible). No embeddings — keep EMBEDDINGS_PROVIDER on azure/openai/gcp_vertex/etc.
# LLM_SMALL_PROVIDER="deepseek"
# LLM_LARGE_PROVIDER="deepseek"
DEEPSEEK_API_KEY="sk-..."
DEEPSEEK_SMALL_LLM_MODEL="deepseek-v4-flash"
DEEPSEEK_LARGE_LLM_MODEL="deepseek-v4-pro"
# Embedding envs
# The following are just examples of the adapter implementation, you can have completely different envs
AZURE_EMBEDDING_FULL_ENDPOINT="https://yourproject.openai.azure.com/openai/deployments/text-embedding-3-large/embeddings?api-version=2023-05-15"
AZURE_EMBEDDING_KEY="xyz"
AZURE_EMBEDDING_MODEL="text-embedding-3-large"
EMBEDDINGS_SMALL_MODEL="paraphrase-multilingual-MiniLM-L12-v2"
EMBEDDINGS_LOCAL_MODEL="intfloat/e5-small"
EMBEDDING_NODES_DIMENSION=3072
EMBEDDING_TRIPLETS_DIMENSION=3072
EMBEDDING_OBSERVATIONS_DIMENSION=3072
EMBEDDING_DATA_DIMENSION=3072
EMBEDDING_RELATIONSHIPS_DIMENSION=3072
# Cache envs
# The following are just examples of the adapter implementation, you can have completely different envs
REDIS_HOST="redis"
REDIS_PORT=6379
REDIS_PASSWORD="replace-with-a-long-random-secret"
# Worker envs
# Can be whatever you prefer
# CELERY_BACKEND="rabbitmq"
# CELERY_UNBLOCKED_WINDOW_SECONDS is the window in seconds during which the number of unblocked events is counted
# CELERY_UNBLOCKED_MAX_RETRIES is the maximum number of unblocked events that can occur during the window
# CELERY_QUEUE_HEALTH_THRESHOLD is the maximum number of tasks that can be in the queue before the worker is considered unhealthy
CELERY_BACKEND="redis"
CELERY_UNBLOCKED_WINDOW_SECONDS=60
CELERY_UNBLOCKED_MAX_RETRIES=20
CELERY_QUEUE_HEALTH_THRESHOLD=50
# GraphDB envs
# The following are just examples of the adapter implementation, you can have completely different envs
NEO4J_HOST="neo4j"
NEO4J_PORT=7687
NEO4J_USERNAME="neo4j"
NEO4J_PASSWORD="replace-with-a-long-random-secret"
# VectorDB envs
# The following are just examples of the adapter implementation, you can have completely different envs
MILVUS_HOST="milvus"
MILVUS_PORT=19530
# PostgreSQL envs
# Used for data / vector / graph storage when DATA_DB, VECTOR_DB, or GRAPH_DB
# point at postgresql / pgvector / networkx.
# Each brain owns its own Postgres database (brain_<sanitized_id>).
# POSTGRES_SYSTEM_DATABASE holds the brains registry (data_brains table).
# POSTGRES_MAINTENANCE_DATABASE is used only for CREATE DATABASE statements.
POSTGRES_HOST="localhost"
POSTGRES_PORT=5432
POSTGRES_USERNAME="postgres"
POSTGRES_PASSWORD="password"
POSTGRES_SYSTEM_DATABASE="brainapi"
POSTGRES_MAINTENANCE_DATABASE="postgres"
# DataDB envs (Mongo alternative to PostgreSQL data layer)
# The following are just examples of the adapter implementation, you can have completely different envs
MONGO_HOST="mongo"
MONGO_PORT=27017
MONGO_USERNAME="root"
MONGO_PASSWORD="replace-with-a-long-random-secret"
MONGO_SYSTEM_DATABASE="system"
# Auth
# Used to handle authentication
BRAINPAT_TOKEN="your_token"
# MultiBrain
# Legacy flag; API requests never provision brains implicitly.
# Create explicitly through POST /system/brains or POST /system/workspaces.
BRAIN_CREATION_ALLOWED="false"
# Resolve a missing scope to an already-registered default brain; never creates it
DEFAULT_BRAIN_FALLBACK="true"
# Optional anonymous, read-only documentation search demo (disabled by default)
PUBLIC_DEMO_ENABLED="false"
PUBLIC_DEMO_BRAIN_ID="agentdemo"
PUBLIC_DEMO_MAX_K=10
# GCP
# Used on the oss project for the small LLM but can be changed to any other model
GCP_EXTRA_SMALL_LLM_MODEL="gemini-3-flash-preview"
GCP_SMALL_LLM_MODEL="gemini-3-flash-preview"
GCP_PROJECT_ID="your-project-id"
GCP_CREDENTIALS_PATH=".path-to-credentials-file.json"
# Celery
# Used to run the worker tasks
CELERY_WORKER_CONCURRENCY=4
# DocParser
# Used to parse the documents into markdown text
# and by forwarding the webhook (our app host) and the task identifier,
# we can be called back from the DocParser API to start the ingestion process
# with the created markdown text.
DOCPARSER_ENDPOINT="https://docparser.lumen-labs.ai"
APP_HOST="https://your-app-host.com/ingest"
DOCPARSER_TOKEN="your-docparser-token"
# Spacy
# Used to keep the spacy models in memory or reinitialize them on each request
SPACY_KEEP_MODELS_IN_MEMORY="true"
# Pipeline
# Used to configure the pipeline
# PIPELINE_MODE => lightweight = faster but less accurate, accurate = slower but more accurate
# MODELS_MODE => local = uses local models for llm and embeddings, remote = uses remote models for llm and embeddings
# OCR_MODE => docling = uses local docling ocr engine, docparser = uses remote docparser ocr pipeline engine
# AGENTIC_ARCHITECTURE => custom = uses the custom agentic architecture (faster and token efficient), langchain = uses the langchain agentic architecture
# RUN_GRAPH_CONSOLIDATOR => true = consolidates after ingest (LLM mutations; keep false until audited)
# RUN_OBSERVATIONS => true = ObservationsAgent LLM notes (does not write the graph)
# JANITOR_BATCH_SIZE => relationships per Janitor LLM call when batching (default 20)
# INGEST_JANITOR_MAX_LLM_CALLS => hard cap on Janitor LLM batches/session (default 2); remainder dropped with audit
# INGEST_ARCHITECT_PER_UNIT => true = Architect sees Scout chunks (+ prior window); false = full text (legacy)
# INGEST_DEFER_JANITOR => true = batched post-Architect Janitor; false = per-create Janitor (legacy)
# INGEST_ARCHITECT_MODE => batch (default; pure tools=[] extract; escalate to tooler on fail) | schema | tooler (ReAct rollback)
# INGEST_ARCHITECT_MAX_SCHEMA_CALLS => max LLM calls/unit in schema|batch before escalate (default 3)
# INGEST_ARCHITECT_ESCALATE => true (default) allow tooler escalate on empty schema; false = partial/empty unit
# INGEST_ARCHITECT_ESCALATE_MAX_TURNS => max tool turns on escalate tooler path (default 3)
# INGEST_ARCHITECT_DENSE_ENTITY_THRESHOLD => rechunk architect unit when Scout entities >= N (default 12)
# INGEST_ARCHITECT_DENSE_MAX_CHARS => max chars per dense rechunk part (default 1200)
# INGEST_ARCHITECT_PRIOR_CONTEXT => auto (default; scratchpad for batch/schema, raw for tooler) | scratchpad | raw
# INGEST_ARCHITECT_SCRATCHPAD_TOKEN_CAP => max reference tokens for prior scratchpad (default 500)
PIPELINE_MODE="accurate"
MODELS_MODE="remote"
OCR_MODE="docparser"
AGENTIC_ARCHITECTURE="custom"
RUN_GRAPH_CONSOLIDATOR="false"
RUN_OBSERVATIONS="false"
JANITOR_BATCH_SIZE="20"
INGEST_JANITOR_MAX_LLM_CALLS="2"
INGEST_ARCHITECT_PER_UNIT="true"
INGEST_DEFER_JANITOR="true"
INGEST_ARCHITECT_MODE="batch"
INGEST_ARCHITECT_MAX_SCHEMA_CALLS="3"
INGEST_ARCHITECT_ESCALATE="true"
INGEST_ARCHITECT_ESCALATE_MAX_TURNS="3"
INGEST_ARCHITECT_DENSE_ENTITY_THRESHOLD="12"
INGEST_ARCHITECT_DENSE_MAX_CHARS="1200"
INGEST_ARCHITECT_PRIOR_CONTEXT="auto"
INGEST_ARCHITECT_SCRATCHPAD_TOKEN_CAP="500"
# Search (off by default). BM25 requires DATA_DB=postgresql; heavy can enable
# dense-only search with SEARCH_USE_BM25=false.
# p50 SLO < 200 ms excluding embed.query RTT.
SEARCH_ENABLED="false"
SEARCH_USE_DENSE="true"
SEARCH_USE_BM25="true"
SEARCH_FUSION="rrf"
SEARCH_FUSION_ALPHA="0.5"
SEARCH_BM25_K1="1.2"
SEARCH_BM25_B="0.75"
CONTEXT_PASSAGE_MODE="hybrid"
GRAPH_DB="neo4j"
DATA_DB="mongo"
VECTOR_DB="milvus"
# Ollama
# Used to configure the ollama models
# Tests with models using OpenAI's function tool calling are not currently compatible with BrainAPI
OLLAMA_HOST="localhost"
OLLAMA_PORT=11434
# OLLAMA_LLM_SMALL_MODEL="hf.co/unsloth/gpt-oss-20b-GGUF:Q4_K_M"
# OLLAMA_LLM_LARGE_MODEL="hf.co/unsloth/gpt-oss-20b-GGUF:Q4_K_M"
# OLLAMA_LLM_LARGE_MODEL="hf.co/MaziyarPanahi/Qwen3-8B-GGUF:Q4_K_M"
# OLLAMA_LLM_SMALL_MODEL="hf.co/MaziyarPanahi/Qwen3-8B-GGUF:Q4_K_M"
OLLAMA_LLM_SMALL_MODEL="hf.co/unsloth/Qwen3-14B-GGUF:Q4_K_M"
OLLAMA_LLM_LARGE_MODEL="hf.co/unsloth/Qwen3-14B-GGUF:Q4_K_M"
# Plugins
PLUGINS_DIR="plugins"
PLUGIN_REGISTRY_URL="https://registry.brain-api.dev"
PLUGIN_PUBLISHER_API_KEY="your-publisher-api-key"
PLUGIN_PUBLISHER_ID="your-publisher-id"
# MCP
MCP_OAUTH_ISSUER_URL="https://your-mcp-oauth-issuer-url.com"
MCP_RESOURCE_SERVER_URL="https://your-mcp-resource-server-url.com"
# Tracing
TRACE_TRACKER_ENABLED=false
TRACE_QUEUE_MAX_SIZE=10000
TRACE_SLOW_REQUEST_MS=1000
TRACE_AGENT_SLOW_OPERATION_MS=30000
TRACE_HEARTBEAT_INTERVAL_SECONDS=30
TRACE_HEALTH_INTERVAL_SECONDS=30
TRACE_RESOURCE_INTERVAL_SECONDS=30
TRACE_HEALTH_TIMEOUT_SECONDS=1
TRACE_AGENT_LOOP_ITERATIONS=20
TRACE_AGENT_TOOL_LOOP_ITERATIONS=20
# Compose inputs (pass this file with `docker compose --env-file`).
BRAINAPI_IMAGE="ghcr.io/lumen-labs/brainapi:v2.19.0-dev"
BRAINAPI_ENV_FILE="env.heavy.example"
BACKUP_DIR="/srv/brainapi/backups"
PLUGIN_FAILURE_POLICY="fail"
CORS_ALLOWED_ORIGINS=""
MINIO_ACCESS_KEY="replace-with-a-random-access-key"
MINIO_SECRET_KEY="replace-with-a-long-random-secret"
MILVUS_ROOT_PASSWORD="replace-with-a-long-random-secret"
MILVUS_TOKEN="root:replace-with-a-long-random-secret"