Skip to main content

5. Environment, Database & Temporal

Your .env is the control panel for the running stack—not a checklist where every blank must be filled. Use this page to see what a setting changes, which service reads it, and whether existing data is affected.

Configuring a new installation? Start here

How to use this reference

.env.example is the canonical starting template. Compose and application code also provide a small number of runtime fallbacks and overrides. This page focuses on values an operator may realistically change. First-run secrets are explained in Installation; startup and recovery commands live in Run HAWKI RAG.

Find the setting you need

  • 🗄️ Laravel state PostgreSQL, database queues, cache, and sessions. Open section

  • ⏱️ Temporal Workflow routing, refresh schedules, retries, and time limits. Open section

  • 🔌 Ingestion tools Crawler, converter, authentication, and polling. Open section

  • 🧠 Models and retrieval Ollama, LiteLLM, reranking, web search, and embedding safety. Open section

What reads .env?

Docker Compose passes the same environment file to several services, but each service consumes only the settings it owns.

Before changing a value

The important question is not only “what value should I enter?” but also “what must happen after I change it?”

Type of changeRecreate services?Re-ingest existing datasets?Persistent-state concern
Endpoint, timeout, or retryYesNoNone
Temporal scheduleYesNoExisting schedules may also need to be updated
Chat or vision modelYesUsually noAn active workflow may retain the settings captured when it started
Embedding provider or modelYesYes, to move an existing datasetStored vectors must remain in one compatible embedding space
PostgreSQL or Neo4j passwordYesNoThe user inside the existing database must be updated as well
APP_KEYYesNoExisting sessions and encrypted values may become unreadable
Secrets are durable configuration

Do not rotate APP_KEY, DB_PASSWORD, or NEO4J_PASSWORD by editing .env alone. Follow a credential-rotation procedure for the persistent service first, then recreate the consumers.

Application and deployment

These settings describe how Laravel presents itself. The supported Make targets already select production or development runtime behavior.

Variable.env.example valueChange whenImpact
APP_NAMEHAWKI RAGA deployment needs different brandingRecreate Laravel
APP_URLhttp://localhost:8080The application has a public reverse-proxy URLRecreate Laravel; generated and MCP URLs follow it
APP_KEYInstallation secretOnly during deliberate key rotationRecreate Laravel; encrypted state may be invalidated
APP_TIMEZONEUTCLaravel timestamps should use another application timezoneRecreate Laravel; Temporal schedules remain UTC
SESSION_SECURE_COOKIEfalseThe public application is served over HTTPSSet true, then recreate Laravel

You normally do not need to edit APP_ENV, APP_DEBUG, HAWKI_RAG_APP_ENV, or HAWKI_RAG_APP_DEBUG.

Laravel state

PostgreSQL connection

Laravel metadata and Temporal persistence use the same PostgreSQL server. They remain separate data owners: Laravel uses its application tables, while Temporal owns its workflow-history schemas.

VariableDefaultOperator guidance
DB_CONNECTIONpgsqlKeep for the provided stack
DB_HOSTpostgresKeep unless PostgreSQL is deployed under a different service name
DB_PORT5432Change only when the PostgreSQL service listens on another internal port
DB_DATABASEhawki_ragLaravel application database
DB_USERNAMErag_userCredential used by Laravel and the local Temporal server
DB_PASSWORDInstallation secretSet before first start and keep synchronized with PostgreSQL
Core database topology comes from Compose

The provided Compose stack fixes the core containers to postgres:5432. Pointing the standard stack at another PostgreSQL host therefore requires a Compose override as well as matching .env values.

Queues, cache, and sessions

The standard stack keeps Laravel's operational state in PostgreSQL. This avoids introducing Redis or another queue service for the default deployment.

PurposeVariableDefaultOperator guidance
Laravel jobsQUEUE_CONNECTIONdatabaseKeep unless another Laravel queue backend and its workers are deliberately deployed
Queue databaseDB_QUEUE_CONNECTIONpgsqlUses the PostgreSQL connection
Failed jobsQUEUE_FAILED_DRIVERdatabase-uuidsKeeps failed-job records available for inspection
CacheCACHE_STOREdatabaseStores application cache and locks in PostgreSQL
Cache databaseDB_CACHE_CONNECTIONpgsqlUses the PostgreSQL connection
SessionsSESSION_DRIVERdatabaseStores browser sessions in PostgreSQL
Session databaseSESSION_CONNECTIONpgsqlUses the PostgreSQL connection
Idle session lifetimeSESSION_LIFETIME120Minutes before an inactive session expires
Laravel queues and Temporal task queues are different

Laravel's database queue stores application jobs in PostgreSQL. Temporal task queues route durable workflow and activity tasks to Python workers; they do not use Laravel's jobs table.

Database initialization is automatic

Supported make up-core* commands wait for PostgreSQL and run Laravel migrations before writable services start. Use make migrate-core only when you intentionally need to rerun migrations on an existing stack.

