Environment Variables Reference

January 12, 2026 ยท View on GitHub

Complete reference for all IntellyWeave environment variables in backend/.env.

Quick Start

cd backend
cp .env.example .env
nano .env

Weaviate Configuration

Option 1: Weaviate Cloud (Production)

WCD_URL=https://your-cluster.weaviate.cloud
WCD_API_KEY=your-weaviate-api-key
VariableRequiredDescription
WCD_URLYesWeaviate Cloud cluster URL
WCD_API_KEYYesWeaviate Cloud API key

Option 2: Local Docker (Development)

WEAVIATE_IS_LOCAL=True
LOCAL_WEAVIATE_PORT=8080
LOCAL_WEAVIATE_GRPC_PORT=50051
VariableDefaultDescription
WEAVIATE_IS_LOCALFalseEnable local Weaviate
LOCAL_WEAVIATE_PORT8080HTTP port
LOCAL_WEAVIATE_GRPC_PORT50051gRPC port

Option 3: Custom Instance

WEAVIATE_IS_CUSTOM=True
CUSTOM_HTTP_HOST=your.weaviate.host
CUSTOM_HTTP_PORT=443
CUSTOM_HTTP_SECURE=True
CUSTOM_GRPC_HOST=your.weaviate.host
CUSTOM_GRPC_PORT=443
CUSTOM_GRPC_SECURE=True
VariableDescription
WEAVIATE_IS_CUSTOMEnable custom Weaviate
CUSTOM_HTTP_HOSTHTTP hostname
CUSTOM_HTTP_PORTHTTP port
CUSTOM_HTTP_SECUREUse HTTPS (True/False)
CUSTOM_GRPC_HOSTgRPC hostname
CUSTOM_GRPC_PORTgRPC port
CUSTOM_GRPC_SECUREUse secure gRPC

LLM Provider API Keys

Primary Providers

# OpenAI (Required for GPT models)
OPENAI_API_KEY=sk-proj-...

# Anthropic (Required for Claude models)
ANTHROPIC_API_KEY=sk-ant-...

# OpenRouter (Multi-provider gateway)
OPENROUTER_API_KEY=sk-or-...
VariableProviderModels
OPENAI_API_KEYOpenAIGPT-4o, GPT-4o-mini, GPT-5
ANTHROPIC_API_KEYAnthropicClaude Sonnet, Claude Haiku
OPENROUTER_API_KEYOpenRouter100+ models

Google AI

GEMINI_API_KEY=...
VERTEX_API_KEY=...
STUDIO_API_KEY=...

Other Providers

COHERE_API_KEY=...
MISTRAL_API_KEY=...
HUGGINGFACE_API_KEY=hf_...
ANYSCALE_API_KEY=...
JINAAI_API_KEY=jina_...
NVIDIA_API_KEY=...
XAI_API_KEY=...
VOYAGE_API_KEY=...
VOYAGEAI_API_KEY=...
FRIENDLI_TOKEN=...
DATABRICKS_TOKEN=...

Cloud Providers

AWS_ACCESS_KEY=AKIA...
AWS_SECRET_KEY=...
AZURE_API_KEY=...

Quartermaster & Case Officer Tools

These services power the Archive Research workflow.

Multi-Provider Search Cascade (Sofia Service)

Used by Quartermaster to discover archive sources and by Case Officer to expand investigations. Providers are tried in order until results are found.

# Perplexity AI - AI-powered search with reasoning (recommended)
PERPLEXITY_API_KEY=pplx-...

# SearXNG - Self-hosted metasearch engine (for privacy)
SEARXNG_API_URL=http://localhost:8081

# Serper - Google Search API wrapper
SERPER_API_KEY=...

# Tavily - AI search optimized for LLM agents
TAVILY_API_KEY=tvly-...
VariableProviderBest For
PERPLEXITY_API_KEYPerplexityAI research with domain filtering
SEARXNG_API_URLSearXNGPrivacy-focused self-hosted
SERPER_API_KEYSerperGoogle Search results
TAVILY_API_KEYTavilyAI-optimized search

๐Ÿ“– Full Guide: See Sofia Search Service

Document Reader Cascade

Used by Case Officer to read and extract content from web sources. Readers are tried in order until content is extracted.

# Perplexity - AI extraction, no size limits (recommended)
PERPLEXITY_API_KEY=pplx-...

# Jina Reader - Converts web pages to clean markdown
JINA_API_KEY=jina_...

# AgentQL - AI-powered web content extraction (JS-heavy sites)
AGENTQL_API_KEY=...
VariableReaderBest For
PERPLEXITY_API_KEYPerplexityLarge documents, intelligent extraction
JINA_API_KEYJinaArticles, web pages
AGENTQL_API_KEYAgentQLJavaScript-heavy sites

Falls back to simple HTTP if none configured.

๐Ÿ“– Full Guide: See Document Reader Service

Aryn PDF Reader

AI-powered PDF partitioning with context-aware schema extraction. Provides intelligent PDF preview with investigation-relevant metadata.

# Get your API key at https://console.aryn.ai/
ARYN_API_KEY=...

When configured, Aryn provides:

  • Context-aware extraction: Uses investigation query and research domain
  • AI-inferred schema: Structured metadata tailored to research
  • OCR language support: Optimized for non-English documents
  • Content hypotheses: Relevance assessments for each PDF

