DDARE Docs
Reference

Backend Configuration

Every backend environment variable, with type, default, and description.

The backend reads every variable from .env at startup in config/env.py, and the settings modules in config/settings/ (common, local, production) use those values. Copy .example.env to .env and edit it.

Defaults below are the code defaults, used when a variable is unset. .example.env sets some of them differently for local development.

Values that must match across services

VariableMust equal
SSO_JWT_KEYThe same variable in socraticbots-backend, which verifies DARE's JWTs
DARE_INTERNAL_KEYThe same variable in socraticbots-backend and voice-agent-runtime

Django core

VariableDefaultDescription
DJANGO_SETTINGS_MODULEconfig.settings.productionSettings module. manage.py, dare/asgi.py and dare/wsgi.py fall back to production when unset; .example.env sets config.settings.local.
DJANGO_SECRET_KEYRequiredDjango secret key. Replace the example value before any non-local use.
SSO_JWT_KEY(empty)Signs the JWTs DARE issues (SimpleJWT SIGNING_KEY). Set it in every deployment.
DJANGO_DEBUGFalseDebug responses when exactly True. Must be False in production.
ENVIRONMENTlocalOne of local, dare-staging, dare-production, gt-production (config/environment.py). Any other value logs a warning and falls back to local.
SITE_ID1Django sites framework site ID.
ALLOWED_HOSTS127.0.0.1,localhostComma-separated hostnames Django serves.
CORS_ALLOWED_ORIGINShttps://dare-front.hss.cmu.eduComma-separated origins allowed to make CORS requests. Production settings only; local settings allow all origins.
CSRF_TRUSTED_ORIGINShttps://dare-front.hss.cmu.eduComma-separated origins trusted for CSRF-protected POSTs. Production settings only.

Database

VariableDefaultDescription
USE_POSTGRESFalseLocal settings only: True connects to Postgres with the DB_* values; otherwise SQLite at db.sqlite3. Production settings always use Postgres.
DB_NAME(none)Postgres database name.
DB_USER(none)Postgres user.
DB_PASSWORD(none)Postgres password. Docker Compose refuses to start without it.
DB_HOST(none)Postgres host.
DB_PORT(none)Postgres port.

Redis and background jobs

VariableDefaultDescription
REDIS_HOST127.0.0.1Redis host for RQ, the cache and the channel layer.
REDIS_PORT6379Redis port.
REDIS_DB1Redis logical database.
REDIS_PASSWORD(none)Redis password when AUTH is on.
INGESTION_RECONCILE_INTERVAL_SECONDS300How often the scheduler sweeps files stranded in Processing by a dead worker. 0 disables the recurring sweep; workers still sweep at startup.
CONVERSATION_SUMMARY_JOBS_ENABLEDFalseEnable rolling conversation summaries. Off by default to keep ingestion workers free.

LLM providers

OPENAI_API_KEY, CLAUDE_API_KEY, GEMINI_API_KEY, PINECONE_API_KEY and PINECONE_INDEX_NAME must be present in the environment, or startup fails with ImproperlyConfigured. An empty value is allowed and disables that provider.

VariableDefaultDescription
OPENAI_API_KEYRequired (may be empty)OpenAI API key, for GPT models.
CLAUDE_API_KEYRequired (may be empty)Anthropic API key, for Claude models.
GEMINI_API_KEYRequired (may be empty)Google AI API key, for Gemini models.
OLLAMA_HOSThttp://localhost:11434Ollama server URL for self-hosted LLaMA models.
BACKGROUND_MODELgpt-5.6-lunaModel for titles, summaries, memory extraction and Advanced RAG query analysis.
LLM_STREAM_IDLE_TIMEOUT_SECONDS120How long a provider stream may stay silent before the tool loop fails the round.
LLM_SANDBOX_IDLE_TIMEOUT_SECONDS300The same limit while sandbox code runs or files upload.
BOT_WALLET_ENFORCEMENT_ENABLED01 applies bot wallet routing (the chatter pays; anonymous chats fall back to the bot owner).