Before deploying a database upgrade, make migration-test runs the migration scenarios against an isolated temporary schema in the active PostgreSQL stack.

Temporal orchestration

Temporal makes long-running ingestion recoverable. The settings in this section control where tasks go, when recurring refreshes run, and how long external work may take.

Connection and workflow identity

VariableDefaultChange when
HAWKI_RAG_TEMPORAL_ENABLEDtrueTemporal orchestration is intentionally disabled
TEMPORAL_ADDRESStemporal:7233Temporal is hosted under another internal address
TEMPORAL_NAMESPACEdefaultThe deployment uses a dedicated Temporal namespace
TEMPORAL_INGEST_WORKFLOW_TYPEIngestSourceWorkflowOnly when application and workers are upgraded together to another workflow contract

The standard Compose stack fixes its internal Temporal address to temporal:7233. An external Temporal deployment also requires a matching Compose override.

How task queues divide the work

Queue names are coordination contracts

The client and the matching worker must use exactly the same task-queue name. Do not rename one value in isolation. If queue names change, recreate Laravel, the bridge, and all Temporal workers together.

Advanced: exact Temporal task-queue names
VariableDefaultConsumer
TEMPORAL_RAG_WORKFLOW_TASK_QUEUErag-workflow-task-queueWorkflow worker
TEMPORAL_RAG_SCRAPER_TASK_QUEUErag-scraper-task-queueScraper activity worker
TEMPORAL_RAG_CONVERTER_TASK_QUEUErag-converter-task-queueConverter activity worker
TEMPORAL_RAG_INGESTION_TASK_QUEUErag-ingestion-task-queueIngestion activity worker

Inspect the workers, task queues, workflows, and activities registered by the running application with:

docker exec -it hawki_rag_app php artisan pipeline:workers

Refresh schedule defaults

These expressions are used when daily, weekly, or monthly source refreshes are created. Temporal schedules use UTC.

VariableDefaultPractical meaning
TEMPORAL_RAG_DAILY_CRON0 2 * * *Every day at 02:00 UTC
TEMPORAL_RAG_WEEKLY_CRON0 2 * * 0Every Sunday at 02:00 UTC
TEMPORAL_RAG_MONTHLY_CRON0 2 1 * *First day of every month at 02:00 UTC

Time budget for one ingestion run

VariableDefaultIncrease when
TEMPORAL_WORKFLOW_EXECUTION_TIMEOUT172800 secondsA workflow may need more than 48 hours across retries
TEMPORAL_WORKFLOW_RUN_TIMEOUT86400 secondsOne run may legitimately exceed 24 hours
TEMPORAL_WORKFLOW_TASK_TIMEOUT30 secondsWorkflow task processing itself is consistently timing out
TEMPORAL_RAG_HTTP_TIMEOUT_SECONDS1800A crawler or converter request takes longer than 30 minutes
TEMPORAL_RAG_HTTP_RETRY_ATTEMPTS3The external service has transient request failures
TEMPORAL_RAG_EXTERNAL_POLL_INTERVAL_SECONDS5Status checks should be less frequent
TEMPORAL_RAG_EXTERNAL_POLL_TIMEOUT_SECONDS43200An external job may run longer than 12 hours
Advanced: workflow identity and storage handoff
VariableDefaultPurpose
TEMPORAL_CLIENT_IDENTITYhawki-rag-laravelIdentifies the HAWKI-RAG Temporal client
HAWKI_RAG_STORAGE_MODEsharedSelects the file handoff strategy
HAWKI_RAG_TEMPORAL_SHARED_ROOT/sharedShared path seen by pipeline workers
HAWKI_RAG_OBJECT_STORAGE_PREFIXs3://hawki-ragReserved prefix; keep shared-storage mode for the current stack
RAG_INGEST_GRAPHfalseEnables graph extraction for source workflows by default
RAG_INGEST_BRIDGE_TIMEOUT3600Time allowed for the bridge ingestion request

External ingestion services

The installation guide explains how the crawler and converter join the stack. This section only maps operational overrides to the consumer that uses them.

Crawler

VariableDefaultUsed byChange when
CUSTOM_CRAWLER_URLhttp://crawl4ai-serviceLaravel crawler integrationLaravel must reach a differently named crawler
CUSTOM_CRAWLER_TASK_UI_URLhttp://crawl4ai-serviceLaravel task-UI proxyThe crawler UI uses another base address
EXTERNAL_SCRAPER_URLhttp://crawl4ai-serviceTemporal scraper workerWorkflow calls use another crawler address
EXTERNAL_SCRAPER_START_PATH/crawlTemporal scraper workerThe crawler exposes another submission route
EXTERNAL_SCRAPER_STATUS_PATH/status/{job_id}Temporal scraper workerThe crawler exposes another status route
EXTERNAL_SCRAPER_TOKENEmptyTemporal scraper workerThe crawler requires a bearer token
CUSTOM_CRAWLER_API_KEYEmptyLaravel and scraper fallbackLaravel access needs authentication or no explicit scraper token is set

File converter