๐Ÿ“– Full Guide: See Archive Domains Configuration


Model Configuration

BASE_MODEL=gpt-4o-mini
COMPLEX_MODEL=gpt-4o
BASE_PROVIDER=openai
COMPLEX_PROVIDER=openai
MODEL_API_BASE=https://api.openai.com/v1
VariableDefaultDescription
BASE_MODELgpt-4o-miniModel for simple queries
COMPLEX_MODELgpt-4oModel for complex analysis
BASE_PROVIDER(auto)Provider for BASE_MODEL
COMPLEX_PROVIDER(auto)Provider for COMPLEX_MODEL
MODEL_API_BASE(provider default)Custom API base URL

GPT-5 Specific

GPT5_REASONING_EFFORT=medium
GPT5_TEXT_VERBOSITY=low
VariableValuesDefaultDescription
GPT5_REASONING_EFFORTminimal, low, medium, highmediumReasoning depth
GPT5_TEXT_VERBOSITYlow, medium, highmediumOutput verbosity

Application Configuration

Logging

LOGGING_LEVEL=INFO
ValueDescription
DEBUGVerbose debugging
INFOStandard logging (recommended)
WARNINGWarnings only
ERRORErrors only

Timeouts

CLIENT_TIMEOUT=60
TREE_TIMEOUT=300
USER_TIMEOUT=600
VariableDefaultDescription
CLIENT_TIMEOUT60LLM client timeout (seconds)
TREE_TIMEOUT300Decision tree timeout (seconds)
USER_TIMEOUT600User session timeout (seconds)

Environment

ENVIRONMENT=development
NODE_ENV=development
ValueDescription
developmentDev mode with hot reload
productionProduction optimizations

Frontend

NEXTJS_DEV_URL=http://localhost:3000

Pipeline & Ingestion

PIPELINE_DATA_DIR=/app/data
PIPELINE_USER_ID=your-user-id
BATCH_WAIT_SECONDS=4
PIPELINE_AUTO_PREPROCESS=true
PIPELINE_AUTO_GEOCODE=false
VariableDefaultDescription
PIPELINE_DATA_DIR/app/dataDirectory to watch for files
PIPELINE_USER_ID(required)User ID for uploads
BATCH_WAIT_SECONDS4Wait time before batch processing
PIPELINE_AUTO_PREPROCESStrueAuto-preprocess documents
PIPELINE_AUTO_GEOCODEfalseAuto-geocode locations

Unstructured API (Optional)

UNSTRUCTURED_API_URL=https://api.unstructuredapp.io
UNSTRUCTURED_API_KEY=...

Geospatial Services

MAPBOX_ACCESS_TOKEN=pk.eyJ...
VariableRequiredDescription
MAPBOX_ACCESS_TOKENFor mapsMapbox API token

Get a token at account.mapbox.com/access-tokens


Security

FERNET_KEY=your-fernet-key-for-encryption
VariableDescription
FERNET_KEYEncryption key for sensitive data

Generate a key:

from cryptography.fernet import Fernet
print(Fernet.generate_key().decode())

Testing

TESTING_WCD_URL=https://your-test-cluster.weaviate.cloud
TESTING_WCD_API_KEY=your-test-weaviate-api-key
HF_TOKEN=hf_...
VariableDescription
TESTING_WCD_URLSeparate Weaviate for tests
TESTING_WCD_API_KEYTest cluster API key
HF_TOKENHuggingFace token for model downloads

Minimal Configuration

For quick development setup:

# Weaviate (local Docker)
WEAVIATE_IS_LOCAL=True
LOCAL_WEAVIATE_PORT=8080
LOCAL_WEAVIATE_GRPC_PORT=50051

# LLM Provider (at least one)
OPENAI_API_KEY=sk-proj-your-key-here

# Models
BASE_MODEL=gpt-4o-mini
COMPLEX_MODEL=gpt-4o

# Logging
LOGGING_LEVEL=INFO

Production Configuration

Recommended production settings:

# Weaviate Cloud
WCD_URL=https://production.weaviate.cloud
WCD_API_KEY=prod-api-key

# Models
BASE_MODEL=gpt-4o-mini
COMPLEX_MODEL=gpt-4o

# OpenAI
OPENAI_API_KEY=sk-proj-production-key

# Anthropic (for location enrichment)
ANTHROPIC_API_KEY=sk-ant-production-key

# Mapbox (for maps)
MAPBOX_ACCESS_TOKEN=pk.production-token

# Logging
LOGGING_LEVEL=WARNING

# Environment
ENVIRONMENT=production

# Security
FERNET_KEY=production-fernet-key

# Timeouts (longer for production)
CLIENT_TIMEOUT=120
TREE_TIMEOUT=600

Troubleshooting

Check Environment

# Print all set variables
grep -v '^#' backend/.env | grep -v '^$'

# Verify specific variable
echo $OPENAI_API_KEY

Common Issues

IssueCauseSolution
"API key not set"Missing keyAdd to .env
"Connection refused"Wrong Weaviate URLCheck WEAVIATE settings
"Model not found"Invalid model nameCheck model spelling
"Timeout"Settings too lowIncrease timeout values

See Also