Configuration
Uteke supports uteke.toml configuration with layered resolution.
Resolution Order
Uteke searches for config in this order. Last match wins (highest priority):
- (built-in defaults) — Hardcoded defaults
~/.codecora/uteke/uteke.toml— Global user-level config.uteke/uteke.toml— Project-level (in current working directory)
Config file path is auto-resolved (no --config flag). Layered merge: each file overlays the previous, with field-level granularity (only keys explicitly present override).
Config File Format
# uteke.toml
[store]
# Store location (default: ~/.codecora/uteke)
path = "~/.codecora/uteke"
# Default namespace (default: "default")
namespace = "default"
[logging]
# Log level: trace, debug, info, warn, error
level = "warn"
# Optional log file path. Empty = stderr only.
# file = ""
[server]
# Enable CLI auto-routing to server
enabled = false
# Server host
host = "127.0.0.1"
# Server port
port = 8767
[vector]
# Vector search engine when the binary ships BOTH engines (official builds):
# "usearch" (default — HNSW, C++ FFI, fastest) or "vecq" (training-free
# quantization, zero C++ dep — mobile/slim builds). Switching engines on an
# existing store auto-rebuilds the index from SQLite on next open (#1168).
# Env override: UTEKE_VECTOR_BACKEND=usearch|vecq
backend = "usearch"Server Mode
When [server] enabled = true, the CLI automatically routes commands through the running HTTP server:
# Start server
uteke-serve --port 8767
# CLI commands now route via HTTP (21ms vs 980ms cold start)
uteke recall "what was that context?"
uteke remember "New finding" --tags research
uteke statsIf the server is not running, CLI falls back to local store automatically.
| Setting | Default | Description |
|---|---|---|
enabled | false | Enable CLI→server routing |
host | 127.0.0.1 | Server bind address |
port | 8767 | Server port |
Reaching the server from another device on your LAN
By default uteke-serve listens on 127.0.0.1 only, so nothing else on your network can reach it. To use it from a second device (a laptop, a phone, another agent) on a network you trust:
- Set a token first.
UTEKE_AUTH_TOKEN=<long random value>or--auth-token. Without one the server still starts, unauthenticated, and the only hint is aWARN ... Authentication: disabledline in its log. For a client that only needs to read, give itUTEKE_READ_ONLY_TOKENinstead: it may use GET requests and the read-only POST routes (recall, search, list, stats, room and document reads), plus the read-only MCP tools overPOST /mcp, but gets403on every write route and a tool error from every MCP write tool. - Bind to the LAN. Either
uteke-serve --host 0.0.0.0(all interfaces) or, narrower, the machine's LAN address (--host 192.168.1.20); or[server] hostin~/.codecora/uteke/uteke.toml. A project-local.uteke/uteke.tomlis not allowed to set[server]. - Connect. From the other device use
http://<lan-address>:8767, with the headerAuthorization: Bearer <token>.GET /healthanswers without a token and is a quick reachability check.
Things to know:
- The
Hostheader check (DNS-rebinding protection) only applies to a loopback bind or whenallowed_hostsis set. On a LAN bind everyHostis accepted unless you list names in[server] allowed_hosts/--allowed-host. - The traffic is plain HTTP, so the token is visible to anyone on the same network segment. That is acceptable on a trusted home network; for anything else put a TLS reverse proxy in front (see TLS & Reverse Proxy) and keep
uteke-serveitself on127.0.0.1. - Allow only the server port in the firewall, and do not forward it from your router to the internet.
- In Docker the compose file maps
127.0.0.1:8767:8767; remove the127.0.0.1:prefix only after a token is set (see Docker).
Embedding Backend
Configure the embedding backend. Three backends are supported:
onnx(default) — fully offline, EmbeddingGemma Q4, 768d. Zero API keys, zero network.openai— OpenAItext-embedding-3-small(1536d) ortext-embedding-3-large(3072d). Requires API key.ollama— local Ollama server with models likenomic-embed-text(768d) ormxbai-embed-large(1024d). No API key, runs onhttp://localhost:11434.
[embedding]
backend = "onnx" # onnx | openai | ollama
model = "" # empty = the backend's default model
api_key = "" # OpenAI only (or use UTEKE_EMBEDDING_API_KEY)
base_url = "" # custom endpoint (Azure OpenAI, Ollama URL, proxy)
endpoint_path = "" # custom API path (default: /embeddings for OpenAI)
dims = 0 # 0 = use model default (override only if you know)| Setting | Default | Description |
|---|---|---|
backend | onnx | onnx, openai, or ollama |
model | "" | Backend-specific model name. Empty = the backend's default (text-embedding-3-small for openai, nomic-embed-text for ollama; onnx uses EmbeddingGemma Q4) |
api_key | "" | OpenAI API key (ONNX/Ollama ignore) |
base_url | "" | Custom endpoint. Empty = backend default |
endpoint_path | "" | Custom API path appended to base_url. Empty = /embeddings (OpenAI) |
dims | 0 | Force dims. 0 = backend/model default |
Backend-specific defaults
When you set backend = "openai" or "ollama" and leave model/base_url/dims empty, uteke picks:
| Backend | Model | Base URL | Dims |
|---|---|---|---|
onnx | embeddinggemma-q4 | (local) | 768 |
openai | text-embedding-3-small | https://api.openai.com/v1 | 1536 |
ollama | nomic-embed-text | http://localhost:11434 | 768 |
Azure OpenAI
Set backend = "openai", base_url = "https://<your-resource>.openai.azure.com/openai/deployments/<deployment>?api-version=2024-10-21" and api_key to your Azure key. The request path /embeddings is appended automatically. Azure requires the api-version query param — include it in base_url.
Dim mismatch detection
If you open an existing store with a different backend (different dims), the first embedding operation returns a clear error instead of silently corrupting the index:
Embedding dimension mismatch: index has 768d vectors but backend 'openai' produces 1536d.
Rebuild the index (`uteke repair`) or switch backend.To migrate, run uteke repair after switching backends — it rebuilds the vector index from the SQLite source of truth using the new backend's embeddings. Because the dimension guard refuses to open a store whose vectors have another width than the new backend produces (the error says so and names this variable), set UTEKE_ALLOW_DIM_MISMATCH=1 once to let uteke repair open the store with the new backend:
UTEKE_ALLOW_DIM_MISMATCH=1 uteke repairEmbed Fallback
When the primary embedding backend fails (model not found, OOM, network error), uteke can transparently retry with a fallback endpoint. This is opt-in — if unconfigured, no cloud calls are made.
[embed_fallback]
api_key = "" # or use UTEKE_EMBED_FALLBACK_API_KEY
base_url = "" # e.g. "https://api.openai.com/v1"
endpoint_path = "" # path appended to base_url. Empty = "/embeddings"
model = "" # e.g. "text-embedding-3-small"| Setting | Default | Description |
|---|---|---|
api_key | "" | API key for the fallback endpoint |
base_url | "" | Fallback API endpoint (OpenAI-compatible) |
endpoint_path | "" | Path appended to base_url. Empty = /embeddings |
model | "" | Fallback embedding model |
Fallback is active when all three of api_key, base_url, and model are non-empty. No enabled flag needed — empty fields mean inactive.
Environment variables take precedence: UTEKE_EMBED_FALLBACK_API_KEY, UTEKE_EMBED_FALLBACK_BASE_URL, UTEKE_EMBED_FALLBACK_ENDPOINT_PATH, UTEKE_EMBED_FALLBACK_MODEL.
Dimension validation — if the fallback produces different dimensions than the primary, uteke rejects it at startup with a clear error. Both backends must produce vectors of the same dimensionality.
Fact Extraction
Configure LLM-backed fact extraction for uteke import --extract. This is opt-in: the section is inert unless you pass --extract. When you do, uteke sends source text to an OpenAI-compatible chat-completions endpoint and stores the distilled atomic facts. This is the only feature that makes outbound LLM calls; everything else stays offline.
[extraction]
mode = "" # "llm" sends captured conversations to the endpoint
# (#1665); empty or "offline" keeps them local
model = "gpt-4o-mini" # chat model (or UTEKE_EXTRACTION_MODEL)
api_key = "" # or UTEKE_EXTRACTION_API_KEY; falls back to the
# embedding / OPENAI_API_KEY credential
base_url = "" # OpenAI-compatible base URL. Empty = OpenAI default
endpoint_path = "" # custom API path. Empty = /chat/completions
max_facts = 0 # cap facts per document. 0 = built-in default| Setting | Default | Description |
|---|---|---|
mode | "" | "llm" = also send captured conversations to the endpoint. "offline", "" or any other value = offline rules for capture (import --extract still uses the LLM when a key is set) |
model | "" | Chat model used to distill facts |
api_key | "" | API key (falls back to embedding/OPENAI_API_KEY) |
base_url | "" | OpenAI-compatible base URL. Empty = OpenAI default |
endpoint_path | "" | API path appended to base_url. Empty = /chat/completions |
max_facts | 0 | Cap facts kept per document. 0 = built-in default |
Resolution order per field: CLI flag (--extract-*) > UTEKE_EXTRACTION_* env var > [extraction] config > built-in default.
Raw Capture (#1466)
uteke capture (or POST /capture, or the MCP tool uteke_capture) queues conversation turns; uteke extract-queue run, or uteke-serve on its schedule, turns them into memories later (CLI reference). Global file only: a project .uteke/uteke.toml cannot set this section.
[capture]
enabled = false # opt-in: capture refuses turns until this is true
budget_per_run = 10 # sessions (extractor calls) per run
retention_days = 30 # done turns are deleted after this many days
max_attempts = 3 # a session that keeps failing is marked failed
lease_minutes = 15 # a session left `extracting` by a crash is requeued
chunk_chars = 24000 # most characters one extractor call receives (min 64)
max_turn_bytes = 1048576 # a larger turn is refused (CLI, MCP and HTTP); 0 = the default
max_queue_turns = 100000 # capture refuses past this many waiting turns; 0 = no limit
max_queue_bytes = 536870912 # same, for the bytes of waiting text; 0 = no limit
interval_minutes = 60 # uteke-serve extracts every N minutes (min 1)Where the turns go. Capture extracts with the offline rules (no network) by default. The turns are sent to the LLM endpoint of [extraction] only when you set mode = "llm" there; an api_key with no mode keeps them local, because a key set for import --extract is not consent to send every conversation. uteke connect, uteke extract-queue run and the uteke-serve schedule print one line naming the extractor (offline, or the endpoint host; never the key). Turns pass the privacy filter before they are queued, whichever extractor runs.
uteke-serve starts the schedule only when enabled = true. It holds the store lock only to claim a session's batch and to store its facts, never while the extractor request runs, so a slow or hung provider does not hold recall and writes back. A batch that is claimed and then lost (a crash) is requeued when its lease expires. A run the extractor stopped (rate limit, provider down) doubles the wait before the next one, up to 16 intervals; a run that goes through resets it.
Limits. One turn may have at most max_turn_bytes (1 MiB): Uteke::capture refuses a larger one with a validation error on every surface (the CLI reads stdin only up to that size, HTTP answers 413), except a tool result, which is cut to 2000 characters first. The queue is bounded too, so a stuck extraction cannot fill the disk: capture refuses a new turn while the pending and extracting turns number max_queue_turns or hold max_queue_bytes of text, and uteke extract-queue status (and GET /capture/status) shows the waiting bytes and warns from 80% of either limit. Repeating a turn already in the queue is still a no-op.
A session longer than chunk_chars is extracted in several calls: its turns are packed into chunks on turn boundaries, and a single turn larger than a chunk is split at a newline or whitespace. The facts of every chunk are stored together as one batch, with the source capture:<session>:<batch>, and the batch counts as one attempt. A provider answer of HTTP 413, or a 4xx (a 400 too) that names the context length, fails that session alone (it is retried, then marked failed after max_attempts) and the sessions behind it still run; a 429 or a 5xx still stops the run. Keep lease_minutes above the time the longest session takes: every chunk is one request of up to two minutes.
Recall Threshold
The [recall], [tier], [dream], [lifecycle], [embed_fallback] and [doc_similarity] sections are read the same way by the CLI, uteke-serve and uteke-mcp (the global uteke.toml, then the project file with its untrusted keys stripped, then the UTEKE_RECALL_*, UTEKE_GRAPH_* and UTEKE_EMBED_FALLBACK_* variables). uteke_recall over MCP, and MCP over HTTP, use [recall] min_score / min_score_strict as the floor and default_strategy as the strategy when a call gives none, exactly like POST /recall. With no [recall] section the defaults equal the built-ins, so nothing changes.
Control minimum similarity score for recall results:
[recall]
# Minimum similarity score (0.0-1.0). Memories below this score are excluded.
# Default: 0.0 (no filtering; fusion scores are rank-based, see below).
min_score = 0.0
# Floor on `similarity` (the vector-leg cosine) for `strict` recalls (#1650)
min_score_strict = 0.5
# Default recall strategy for `uteke recall` when --strategy is not given.
# One of: fusion | vector | fts5 | hybrid | graph.
# fusion — weighted RRF of the vector and hybrid rankings (default since 0.16.0;
# LongMemEval 500Q R@5 0.946 vs 0.854 vector-only, #1123)
# vector — vector similarity only (original behavior)
# fts5 — full-text search only
# hybrid — vector + FTS5 fused via Reciprocal Rank Fusion (k=60)
# graph — hybrid + graph-signal reranking (#378): well-connected memories
# get a subtle log-scaled score boost
default_strategy = "fusion"
# Graph-augmented reranking weights (only affect the `graph` strategy).
# Boosts are additive + log-scaled, so 0.1 is subtle and saturates quickly.
graph_density_weight = 0.1 # edge-count boost
graph_authority_weight = 0.1 # incoming-edge (referenced-by) boost
graph_rerank_enabled = true # master switch; false → graph acts like hybrid| Setting | Default | Description |
|---|---|---|
min_score | 0.0 | Minimum score; results below it are dropped |
min_score_strict | 0.5 | Floor on a result's similarity (the vector-leg cosine, not score) for strict recalls. Hits without a similarity are dropped. Why 0.5: benchmark note |
default_strategy | fusion | Default recall strategy (vector|fts5|hybrid|graph|fusion). Since 0.16.0 fusion (weighted RRF: vector×1.7 + hybrid×1, #1123) is the default — LongMemEval fast50 R@5 0.98 vs 0.9267 hybrid |
graph_density_weight | 0.1 | Edge-density boost weight (graph strategy only) |
graph_authority_weight | 0.1 | Incoming-edge authority boost weight (graph strategy only) |
graph_rerank_enabled | true | Master switch for graph reranking |
Score scale (since 0.17.x, #1223): under the default fusion strategy a recall score is rank-based (RRF contribution plus salience/recency boosts, typically about 0.0 to 0.2), not a cosine similarity. That is why the default
min_scoreis 0.0 on every surface. Set a threshold (configmin_score,--minor HTTP/MCPmin_score) only when you know the score scale of the active strategy. For benchmark evaluation pass--min 0.0explicitly.
similarityandstrict(#1650): every memory result also carriessimilarity, the cosine of the vector leg (0 to 1, not boosted), ornullwhen only full-text search found it.strictandmin_score_strictcompare against it, so "confident match only" works under fusion, wherescorenever reaches 0.5.scoreandmin_scorekeep their meaning.
min_trustandtrust_tier(#1651): every memory result carriestrust_tier, the provenance tier of the memory, as a lowercase string:human(author_typehumanand source_typeuser),agent,external(url, file, import) oruntrusted. It is the stringuteke provenancewrites in its JSON, and the stringmin_trusttakes.min_trustkeeps results at or above that tier and runs before the limit; documents have no tier and are dropped when it is set. This is the provenance tier only, a different axis from any future trust state (candidate, stated, verified...), which will use another name.author_typeis self-declared (MCPuteke_rememberacceptshumanfrom any agent), so the filter is a convenience, not a security boundary.
Salience + Recency Boost (#352)
Dual-axis recall ranking boost. Applied after the RRF merge and recall cache lookup.
- Salience — higher score for high-value memory types (decision > insight > fact > note). Per-type decay rates are hardcoded in
type_half_life_days(). - Recency — exponential decay
exp(-age/τ)where τ is a per-type time constant.
Both boosts are on by default with weight 0.1. On the CLI, --salience true / --recency true switch to the configured weights below, and --salience false / --recency false turn a boost off. The dream cycle's compact phase can use these for smarter pruning.
| Setting | Default | Description |
|---|---|---|
salience_weight | 0.15 | Weight used with --salience true (0 = disable) |
recency_weight | 0.15 | Weight used with --recency true (0 = disable) |
jaccard_weight | 0.0 | Jaccard token-overlap reranking weight (0 = disable) |
Environment Variables
Environment variables override config file values. Applied in Config::load() after config file merge. CLI flags override env vars.
Resolution order (highest priority first):
- CLI flag (
--min,--host,--port) - Environment variable (
UTEKE_*) - Config file (
uteke.toml) - Built-in default
| Env Var | Config Equivalent | Default | Description |
|---|---|---|---|
UTEKE_HOME | — | ~/.codecora/uteke | Data directory |
UTEKE_PRIVACY_MODE | [privacy] mode | redact | Secret filter mode: redact, strict, off |
UTEKE_NAMESPACE | [store] namespace | default | Default namespace (applied in CLI) |
UTEKE_AUTH_TOKEN | — | — | Server auth token (applied in server) |
UTEKE_LOG_LEVEL | [logging] level | warn | Log level (trace/debug/info/warn/error) |
UTEKE_VECTOR_BACKEND | [vector] backend | compiled-in default | Vector engine when both are compiled in: usearch, vecq. Ignored (with a warning) on single-engine builds or unknown values. Switching engines on an existing store auto-rebuilds the index from SQLite |
UTEKE_SERVER_HOST | [server] host | 127.0.0.1 | Server bind address |
UTEKE_SERVER_PORT | [server] port | 8767 | Server port |
UTEKE_RECALL_MIN_SCORE | [recall] min_score | 0.0 | Default similarity threshold |
UTEKE_RECALL_MIN_SCORE_STRICT | [recall] min_score_strict | 0.5 | Strict threshold |
UTEKE_RECALL_STRATEGY | [recall] default_strategy | fusion | Default recall strategy (vector|fts5|hybrid|graph|fusion) |
UTEKE_GRAPH_DENSITY_WEIGHT | [recall] graph_density_weight | 0.1 | Edge-density boost weight |
UTEKE_GRAPH_AUTHORITY_WEIGHT | [recall] graph_authority_weight | 0.1 | Incoming-edge authority boost weight |
UTEKE_GRAPH_RERANK_ENABLED | [recall] graph_rerank_enabled | true | Master switch for graph reranking |
UTEKE_MCP_FENCE | — | on | 0, false, off or no stops uteke-mcp and POST /mcp from wrapping stored text in a <uteke-stored-data> block (MCP, #1599) |
UTEKE_NO_UPDATE_CHECK | update_check = false | unset | Any value turns the update check off in the CLI, uteke-serve and uteke-mcp (#1596) |
UTEKE_EMBEDDING_BACKEND | [embedding] backend | onnx | Embedding backend: onnx, openai, ollama |
UTEKE_EMBEDDING_MODEL | [embedding] model | backend-specific | Override model name |
UTEKE_EMBEDDING_API_KEY | [embedding] api_key | — | API key (OpenAI). Fallback: OPENAI_API_KEY |
UTEKE_EMBEDDING_BASE_URL | [embedding] base_url | backend-specific | Custom endpoint URL |
UTEKE_EMBEDDING_ENDPOINT_PATH | [embedding] endpoint_path | — | Custom API path (default: /embeddings) |
UTEKE_EMBEDDING_DIMS | [embedding] dims | 0 (auto) | Force embedding dimensionality |
UTEKE_EXTRACTION_MODEL | [extraction] model | — | Chat model for import --extract |
UTEKE_EXTRACTION_API_KEY | [extraction] api_key | — | API key. Fallback: embedding key / OPENAI_API_KEY |
UTEKE_EXTRACTION_BASE_URL | [extraction] base_url | OpenAI default | OpenAI-compatible endpoint base URL |
UTEKE_EXTRACTION_ENDPOINT_PATH | [extraction] endpoint_path | — | Custom API path (default: /chat/completions) |
UTEKE_EXTRACTION_MAX_FACTS | [extraction] max_facts | 0 (default) | Cap facts kept per document |
Docker Example
docker run -d --name uteke \
-p 127.0.0.1:8767:8767 \
-v uteke-data:/data \
-e UTEKE_LOG_LEVEL=info \
-e UTEKE_RECALL_MIN_SCORE=0.5 \
codecoradev/uteke:latest --host 0.0.0.0Config Migration
If you have an older flat-format config (pre-v0.0.4), uteke auto-migrates it on first run:
# Old format (auto-detected and migrated)
path = "~/.codecora/uteke"
default_namespace = "default"
log_level = "info"
↓ Auto-migrated to ↓
[store]
path = "~/.codecora/uteke"
namespace = "default"
[logging]
level = "info"No manual action needed — old config keys are automatically converted to the new sectioned format.
Namespace Resolution
Namespace is resolved in this order (highest priority first):
--namespace flag— CLI flag (highest priority)UTEKE_NAMESPACE— Environment variableuteke.toml [store] namespace— Config file"default"— Built-in default
Switch default namespace permanently with uteke namespace switch <name> — this updates the config file.
Per-Project Config
Place a .uteke/uteke.toml in your project root to override defaults for that project:
# my-project/.uteke/uteke.toml
[store]
path = "./.uteke"
namespace = "my-project"
[logging]
level = "warn"Run uteke from that project root and it uses the project's store, so each project gets its own isolated memory. Only the current directory is checked, not its parents; from a subdirectory, pass --store or set UTEKE_HOME.
Trust: what a project file may not set
A project directory can be an untrusted clone, so .uteke/uteke.toml is not allowed to decide where credentials or memory text are sent or how the server authenticates. These keys are ignored when they come from the project file (a warning is logged) and must be set in the global uteke.toml instead:
[embedding]:backend,api_key,base_url,endpoint_path[embed_fallback]and[extraction]:api_key,base_url,endpoint_path- the whole
[privacy]section (a cloned repository must not switch the secret filter off) - the whole
[lifecycle],[dream],[aging]and[maintenance]sections: they set the thresholds of the cycles that deprecate or delete memories (deprecated_ttl_days,max_deprecate_percent,soft_delete_only, the aging age, the auto-dream switch), and a cloned repository must not choose them for your store - the whole
[server]section (enabled,host,port,auth_token,read_only_token,cors_origins,allowed_hosts) - the whole
[rooms]section (a cloned repository must not loosen the room id rule)
Everything else (store path, namespace, logging, [recall] and [tier] tuning, ...) can be set per project. To trust a project file completely, set UTEKE_TRUST_PROJECT_CONFIG=1. The CLI and uteke-serve apply the same rules and the same per-key merge.
Room Ids (#1715)
Room ids are meant to have the shape category:title: lowercase, exactly one colon, at most 64 characters, ^[a-z][a-z0-9-]*:[a-z0-9][a-z0-9._-]*$ (for example project:uteke, research:docker). The category is a recommendation (project, research, team, ops, ref); any category of that shape is accepted.
[rooms]
require_category_title = false # default; true refuses new ids of another shapefalse(default): a new room id of another shape is created, with a warning (warningsover HTTP, aWarning:line in MCP and the CLI).true: a NEW canonical room id of another shape is refused:room create, the target ofroom rename, and a room that a write (room remember,remember --room) would create. HTTP answers400with{"error": "invalid_room_id", "message": "...", "room_id": "..."}; MCP errors start withinvalid_room_id:. A refused room write stores nothing.
Existing rooms, aliases of renamed rooms and reads are never refused. Restoring a backup with uteke import and uteke namespace migrate keep the ids they are given. Global file only (see Trust). This is stage 3 of #1715; it stays off until the old rooms are migrated on OSS and Cloud.
Document Similarity (#1730)
uteke doc similar, uteke doc duplicates, POST /doc/similar and uteke_doc_similar label a document pair possible_duplicate or similar_to by the cosine of the two document vectors (the mean of the chunk vectors, L2-normalised). The defaults are the thresholds of the memory auto-link:
[doc_similarity]
similar_threshold = 0.80 # default; cosine at or above: similar_to (also the default floor of a similar search)
duplicate_threshold = 0.92 # default; cosine at or above: possible_duplicate (also the default floor of a report)- Both keys are optional and are numbers from 0 to 1; a score exactly at a threshold counts.
- A value that is not a number from 0 to 1 falls back to its default and logs a warning; a
similar_thresholdabove theduplicate_thresholdresets both to the defaults (and logs a warning). The rest of the file is read as usual. - A request can still pass its own
threshold(--threshold, thethresholdfield), which replaces the floor of that call only. - The section changes nothing for memories: the auto-link of
rememberkeeps 0.80 and 0.92, and the dream cycle keeps[dream] dedup_threshold. - Project files may set it (it only changes what a read reports).
Privacy Filter (#1464)
Secrets in the content of a memory are masked before it is embedded or stored (ghp_[REDACTED:github-token], API_KEY=[REDACTED:env-secret]). The memory is flagged with metadata.redacted and metadata.redactions (kinds and counts, never values) and gets a redacted timeline event. The original text is not kept anywhere.
[privacy]
mode = "redact" # redact (default) | strict | off
allowlist = ["^dev-"] # regexes; a value matching any of them is kept as it is
tombstone_preview = true # false = a rejected-value tombstone keeps the hash onlyredact: mask and store.strict: refuse the write (secret_detected; import skips the row).off: store as given.
tombstone_preview (default true): forget --reason wrong keeps a 120-character preview and the reason with the tombstone, filtered like any other text (redact and strict both mask them; the forget is not refused). false keeps the hash only, so nothing of the forgotten text survives the prune or travels in export --full; the value is still refused (CLI reference).
UTEKE_PRIVACY_MODE overrides mode. An unknown mode or an invalid regex is logged and replaced by the default (redact) for that setting; the filter never turns itself off because of a typo. The filter covers the content, the tags, the strings inside the metadata and the source of remember, room remember, update and import, and the text written by room consolidation. Only the string values inside metadata are filtered, not its object keys. Importing a structural export (uteke export --full, restored by uteke import) puts a backup back as it was and does not filter; restore backups you trust.
Over HTTP, POST /remember and POST /room/remember return "redacted": true when something was masked (the stored text then differs from the request). In strict mode a write that contains a secret is refused with 400:
{"error": "secret_detected", "message": "...", "kinds": ["github-token"]}PUT /memory answers the same way when the new content, tags or metadata have a secret, and returns redacted when it masked one. uteke_update over MCP says so in its result. POST /import reports redacted (rows masked) and rejected_secret (rows skipped in strict mode, also counted in skipped).
CLI Flag Override
CLI flags always take precedence over config file values:
# Override store path
uteke --store /path/to/project/.uteke remember "project note"
# Override namespace
uteke --namespace agent-1 recall "context"
# Override namespace via env
UTEKE_NAMESPACE=agent-1 uteke recall "context"File Logging
Logs are written to ~/.codecora/uteke/logs/uteke.log with daily rotation:
~/.codecora/uteke/logs/
├── uteke.log # Current log
├── uteke.log.2026-05-29 # Yesterday's log
└── uteke.log.2026-05-28 # Two days agoNon-blocking async writer — logging never blocks memory operations. Rotated files are kept until manually deleted.
Limits
The input limits are fixed in this release: 100,000 characters of content, 20 tags per memory, 50 characters per tag, and a 10 MB server request body. The default --limit for recall, search and list is 10 on every surface.
POST /import is the exception to the 10 MB body: it takes up to 64 MiB, so a Uteke Cloud export fits in one call. UTEKE_MAX_IMPORT_SIZE (bytes, read when uteke-serve starts) sets another limit for that route; an empty, zero or unreadable value keeps 64 MiB. A larger body is refused with a 413 before it is read, and the message names the limit.
A [limits] section and the UTEKE_MAX_CONTENT_LENGTH, UTEKE_MAX_TAGS_COUNT, UTEKE_MAX_TAG_LENGTH, UTEKE_MAX_PAYLOAD_SIZE and UTEKE_DEFAULT_RECALL_LIMIT variables are parsed but not applied yet, so setting them has no effect.
View-Only API Token (#409)
The server supports dual-role authentication:
[server]
enabled = true
host = "127.0.0.1"
port = 8767# Start with admin + read-only tokens
uteke-serve --auth-token admin-secret --read-only-token viewer-key
# Or via env vars
UTEKE_AUTH_TOKEN=admin-secret UTEKE_READ_ONLY_TOKEN=viewer-key uteke-serveRead-only tokens can use GET endpoints and the POST routes that do not write (recall, search, list, stats, room and document reads). Every other POST, PUT and DELETE route returns 403 Forbidden. Over POST /mcp they can call the read-only MCP tools (see MCP: read-only tokens); an MCP write tool returns a tool error instead of running.
GET /health also answers without a token (for load balancers and uptime probes), but tokenless — or invalidly-authenticated — requests receive only {"status":"ok"}. Version, memory counts, and update info require a valid token (or auth disabled).
Aging (#247)
Controls automatic memory lifecycle management. Disabled by default — opt-in for long-running stores.
[aging]
enabled = false # Set true to enable automatic cleanup
max_age_days = 365 # Prune memories older than this
max_access_count = 10 # Only prune if accessed fewer than this many times
max_cold_count = 1000 # Max cold memories to keep before triggering cleanup| Setting | Default | Description |
|---|---|---|
enabled | false | Enable automatic aging |
max_age_days | 365 | Maximum age in days before pruning |
max_access_count | 10 | Max access count to be considered "cold" |
max_cold_count | 1000 | Max cold memories before cleanup triggers |
Maintenance Daemon (#442)
Controls auto-aging and auto-dream background tasks when running in server mode.
[maintenance]
auto_aging_enabled = false # Periodically clean up cold, stale memories
auto_aging_interval_hours = 24 # How often to run aging
auto_dream_enabled = true # Periodically run dream cycle (lint → dedup → orphans)
auto_dream_interval_days = 7 # How often to dream| Setting | Default | Description |
|---|---|---|
auto_aging_enabled | false | Enable auto-aging in server mode |
auto_aging_interval_hours | 24 | Aging check interval |
auto_dream_enabled | true | Enable auto-dream in server mode |
auto_dream_interval_days | 7 | Dream cycle interval |
Dream Pipeline Thresholds (#731)
Configurable thresholds for the dream maintenance pipeline (contradiction scan, dedup, orphan detection). All values were hardcoded before v0.9.0.
[dream]
contradict_similarity_threshold = 0.6 # Above this cosine = NOT a contradiction
contradict_tag_jaccard_min = 0.4 # Min tag overlap to consider contradiction
contradict_max_memories = 200 # Max memories for O(n²) scan
dedup_threshold = 0.92 # Cosine above this = merge candidate
orphan_importance_threshold = 0.15 # Below this + no edges = orphan| Setting | Default | Description |
|---|---|---|
contradict_similarity_threshold | 0.6 | Cosine threshold for contradiction detection |
contradict_tag_jaccard_min | 0.4 | Min Jaccard tag overlap for contradiction |
contradict_max_memories | 200 | Max memories loaded for contradiction scan |
dedup_threshold | 0.92 | Cosine threshold for dedup merging |
orphan_importance_threshold | 0.15 | Importance threshold for orphan flagging |
Update Notification (#917)
Uteke checks GitHub for newer releases at startup. The result is cached for 24 hours to avoid repeated network calls.
update_check = true # Set to false to disable startup update notification| Setting | Default | Description |
|---|---|---|
update_check | true | Enable background update notification on startup. uteke-serve and uteke-mcp read it from the global uteke.toml (#1596); the CLI also honours a project file |
To turn the check off in every binary, including an offline or hosted install, set update_check = false in the global uteke.toml, or set the environment variable UTEKE_NO_UPDATE_CHECK (any value). With either, no binary calls GitHub for the update check and GET /health reports no update. uteke upgrade is a separate, explicit command and still contacts GitHub.
When an update is available, a banner is printed to stderr (does not interfere with stdout pipes). The check is non-blocking: it runs in a background thread joined before process exit, so it never delays command execution.
Skipping in batch/subprocess mode (#1006)
Set the UTEKE_NO_UPDATE_CHECK=1 environment variable to skip the update check entirely. This is useful for benchmarks, scripts, or automated pipelines that invoke uteke many times via subprocess:
export UTEKE_NO_UPDATE_CHECK=1Memory Lifecycle (#928–#937)
Uteke uses a soft-delete lifecycle model. Memories are never hard-deleted directly by automated processes. They transition through a deprecated state before eventual pruning.
Lifecycle States
remember() → ACTIVE → soft_deprecate() → DEPRECATED (hidden, restorable) → prune() → HARD DELETE| State | Visible in recall? | Restorable? | TTL |
|---|---|---|---|
| ACTIVE | ✅ Yes | N/A | — |
| DEPRECATED | ❌ Hidden | ✅ promote() | 30 days (configurable) |
| PRUNED | ❌ Gone | ❌ No | — |
Configuration
[lifecycle]
# Master switch: when true, ALL delete operations become soft-deletes.
# forget(), bulk_forget, aging_cleanup, consolidate, delete() all redirect to deprecate.
soft_delete_only = true
# Auto-lifecycle background thread (server mode only).
auto_aging_enabled = true
auto_aging_interval_hours = 168 # Run cycle every 7 days
# What qualifies as "aged" → candidate for deprecation.
min_age_days = 90 # Must be at least 90 days old
max_access_count = 3 # Accessed 3 times or fewer
# Rate limiting: max % of active memories deprecated per cycle.
max_deprecate_percent = 1.0 # 1% of active per cycle
min_deprecate_per_cycle = 1 # Floor (always at least 1)
max_deprecate_per_cycle = 50 # Ceiling (never more than 50)
# Deprecated TTL: how long before soft-deleted memories are pruned (hard delete).
deprecated_ttl_days = 30 # 30 days in deprecated state
auto_prune_enabled = true # Auto-prune expired deprecated memories
# Dream dedup: when consolidating duplicates, soft-delete instead of hard delete.
dream_dedup_soft_delete = trueField Reference
| Setting | Default | Description |
|---|---|---|
soft_delete_only | true | Master switch: all deletes become soft-deletes |
auto_aging_enabled | true | Enable auto-lifecycle background thread (server) |
auto_aging_interval_hours | 168 | Hours between auto-lifecycle cycles |
min_age_days | 90 | Minimum age (days) to be eligible for deprecation |
max_access_count | 3 | Max access count for deprecation eligibility |
max_deprecate_percent | 1.0 | Max % of active memories deprecated per cycle |
min_deprecate_per_cycle | 1 | Floor for per-cycle deprecation cap |
max_deprecate_per_cycle | 50 | Ceiling for per-cycle deprecation cap |
deprecated_ttl_days | 30 | Days before deprecated memories are pruned |
auto_prune_enabled | true | Auto-prune expired deprecated memories in lifecycle cycle |
dream_dedup_soft_delete | true | Consolidation soft-deletes instead of hard-deletes |
How the Lifecycle Cycle Works
Each cycle runs two phases:
- Deprecate phase: Find aged memories (old + rarely accessed) → apply percentage cap → batch deprecate.
- Prune phase: Find deprecated memories past TTL → hard delete (irreversible).
The percentage cap ensures at most 1–2% of active memories are deprecated per cycle, preventing sudden data loss. The cap is calculated as:
cap = clamp(total_active × max_deprecate_percent / 100, min_per_cycle, max_per_cycle)Hard Delete Paths
Hard delete only occurs in two explicitly controlled paths:
prune(): Deletes deprecated memories whose TTL has expired. Only runs whenauto_prune_enabled = true.forget(): Bypasses soft-delete only whensoft_delete_only = false(default istrue, so forget = soft-delete by default).
All other paths (delete(), bulk_delete(), aging_cleanup(), consolidate()) respect soft_delete_only and deprecate instead.