VariableDefaultUsed byChange when
FILE_CONVERTER_BASE_URLhttp://hawki-toolkit-file-converter-file-converter-1Laravel converter integrationLaravel must reach another converter address
EXTERNAL_CONVERTER_URLhttp://hawki-toolkit-file-converter-file-converter-1Temporal converter workerWorkflow calls use another converter address
EXTERNAL_CONVERTER_START_PATH/extractTemporal converter workerThe converter exposes another submission route
EXTERNAL_CONVERTER_STATUS_PATHEmptyTemporal converter workerA custom asynchronous converter exposes a status route
EXTERNAL_CONVERTER_TOKENfile-converter-keyTemporal converter workerThe converter uses another bearer token
FILE_CONVERTER_TOKENfile-converter-keyLaravel and converter fallbackLaravel access uses another token or no explicit workflow token is set

The retry and polling behavior for both tools is controlled by the TEMPORAL_RAG_HTTP_* and TEMPORAL_RAG_EXTERNAL_POLL_* variables in the Temporal time-budget table.

Providers and model contracts

Direct Ollama is the normal path. LiteLLM is an optional gateway selected explicitly for Ollama aliases or cloud providers.

Direct Ollama defaults

VariableDefaultRoleChange impact
RAG_DEFAULT_PROVIDERollamaDefault provider for ingestion and queriesNew work uses the selected provider
GRAPH_PROVIDERollamaDefault provider for graph/model operationsNew graph work uses the selected provider
OLLAMA_API_URLhttp://hawki_ollama:11434/apiDirect Ollama endpointRecreate Python services
OLLAMA_RAG_MODELllama3.1:8bChat, answer, and graph language tasksRecreate Python services
OLLAMA_EMBED_MODELbge-m3Dataset embeddingsExisting datasets must retain or intentionally rebuild their vectors
OLLAMA_VISION_MODELqwen2.5vl:7bImage and multimodal tasksRecreate Python services
Embeddings are a dataset contract

Changing the default embedding provider or model does not convert existing vectors. Query vectors must use the same model family and dimensions as the indexed vectors. See Ingestion & Embeddings before moving an existing dataset to another embedding model.

FeatureSelect withEndpoint or credentialDefault behavior
Local rerankerRERANKER_MODE=externalRERANKER_API_URL=http://hawki_rag_rerank:8000/v1/rerankEnabled through the local Cohere-compatible service
Jina rerankerRERANKER_MODE=jinaJINA_API_KEYAvailable only when a key is supplied
Tavily searchWEB_SEARCH_PROVIDER=tavilyTAVILY_SEARCH_API_KEYProvider selected, but unavailable while the key is empty
Brave searchWEB_SEARCH_PROVIDER=braveBRAVE_SEARCH_API_KEYAvailable only when selected and a key is supplied

RERANKER_PROVIDER and QUERY_MODE remain in .env.example for compatibility, but current reranker routing is selected by RERANKER_MODE and RERANKER_API_URL. Do not treat the compatibility values as active controls.

Advanced: LiteLLM routes and aliases
VariableDefaultPurpose
LITELLM_API_URLhttp://litellm:4000/v1Gateway endpoint used when LiteLLM is selected
LITELLM_API_KEYEmptyOptional bearer token for a protected LiteLLM gateway
LITELLM_CHAT_MODELhawki-ollama-chatDefault chat and graph alias
LITELLM_EMBED_MODELhawki-ollama-embeddingDefault embedding alias
LITELLM_VISION_MODELhawki-ollama-visionDefault vision alias
LITELLM_CHAT_ALIASESOllama, GPT, and Claude aliasesChat and graph allowlist accepted by Settings
LITELLM_EMBED_ALIASESOllama and OpenAI aliasesEmbedding allowlist accepted by Settings
LITELLM_VISION_ALIASESOllama, GPT, and Claude aliasesVision allowlist accepted by Settings
GRAPH_EMBEDDING_DIMENSIONSOllama 1024; OpenAI small 1536Trusted alias-to-dimension map for graph-only ingestion
UpstreamConfiguration familyRequired credential
Local OllamaLITELLM_OLLAMA_*None
OpenAILITELLM_OPENAI_*OPENAI_API_KEY
AnthropicLITELLM_ANTHROPIC_*ANTHROPIC_API_KEY

OpenAI and Anthropic keys are passed only to the optional LiteLLM container. They can remain empty for the default direct-Ollama stack.

Vector and graph stores

VariableDefaultOperator guidance
QDRANT_HTTP_URLhttp://qdrant:6333Keep for the provided vector-store service
QDRANT_API_KEYEmptySet only when Qdrant authentication is enabled
NEO4J_HTTP_URLhttp://hawki_rag_neo4j:7474Keep for the provided graph-store service
NEO4J_USERneo4jKeep synchronized with Neo4j authentication
NEO4J_PASSWORDInstallation secretSet before first start; rotate inside Neo4j before changing consumers
GRAPH_ENGINEraganythingChange only when another supported graph engine is implemented