Expand description
Compile-time constants: embedding dimensions, limits and thresholds. Compile-time constants shared across the crate.
Grouped into embedding configuration, length and size limits, SQLite
pragmas and retrieval tuning knobs. Values are taken from the PRD and
must stay in sync with the migrations under migrations/.
§Dynamic concurrency permit calculation
The maximum number of simultaneous instances can be adjusted at runtime using the formula:
permits = min(cpus, available_memory_mb / EMBEDDING_LOAD_EXPECTED_RSS_MB) * 0.5where available_memory_mb is obtained via sysinfo::System::available_memory()
converted to MiB. The result is capped at MAX_CONCURRENT_CLI_INSTANCES
and floored at 1.
Constants§
- BATCH_
PARTIAL_ FAILURE_ EXIT_ CODE - Exit code for partial batch failure (PRD line 1822). Conflicts with DbBusy in v1.x; in v2.0.0 DbBusy migrates to 15 and this code takes 13 per PRD.
- BUSY_
TIMEOUT_ MILLIS PRAGMA busy_timeoutvalue applied on every connection.- CACHE_
SIZE_ KB PRAGMA cache_sizevalue in kibibytes (negative means KiB).- CHUNK_
OVERLAP_ TOKENS - Token overlap between consecutive chunks.
- CHUNK_
SIZE_ TOKENS - Chunk size expressed in tokens for body splitting.
- CLI_
LOCK_ DEFAULT_ WAIT_ SECS - Maximum time in seconds an instance waits to acquire a concurrency slot.
- CLI_
LOCK_ EXIT_ CODE - Process exit code returned when the lock is busy and no wait was requested (EX_TEMPFAIL).
- CLI_
LOCK_ FILE - Filename used for the advisory exclusive lock that prevents parallel invocations.
- CLI_
LOCK_ POLL_ INTERVAL_ MS - Polling interval in milliseconds used by
--wait-lockbetweentry_lock_exclusiveattempts. - CURRENT_
SCHEMA_ VERSION - Current schema version, equal to the highest migration number in
migrations/Vnnn__*.sql. - DAEMON_
AUTO_ START_ INITIAL_ BACKOFF_ MS - Initial polling interval to check whether the daemon became healthy.
- DAEMON_
AUTO_ START_ MAX_ BACKOFF_ MS - Ceiling on backoff between automatic daemon spawn attempts.
- DAEMON_
AUTO_ START_ MAX_ WAIT_ MS - Maximum wait time for the daemon to become healthy after auto-start.
- DAEMON_
IDLE_ SHUTDOWN_ SECS - Idle duration in seconds before the daemon shuts itself down.
- DAEMON_
PING_ TIMEOUT_ MS - Timeout in milliseconds for a single ping probe against the daemon socket.
- DAEMON_
SPAWN_ BACKOFF_ BASE_ MS - Base backoff used after daemon spawn/health failures.
- DAEMON_
SPAWN_ LOCK_ WAIT_ MS - Maximum wait time to acquire the daemon spawn lock.
- DB_
BUSY_ EXIT_ CODE - Exit code para DbBusy em v2.0.0 (migrado de 13 para liberar 13 para batch failure).
- DEDUP_
FUZZY_ THRESHOLD - Jaccard threshold above which two memories are considered fuzzy duplicates.
- DEDUP_
SEMANTIC_ THRESHOLD - Cosine distance threshold below which two memories are semantic duplicates.
- DEFAULT_
K_ RECALL - Default
kused byrecallwhen the caller omits--k. - DEFAULT_
MAX_ HOPS - Default traversal depth for
relatedwhen--hopsis omitted. - DEFAULT_
MIN_ WEIGHT - Default minimum weight filter applied during graph traversal.
- DEFAULT_
RELATION_ WEIGHT - Default weight assigned to newly created relationships.
- EMBEDDING_
DIM - Embedding vector dimensionality produced by
multilingual-e5-small. - EMBEDDING_
LOAD_ EXPECTED_ RSS_ MB - Expected RSS in MiB for a single instance with the ONNX model loaded via fastembed.
- EMBEDDING_
MAX_ TOKENS - Maximum tokens accepted by an embedding input before chunking.
- FASTEMBED_
BATCH_ SIZE - Batch size for
fastembedencoding calls. - FASTEMBED_
MODEL_ DEFAULT - Default
fastembedmodel identifier used byrememberandrecall. - K_
ENTITIES_ SEARCH - Default
kfor entity KNN searches during graph expansion. - K_
GRAPH_ ENTITIES_ DEFAULT_ LIMIT - Default
--limitparagraph entitiesquando omitido. - K_
GRAPH_ MATCHES_ LIMIT - Maximum result count from the recursive graph CTE in
recall. - K_
HISTORY_ DEFAULT_ LIMIT - Default
--limitparahistoryquando omitido. - K_
LIST_ DEFAULT_ LIMIT - Default
--limitparalistquando omitido. - K_
MEMORIES_ DEFAULT - Default
kfor memory KNN searches when the caller omits--k. - K_
RELATED_ DEFAULT_ LIMIT - Default
--limitpararelatedquando omitido. - LOW_
MEMORY_ EXIT_ CODE - Process exit code returned when available memory is below
MIN_AVAILABLE_MEMORY_MB. - MAX_
BODY_ CHARS_ BEFORE_ CHUNK - Body character count above which the body is split into chunks.
- MAX_
CONCURRENT_ CLI_ INSTANCES - Maximum number of CLI instances running simultaneously.
- MAX_
ENTITIES_ PER_ MEMORY - Upper bound on distinct entities persisted per memory.
- MAX_
GRAPH_ HOPS - Maximum number of hops allowed in graph traversals.
- MAX_
MEMORY_ BODY_ LEN - Hard upper bound on memory
bodylength in bytes. - MAX_
MEMORY_ DESCRIPTION_ LEN - Maximum character length for a memory
descriptionfield. - MAX_
MEMORY_ NAME_ LEN - Maximum byte length for a memory
namefield in kebab-case. - MAX_
NAMESPACES_ ACTIVE - Maximum number of simultaneously active namespaces (deleted_at IS NULL). Exit 5 when exceeded.
- MAX_
RELATIONSHIPS_ PER_ MEMORY - Upper bound on distinct relationships persisted per memory.
- MAX_
SQLITE_ BUSY_ RETRIES - Maximum attempts when a statement returns
SQLITE_BUSY. - MIN_
AVAILABLE_ MEMORY_ MB - Minimum available memory in MiB required before starting model loading.
- MIN_
RELATION_ WEIGHT - Minimum relationship weight required for traversal inclusion.
- MMAP_
SIZE_ BYTES PRAGMA mmap_sizevalue in bytes applied to each connection.- NAME_
SLUG_ REGEX - PRD-canonical regex that validates names and namespaces. Allows 1 char
[a-z0-9]OR a 2-80 char string starting with a letter and ending with a letter/digit, containing only[a-z0-9-]. Rejects the__prefix (internal reserved). - OMP_
NUM_ THREADS_ DEFAULT - Default value injected into OMP_NUM_THREADS when not set by the user.
- ORT_
INTRA_ OP_ NUM_ THREADS_ DEFAULT - Default value injected into ORT_INTRA_OP_NUM_THREADS when not set.
- ORT_
NUM_ THREADS_ DEFAULT - Default value injected into ORT_NUM_THREADS when not set by the user.
- PASSAGE_
PREFIX - Prefix prepended to bodies before embedding as required by E5 models.
- PURGE_
RETENTION_ DAYS_ DEFAULT - Default retention period (days) used by
purgewhen--retention-daysis omitted. - QUERY_
PREFIX - Prefix prepended to queries before embedding as required by E5 models.
- QUERY_
TIMEOUT_ MILLIS - Query timeout applied to statements in milliseconds.
- REMEMBER_
MAX_ CONTROLLED_ BATCH_ CHUNKS - Ceiling on chunks per controlled micro-batch in
remember. - REMEMBER_
MAX_ CONTROLLED_ BATCH_ PADDED_ TOKENS - Maximum padded-token budget per controlled micro-batch in
remember. - REMEMBER_
MAX_ SAFE_ MULTI_ CHUNKS - Explicit operational guard for multi-chunk documents in
remember. - RRF_
K_ DEFAULT - Default
kconstant used by Reciprocal Rank Fusion inhybrid-search. - SCHEMA_
USER_ VERSION - Canonical value of
PRAGMA user_versionwritten after migrations. - SQLITE_
BUSY_ BASE_ DELAY_ MS - Base delay in milliseconds for the first SQLITE_BUSY retry.
- SQLITE_
GRAPHRAG_ VERSION - Crate version string sourced from
CARGO_PKG_VERSIONat build time. - TEXT_
BODY_ PREVIEW_ LEN - Character size of the body preview emitted in text/markdown formats.
- TEXT_
DESCRIPTION_ PREVIEW_ LEN - Character length of the description preview shown in
listoutput. - WAL_
AUTOCHECKPOINT_ PAGES PRAGMA wal_autocheckpointthreshold in pages.- WEIGHT_
FTS_ DEFAULT - Default weight for the BM25 text contribution in the
hybrid-searchRRF formula. - WEIGHT_
VEC_ DEFAULT - Default weight for the vector contribution in the
hybrid-searchRRF formula.
Functions§
- max_
relationships_ per_ memory - Resolves the per-memory relationship cap, honouring the env-var override.
- ner_
batch_ size - Batch size for BERT NER forward passes.