Embeddings

Documents, retrieval, shared libraries and memory embed text through any OpenAI-compatible /v1/embeddings endpoint. These are deployment settings, not user choices: documents and the questions asked of them must be embedded by the same model. Unset, DARE uses OpenAI exactly as before.

VariableDefaultDescription
EMBEDDING_BASE_URL(OpenAI)Base URL of the embedding server, e.g. http://localhost:11434/v1.
EMBEDDING_API_KEYOPENAI_API_KEYKey sent to the embedding server. Servers without auth ignore it.
EMBEDDING_MODELtext-embedding-3-largeModel for documents, retrieval and shared libraries.
EMBEDDING_DIMENSIONS3072Vector length the model returns. Every generated vector is checked against it, and new shared libraries record it.
MEMORY_EMBEDDING_MODELtext-embedding-3-smallModel for memory rows and memory retrieval, on the same server. Memory always requests 512 dimensions (its column is vector(512)).

On OpenAI, DARE sends EMBEDDING_DIMENSIONS in the request, so text-embedding-3-large can be shortened (e.g. to 1024). With EMBEDDING_BASE_URL set it does not, because many local servers reject the field: set EMBEDDING_DIMENSIONS to the model's native length.

A self-hosted example with Ollama (ollama pull nomic-embed-text):

EMBEDDING_BASE_URL=http://localhost:11434/v1
EMBEDDING_MODEL=nomic-embed-text
EMBEDDING_DIMENSIONS=768
MEMORY_EMBEDDING_MODEL=nomic-embed-text
WEAVIATE_COLLECTION_NAME=DocumentNomic768

Ollama honours dimensions for nomic-embed-text, so memory gets 512-dimension vectors from the same server.

vLLM works the same way: vllm serve <model> --task embed and point EMBEDDING_BASE_URL at http://<host>:8000/v1.

Memory embeddings that the server rejects, or that are not 512 long, are dropped, and memory ranks on its lexical and recency signals alone. To keep semantic memory on a local server, use a model that can return 512 dimensions.

Changing the embedding model

Vectors from different models are not comparable, and the vector stores fix their length on first write. A Pinecone index has one dimension set at creation, so writes of any other length fail. A Weaviate collection takes its vector length from the first object, so writes of another length fail too. Changing EMBEDDING_MODEL or EMBEDDING_DIMENSIONS therefore needs a fresh container and a re-embed:

  1. Point DARE at an empty container: a new WEAVIATE_COLLECTION_NAME, or a new Pinecone index with the new dimension in PINECONE_INDEX_NAME.
  2. Restart the backend and the workers.
  3. Re-embed documents: python manage.py reprocess_documents --all --limit 100000.
  4. Re-import shared libraries: python manage.py import_library --library <slug> ..., which re-embeds with the configured model. Update the library's embedding_model and dims in Django admin.

Until a document is re-embedded, retrieval cannot find it.

Vector stores

You can configure Pinecone (managed), Weaviate (self-hosted) or both; users choose in their preferences.

VariableDefaultDescription
PINECONE_API_KEYRequired (may be empty)Pinecone API key.
PINECONE_INDEX_NAMERequired (may be empty)Pinecone index for document embeddings.
WEAVIATE_HOSTlocalhostWeaviate host.
WEAVIATE_PORT8080Weaviate HTTP port.
WEAVIATE_GRPC_PORT50051Weaviate gRPC port. Searches use gRPC, so remap it whenever you remap the HTTP port.
WEAVIATE_COLLECTION_NAMEDocumentCollection for stored embeddings.
WEAVIATE_SKIP_INIT_CHECKSTrueSkip startup connectivity checks.
WEAVIATE_AUTOSCHEMA_ENABLEDFalseLet Weaviate auto-create the schema. Not recommended in production.
SOURCE_WEAVIATE_URL(none)Source Weaviate for manage.py import_library, separate from DARE's own.
SOURCE_WEAVIATE_CLASS(none)Source class for import_library.
SOURCE_WEAVIATE_API_KEY(none)Source API key for import_library.

