Curltale AI

Docs › Administration

Switches and settings

Every switch, every setting, and where each value comes from.

Switches and flags#

Every on/off or mode choice in one place. Settings marked page are on the Settings page (and can also come from .env); the rest live where the object is.

SwitchWhereDefaultEffect
Library on or off (LIBRARY_ENABLED)Settings > LibraryonOff hides the Knowledge menu, the document tools and the API; nothing is deleted.
Documents may be sent to the AI modelCollection settingsonOff: the collection is stored, split and searchable by words and meaning (local embedding), but no model ever sees it: no source page, no OCR, no topics, no link suggestions, and Alfred cannot read it.
Agents may read this collectionCollection settingsonOff keeps Alfred and MCP clients away from the collection entirely, whatever the grants.
Usage tag (public or internal)Collection settingsinternalGuidance returned with every result so agents know whether they may quote the content to customers. Not an access rule.
Collection grants (read, write, manage)Collection access tablenoneThe only thing that decides who and what can read, write or manage a collection. Tokens are read only.
Editor roleUsersoffNeeded (with a write or manage grant) to ingest, edit and approve documents. Admins always have it.
Entitlements (confidential, personal, restricted, data)Per user and per tokensee Access controlWhat each credential may see of the model's data. Restricted is never on by default and every grant is logged.
Agents may read rowsPer connectoronOff: query_data refuses, and agents can still plan queries.
Four-eyes ruleSettings > General (page only)offWhoever changed a draft cannot publish it.
Settings locked (SETTINGS_LOCKED).envoffThe Settings page becomes read-only; only .env counts.
Reasoning (CHAT_REASONING)Settings > AIoffLet reasoning models think first: better on hard questions, slower and dearer.
Storage driver (STORAGE_DRIVER)Settings > Storagelocallocal or s3. Choose before the first upload.
Render pages with the browser service (FETCH_RENDER)Settings > Web captureautonever; auto (only pages with almost no text without JavaScript); always. Needs the browser service address.
Background workers in this process (LIBRARY_WORKERS)Settings > Library20 when a separate worker container does the work.
Service role (SERVICE_ROLE).env, set by docker-compose.worker.ymlallall: web and workers in one process; api: web only.
Embedding provider (EMBEDDING_PROVIDER).envlocallocal runs in the container; a remote model needs EMBEDDING_MODEL and EMBEDDING_DIM.
Reranker (RERANK_URL)Settings > AIoffSharpens Library search when set; if it fails the order simply stays.
Keep tool responses in the log (ACTIVITY_RESULT_CHARS)Settings > General80000 keeps only the summary.
Realistic values from the AI modelDemo database buildoffOne model call per entity proposes fictional values; only names and descriptions are sent.

Settings and configuration reference#

All settings are environment variables, normally in .env. The ones marked ⚙ can also be changed by an admin on the Settings page (Admin → Settings):

  • The change applies on the next request, with no restart. Rate limits switch over at once; the sign-in duration applies to new sign-ins. Other app processes pick a change up within 5 seconds.
  • Each value comes from, in order: the page, .env, the built-in default. Each row shows which; Reset removes the page value and shows the .env value it goes back to.
  • Values are checked (type and range); a bad value is refused with a message.
  • Every change goes to the audit log with the old and new value.
  • The OpenRouter key set on the page is stored encrypted and never sent back: the page only says whether one is set.
  • SETTINGS_LOCKED=true makes the page read-only and ignores values stored there, for teams that keep configuration in files. The four-eyes rule has no variable and stays editable on the page.

Settings the app needs before it can reach its database, the ones that describe the deployment (proxies, ports) and the embedding model (changing it means re-embedding) are environment only.

