Skip to content

All tuning knobs

Generated from every const NAME = <number> line in the secret sauce files. Values are what main had at deploy time; to change one, edit the source file (click the name), not this page. Regexes and strings live on each file’s code page.

platform/apps/app/src/lib/chat/answer-markers.ts · recipe page

Name Value Note
MAX_ATTACH 4
MAX_SUGGESTIONS 3
MAX_BUTTONS 6
MAX_SUGGESTION_LEN 100
MAX_BUTTON_LEN 80

platform/apps/app/src/lib/chat/guardrails.ts · recipe page

Name Value Note
MAX_QUERY_LENGTH 2000 Max query length (Thai is ~3x more token-dense than English).

platform/apps/app/src/lib/rag/answer-cache.ts · recipe page

Name Value Note
ANSWER_CACHE_TTL_SECONDS 15 * 60 TTL keeps stale answers bounded even when retrieval doesn’t shift.

platform/apps/app/src/lib/rag/embedding-cache.ts · recipe page

Name Value Note
CACHE_TTL_SECONDS 7 * 24 * 60 * 60
MAX_QUERY_LEN_FOR_CACHE 1000 Skip the cache for unusually long queries — the SHA-256 keys would still be fixed-size, but caching a 5KB-prompt embedding is unlikely to re

platform/apps/app/src/lib/rag/scope-gate.ts · recipe page

Name Value Note
SCOPE_RERANK_MIN_SCORE 0.3 Cohere rerank threshold below which we treat the top hit as off-topic.

platform/apps/app/src/lib/rag/search.ts · recipe page

Name Value Note
RERANK_TIMEOUT_MS 1500 Upper bound on how long we’ll wait for the reranker before giving up and serving RRF order.
RRF_K 60

platform/apps/app/src/lib/rate-limit.ts · recipe page

Name Value Note
ANON_VISITOR_LIMIT { limit: 40, windowSec: 3600 } ADR-0185 — anonymous widget traffic is keyed per VISITOR, with a per-IP backstop.
ANON_IP_BACKSTOP { limit: 300, windowSec: 3600 }

platform/packages/rag/src/ingest/chunker.ts · recipe page

Name Value Note
DEFAULT_MAX_TOKENS 512
DEFAULT_OVERLAP 64
TOC_MIN_ITEMS 8 Minimum distinct names before a document counts as a listing.
TOC_MAX_ITEMS 150 Names to keep at most — a TOC that needs more is a sitemap, not a list.
TOC_REPEAT_LIMIT 3 Link texts repeated this often are chrome (breadcrumbs, “Read more”).