Document processing

VariableDefaultDescription
DOCUMENT_ENRICHMENT_ENABLEDTrueDocling figure descriptions and scanned-page transcription.
DOCUMENT_ENRICHMENT_MODELgemini-3.1-flash-liteVision model, resolved from DARE's LLM catalog so billing stays consistent.
DOCUMENT_ENRICHMENT_CONCURRENCY2Simultaneous vision operations per document, clamped to 1–4.
DOCUMENT_ENRICHMENT_MAX_FIGURES40Most figures described per document.
DOCUMENT_OCR_AUTO_PAGE_LIMIT10Pages transcribed automatically.
DOCUMENT_OCR_MAX_PAGE_LIMIT100Most pages a user can choose to transcribe.
DOCUMENT_OCR_ESTIMATED_INPUT_TOKENS_PER_PAGE5000Input tokens per page for the cost estimate.
DOCUMENT_OCR_ESTIMATED_OUTPUT_TOKENS_PER_PAGE2000Output tokens per page for the cost estimate.
DOCUMENT_OCR_JOB_TIMEOUT_SECONDS3600RQ timeout for a transcription job.

Advanced RAG

These are read from Django settings first, then the environment. Boolean flags treat 0, false, no and off as off.

VariableDefaultDescription
RAG_RERANKER_MODELBAAI/bge-reranker-v2-m3Reranker. BGE gives calibrated 0–1 scores; cross-encoder/ms-marco-MiniLM-L-6-v2 is the fast local option (raw logits).
RAG_GROUNDING_THRESHOLD0.3 (BGE) or 0.0 (MiniLM / MS MARCO)Grounding cutoff on the reranker's score scale.
RAG_RERANKER_DEVICEautoDevice for the reranker model.
RAG_RERANKER_MAX_LEN512Reranker max sequence length.
RAG_CONTEXT_CHAR_BUDGET16000Characters of retrieved context per prompt.
RAG_SNIPPET_CHAR_CAP2000Characters kept per snippet.
RAG_GRAPH_EXPAND_ENABLEDtrueOn the document path, follow stored in-document references ("see section 7.2") one hop from each retrieved chunk before reranking. Turning it off leaves ingest unchanged.
RAG_ENTITY_NER_ENABLEDtrueRun the GLiNER named-entity lane at ingest alongside the regex identifier lane. Identifiers still run when it is off.
RAG_ENTITY_MODELurchade/gliner_small-v2.1GLiNER checkpoint for the NER lane, loaded on first use.
RAG_ENTITY_HOPS_ENABLEDtrueWith two or more files selected, follow a hit's rarest shared entity into one chunk of another selected file during the expand stage.

Email

Registration sends a verification link, and users can't sign in until they open it. Set EMAIL_PROVIDER to choose how mail is sent. Every provider also writes an EmailLog row.

  • resend: sends through the Resend API with RESEND_API_KEY. EMAIL_FROM must use a sender or domain verified in Resend.
  • smtp: sends through your SMTP server, signing in with EMAIL_HOST_USER and EMAIL_HOST_PASSWORD when they are set.
  • console: only writes mail to the log. Nothing reaches an inbox, so the frontend tells new users to ask an administrator to verify their account.

When EMAIL_PROVIDER is unset, the backend infers it, as older versions did: resend when EMAIL_HOST_USER and EMAIL_HOST_PASSWORD are both set (the password is then the Resend key), smtp when only EMAIL_HOST is set, and console otherwise. Set the provider explicitly for authenticated SMTP, because a username and password alone select Resend.