SettingDefaultRangeMeaning
DB_PASSWORDrequiredPostgreSQL superuser, used only to create the app's account on first start.
APP_DB_PASSWORDrequiredThe app's own database account (studio_app).
SECRET_KEYrequiredSigns sessions and derives the keys that encrypt connector passwords and the OpenRouter key and salt masked values. Changing it later means re-entering connector passwords and the key.
INITIAL_ADMIN_USERNAME, INITIAL_ADMIN_PASSWORDadmin, requiredThe first administrator, created on first start.
HTTP_BIND, HTTP_PORT127.0.0.1, 8080Where the app listens (docker-compose).
CLIENT_IP_HEADER, TRUSTED_PROXIESX-Forwarded-For, private networksHow to find the real client behind a proxy (see Running behind a proxy).
RATE_PER_S, RATE_BURST ⚙20, 601-1000, 1-10000API and MCP requests per client address: steady rate and burst.
LOGIN_PER_MIN ⚙101-100Sign-in attempts per client address per minute.
ALFRED_PER_MIN ⚙201-600Alfred questions per user per minute.
INGEST_PER_MIN ⚙201-600Heavy actions one user may start per minute: uploads, web addresses, refreshes, page regeneration and edits, topic revisions, link suggestions, interview drafts, exports.
SESSION_HOURS ⚙121-720Browser session lifetime.
ACTIVITY_DAYS ⚙301-3650How long the activity log is kept.
ACTIVITY_RESULT_CHARS ⚙80000-100000How much of each tool response the activity log keeps (0: none, only its size).
LLM_BASE_URL ⚙OpenRouter's addressThe AI endpoint: any OpenAI-compatible server. Normally set on the Settings page.
OPENROUTER_API_KEY ⚙emptyKey for the AI endpoint (the name is historical). Alfred, the AI step of the demo database, and remote embeddings. Optional for a server that needs none.
CHAT_MODEL ⚙openai/gpt-6-lunaAssistant model: Alfred's, and the default of other AI features (any model with tool calling).
CHAT_REASONING ⚙falseLet reasoning models think first (better on hard questions, slower and dearer).
ALFRED_TEMPERATURE ⚙0.20-1Alfred's temperature.
ALFRED_MAX_LOOKUPS ⚙103-20Tool rounds per question before Alfred answers with what it found.
ALFRED_TOOL_RESULT_CHARS ⚙160002000-64000Tool results longer than this are cut before the model reads them.
AGENT_MAX_ROWS ⚙10010-1000Rows query_data returns to Alfred and MCP clients. A longer result gives the total (total_rows) and a note suggesting counts, groups or filters; rows are not paged.
CONSOLE_MAX_ROWS ⚙50010-5000Rows in the SQL console (a connector can set a lower limit).
LIBRARY_ENABLED ⚙trueTurns the Library on or off (nothing is deleted).
LIBRARY_WORKERS ⚙20-8Documents processed at once by the web process; 0 when a separate worker container does the work.
LIBRARY_MAX_UPLOAD_MB ⚙1001-2000Largest upload.
STORAGE_DRIVER ⚙locallocal, s3Where original files are kept.
S3_ENDPOINT, S3_BUCKET, S3_REGION, S3_ACCESS_KEY, S3_SECRET_KEY ⚙, S3_PATH_STYLE, S3_PREFIXemptyAny S3-compatible bucket; the secret key is stored encrypted.
MODEL_WRITER, MODEL_VERIFIER, MODEL_ANALYZER, MODEL_TOPIC_WRITER, MODEL_INTERVIEW, MODEL_OCR ⚙emptyA model per Library role; empty uses the assistant model.
MAX_AMENDMENT_ROUNDS ⚙30-8Correction rounds for a source page before it goes to a person.
WRITER_SECTION_TOKENS ⚙80001000-100000Longest text written in one go; longer documents are written in sections.
OCR_MAX_PAGES ⚙1001-1000Most scanned pages read per document.
DUPLICATE_SIMILARITY ⚙0.920.5-1Similarity at which a new topic is held as a probable duplicate.
LIBRARY_MIN_SIMILARITY ⚙00-1Smallest similarity for a passage to count as a match.
RERANK_URL, RERANK_MODEL, RERANK_API_KEY ⚙emptyOptional Cohere-style reranker for Library search.
FETCH_ALLOWED_HOSTS ⚙emptyInternal hosts or networks web capture may reach anyway.
FETCH_MAX_MB ⚙251-200Largest web page or file captured.
FETCH_RENDER ⚙autonever, auto, alwaysUse the browser service for pages built by JavaScript.
FETCHER_URL, FETCHER_TOKEN ⚙emptyAddress and shared secret of the optional browser container.
Four-eyes rule ⚙offPage only: whoever changed a draft cannot publish it.
SETTINGS_LOCKEDfalsetrue: the Settings page is read-only and only .env counts.
EMBEDDING_MAX_TOKENS512How much of a passage the embedding model reads. The Library cuts documents to about 75% of it.
EMBEDDING_PROVIDERlocallocal runs the model in the container (about 30 ms per query, no key). openrouter uses a remote model through OpenRouter.
EMBEDDING_MODEL, EMBEDDING_DIMBAAI/bge-base-en-v1.5, 768The embedding model and its vector size, any size pgvector stores (1 to 16000). The database tables are created for that size. Starting with a different size converts them, empties the vectors and recomputes them in the background.
CONNECTOR_FILES_DIR/app/dataWhere SQLite and DuckDB files may live.
SAMPLEDB_PASSWORD, SAMPLE_MARIA_PASSWORD, SAMPLE_CH_PASSWORDemptyOnly for the demo databases of docker-compose.demo.yml.

Advanced (rarely changed; not in .env.example):

SettingDefaultMeaning
DATABASE_URLset by docker-composeThe app's connection to its PostgreSQL, as the least-privileged studio_app account.
DATA_DB_NAMEsemantic_dataName of the demo database inside the app's PostgreSQL.
DATA_DIR/app/dataThe mounted data folder. The Library keeps its files in library below it.
SERVICE_ROLEallall: web and job workers in one process; api: web only; the worker container runs python -m studio.worker.
OPENROUTER_BASEhttps://openrouter.ai/api/v1Default of LLM_BASE_URL.
EMBEDDING_QUERY_PREFIXthe prefix bge models expectText put before a search query when embedding it; set it for a model that expects another.
MODEL_CACHE/app/modelsWhere the local embedding model is kept.
FRONTEND_DIRthe built UI in the imageWhere the UI files are served from.

This documentation covers version 0.2.0. Something missing or wrong? Open an issue.