bash-A v2

Configuration

Environment variables for the API, providers, retrieval, database, and browser origins.

The backend reads environment variables when modules load, so restart the API after editing .env. The browser's NEXT_PUBLIC_API_URL is inlined when the Next.js app is built; rebuild after changing it.

Copy .env.example to .env at the repository root. Never commit secrets.

Core services

VariablePurpose
DATABASE_URLPostgreSQL connection string. Local Docker exposes port 5433.
NEO4J_URINeo4j Bolt connection.
NEO4J_USERNAMENeo4j login.
NEO4J_PASSWORDNeo4j password.
FRONTEND_ORIGINSComma-separated browser origins accepted by CORS.

Model providers

VariablePurpose
LLM_PROVIDERChat-generation provider.
LLM_MODELChat model name.
EMBEDDING_PROVIDEREmbedding provider, such as lmstudio or gemini.
EMBEDDING_MODELEmbedding model name.
LMSTUDIO_URLBase or fallback local model endpoint.
LMSTUDIO_CHAT_URLLocal chat completion endpoint.
LMSTUDIO_EMBEDDING_URLLocal embedding endpoint.
GOOGLE_API_KEYCredential used by Gemini embeddings.

Separate chat and embedding endpoints where possible to avoid swapping a large local model between tasks.

Planner and retrieval

VariablePurpose
PLANNERkeyword routes locally; llm enables model decomposition with fallback.
CHAT_RETRIEVERRetriever used by chat; defaults to hybrid_rr.
RERANK_ENABLEDSet to 0 to skip cross-encoder reranking.
RERANK_TOPNMaximum fused candidates sent to the reranker; default 20.
CHAT_MAX_TOKENSGeneration token limit for a chat response.
PLAN_MAX_TOKENSToken limit for an LLM-generated plan.

Browser and optional guard

VariablePurpose
NEXT_PUBLIC_API_URLPublic API origin used by the Next.js client; not a secret.
DEMO_TOKENOptional shared token for selected administrative routes.

When configured, the token is sent in the X-Demo-Token header. It does not add user sessions, per-user permissions, or protect every read endpoint.

On this page