VariableDefaultDescription
EMAIL_PROVIDER(inferred)resend, smtp or console. Any other value stops startup.
EMAIL_FROM(none)From: address for every email.
EMAIL_HOST(none)SMTP host.
EMAIL_PORT587SMTP port.
EMAIL_HOST_USER(none)SMTP username.
EMAIL_HOST_PASSWORD(none)SMTP password. Also the Resend key when RESEND_API_KEY is unset.
EMAIL_USE_TLSFalseUpgrade the SMTP connection with STARTTLS, usually on port 587.
EMAIL_USE_SSLFalseConnect over implicit TLS, usually on port 465. Don't combine with EMAIL_USE_TLS.
RESEND_API_KEYEMAIL_HOST_PASSWORDResend API key.

The link in the email is FRONTEND_CONFIRM_EMAIL_URL followed by /?key=…, so set it to the public address of the frontend's confirmation page, without a trailing slash, for example https://dare.example.edu/users/confirm-email.

A self-hosted deployment using an authenticated SMTP relay:

EMAIL_PROVIDER=smtp
EMAIL_HOST=smtp.example.edu
EMAIL_PORT=587
EMAIL_HOST_USER=dare-mailer@example.edu
EMAIL_HOST_PASSWORD=your_smtp_password
EMAIL_USE_TLS=True
EMAIL_FROM="DARE <dare-mailer@example.edu>"
FRONTEND_CONFIRM_EMAIL_URL=https://dare.example.edu/users/confirm-email

To check what the backend selected:

python manage.py shell -c "from django.conf import settings; print(settings.EMAIL_PROVIDER, settings.EMAIL_BACKEND)"

Cross-platform URLs and keys

Used for unified authentication, email links and inter-service calls.

VariableDefaultDescription
FRONTEND_CONFIRM_EMAIL_URL(none)Public URL of the frontend's confirmation page, without a trailing slash. Verification links are built from it.
FRONTEND_PASSWORD_RESET_URL(none)Base URL for password-reset links.
DARE_FRONTEND_URL(none)Public URL of the DARE frontend.
DARE_BACKEND_URL(none)Public URL of this backend.
SOCRATIC_BOTS_FRONTEND_URL(none)Socratic Bots frontend URL (optional).
SOCRATIC_BOTS_BACKEND_URL(none)Socratic Bots backend URL (optional).
DARE_INTERNAL_KEYlocal-dev-internal-keyShared secret for partner backends calling internal endpoints. Replace it in production.

Research mode (Hermes)

VariableDefaultDescription
HERMES_GATEWAY_URLhttp://127.0.0.1:8642Hermes agent gateway.
HERMES_PROFILES_ROOT~/.hermes/profilesDirectory of per-project Hermes profiles (one HERMES_HOME each, served under /p/&lt;profile&gt;/).
HERMES_PROFILE_PREFIXdare-projProfile name prefix. Names must match [a-z0-9][a-z0-9_-]{0,63}.
HERMES_PROFILE_MODELclaude-sonnet-5Model pinned into every project profile.
HERMES_PROFILE_MODEL_PROVIDERanthropicProvider for that model.
HERMES_PROFILE_MODEL_BASE_URL(empty)OpenAI-compatible gateway (such as LiteLLM) that every profile calls instead of a named provider.
HERMES_PROFILE_MODEL_API_KEY(empty)Key DARE writes into each profile's .env, under the provider's variable when no gateway URL is set.
HERMES_PROFILE_FALLBACK_MODELS(empty)Ordered fallback chain on rate limits or outages: comma-separated provider=model pairs.
HERMES_PROFILE_MAX_TURNS30Agent-loop ceiling written into every profile.
HERMES_PROFILE_TOKEN_DAYS365Lifetime of the owner's JWT in a profile's .env.
HERMES_STREAM_IDLE_SECONDS180How long a run's event stream may stay silent before DARE polls Hermes for the run's state.
HERMES_RUN_WAIT_SECONDS1800How long a background run keeps polling once its stream goes quiet.
HERMES_TOOLS_WAIT_SECONDS90How long a run waits for Hermes to load a new profile's DARE tools.
RESEARCH_PROJECT_SPEND_CAP_USD0Most a research project may spend on agent runs, in USD. 0 means no cap.
OPENALEX_MAILTO(empty)Identifies DARE to OpenAlex paper search, which joins its faster polite pool.
DARE_MCP_GATEWAY_URLDARE_BACKEND_URL + /mcp/api/gateway/Where a profile's MCP client reaches DARE. Must resolve from the gateway host, not the browser.

Platform assistant (Ask DARE)

VariableDefaultDescription
ASSISTANT_MODEL_IDENTIFIERgpt-6-lunaModel for the in-app assistant, paid by the platform. Must be an active model.
ASSISTANT_DAILY_MESSAGE_LIMIT50Assistant messages per user per day.
ASSISTANT_AGENT_MAX_OUTPUT_RATE10Highest output price, in USD per million tokens, of an agent model the assistant recommends.

Observability

VariableDefaultDescription
SENTRY_DSN(none)Sentry DSN. Empty disables Sentry.
SENTRY_ENVIRONMENTdevelopmentEnvironment tag that separates dev, staging and production in Sentry.
SENTRY_TRACES_SAMPLE_RATE0.1Fraction of requests traced for performance monitoring.

MCP

VariableDefaultDescription
MCP_USE_DOCKERFalseTrue launches MCP servers in Docker containers; otherwise they run as subprocesses.

SyftBox

SyftBox integration for federated data sharing.

VariableDefaultDescription
SYFTBOX_ENABLEDFalseEnable SyftBox sync.
SYFTBOX_DATASITES_ROOT(none)Root path for local SyftBox datasites.
SYFTBOX_APP_NAMEdareApp name registered with SyftBox.
SYFTBOX_BASE_URLhttps://syftbox.netSyftBox base URL.
SYFTBOX_SYNC_INTERVAL_SECONDS300Sync interval in seconds.

Docker Compose

docker-compose.yml reads these from .env and overrides the matching runtime variables inside the web and worker containers.

VariableDefaultDescription
WEB_PORT8000Host port for the API.
POSTGRES_PORT5432Host port for Postgres.
WEAVIATE_CONSOLE_PORT8081Host port for the Weaviate console (debug profile).
OLLAMA_PORT11434Host port for Ollama (llama profile).
QUILLMARK_DEBUG_PORT8090Loopback port for quillmark-mcp, for debugging.
DOCKER_DJANGO_SETTINGS_MODULEconfig.settings.productionDJANGO_SETTINGS_MODULE inside the containers.
DOCKER_DJANGO_DEBUGFalseDJANGO_DEBUG inside the containers.
DOCKER_ENVIRONMENTproductionENVIRONMENT inside the containers.
DOCKER_DB_HOSTpostgresDB_HOST inside the containers.
DOCKER_REDIS_HOSTredisREDIS_HOST inside the containers.
DOCKER_WEAVIATE_HOSTweaviateWEAVIATE_HOST inside the containers.
DOCKER_OLLAMA_HOSThttp://ollama:11434OLLAMA_HOST inside the containers.
OLLAMA_MEMORY_LIMIT16GMemory cap for the Ollama container.
OLLAMA_MEMORY_RESERVATION8GMemory reserved for the Ollama container.
UVICORN_WORKERS1Uvicorn workers in the web container when not in debug mode.
LOG_LEVELinfoUvicorn log level in the web container.

Adding a variable

  1. Add it to .example.env with a placeholder or default.
  2. Declare it in config/env.py, for example MY_VAR = os.getenv("MY_VAR", "default_value").
  3. Read it with from config import env and env.MY_VAR, or expose it in config/settings/common.py.
  4. Document it in this file.

Validating configuration

python manage.py check
python manage.py shell -c "from config import env; print(env.OPENAI_API_KEY[:7])"

On this page