Skip to content

Configuration reference

Every setting is an environment variable (or a line in .env). Names are MYELINATE_ plus the upper-case field name. Lists take JSON, for example MYELINATE_CORS_ORIGINS='["https://app.example.com"]'.

General

Variable Type Default Description
MYELINATE_ENV Literal['dev', 'staging', 'prod'] prod Deployment mode. Secure by default: outside dev the gateway refuses to start without a bootstrap admin key or OIDC. dev with no credentials serves everything as tenant "dev" with all scopes (local use only).
MYELINATE_DATABASE_URL str sqlite+aiosqlite:///./myelinate.db SQLAlchemy async URL. SQLite for dev / single node; PostgreSQL (postgresql+asyncpg://...) for production.

LLM used for reflection, curation, judging and evolution

Variable Type Default Description
MYELINATE_LLM_PROVIDER Literal['anthropic', 'none'] anthropic anthropic uses Claude for learning; none disables learning-side LLM calls (recall/record still work).
MYELINATE_ANTHROPIC_API_KEY or ANTHROPIC_API_KEY SecretStr or None — Anthropic API key. Also read from plain ANTHROPIC_API_KEY (env or .env); unset means the SDK's default lookup.
MYELINATE_LLM_MODEL str claude-opus-5-5 Model used for learning (not your agent's model).
MYELINATE_LLM_EFFORT Literal['low', 'medium', 'high', 'xhigh', 'max'] medium Reasoning effort for learning calls. Lower is cheaper; raise for harder domains.
MYELINATE_LLM_MAX_TOKENS int 16000 Output token cap per learning call.
MYELINATE_DAILY_TOKEN_BUDGET int 5000000 Learning-side tokens per tenant per UTC day; jobs are deferred (not failed) when exceeded. 0 = unlimited.

Optional embeddings (any /v1/embeddings-compatible endpoint)

Variable Type Default Description
MYELINATE_EMBEDDINGS_URL str or None — Embeddings endpoint (Voyage, Azure AI, TEI, vLLM, Ollama, LiteLLM...). Unset = lexical retrieval only.
MYELINATE_EMBEDDINGS_MODEL str voyage-3.5 Embedding model name sent to the endpoint.
MYELINATE_EMBEDDINGS_API_KEY SecretStr or None — Bearer token for the embeddings endpoint.

Auth

Variable Type Default Description
MYELINATE_BOOTSTRAP_ADMIN_KEY SecretStr or None — Platform-operator key (send with X-Tenant-Id). Use it to mint scoped tenant keys, then vault it.
MYELINATE_OIDC_ISSUER str or None — OIDC issuer URL, checked against the token's iss.
MYELINATE_OIDC_AUDIENCE str or None — Expected token audience (aud).
MYELINATE_OIDC_JWKS_URL str or None — JWKS URL for token signature keys. Setting it enables OIDC authentication.
MYELINATE_OIDC_TENANT_CLAIM str tid Token claim that holds the tenant id (Entra ID: tid).

Recall

Variable Type Default Description
MYELINATE_RECALL_MAX_SKILLS int 3 Skills injected in full per recall.
MYELINATE_RECALL_MAX_MEMORIES int 8 Memories injected per recall.
MYELINATE_RECALL_MIN_SCORE float 0.12 Minimum relevance (0-1) for a skill or memory to be recalled.
MYELINATE_SKILL_INDEX_SIZE int 10 Further matching skills listed by name only (loaded on demand with skill_view).
MYELINATE_MAX_BULLETS_PER_SKILL_INJECTED int 40 Cap on rules injected per skill (worst-performing rules are dropped first).
MYELINATE_ASK_FOR_CITATIONS bool False Ask the agent to cite rule ids like [b-1a2b3c4d]: sharper credit assignment, but visible in agent output.
MYELINATE_HOLDOUT_RATE float 0.05 Share of runs served no learned skills (control group) to measure causal lift. 0 disables.

Learning loop

Variable Type Default Description
MYELINATE_REFLECT_EVERY_N_EPISODES int 5 Reflect after this many episodes per agent (failures and tool-heavy runs trigger it sooner).
MYELINATE_REFLECT_ON_FAILURE bool True Reflect right after a failed episode.
MYELINATE_REFLECT_MIN_TOOL_CALLS int 5 Reflect after any episode with at least this many tool calls.
MYELINATE_REFLECT_DEBOUNCE_SECONDS float 20.0 Wait for an agent to go quiet before reflecting (debounce), in seconds.
MYELINATE_SELF_JUDGE_UNKNOWN_OUTCOMES bool True Use an LLM judge to estimate outcomes when the caller sends none (ReasoningBank-style).
MYELINATE_MIN_JUDGE_CONFIDENCE float 0.7 Below this judge confidence an episode can teach memories but never change skills.
MYELINATE_MAX_OPS_PER_CHANGESET int 6 Maximum edit operations per changeset (bounded "textual learning rate").
MYELINATE_DEDUP_SIMILARITY float 0.85 Cosine similarity at which rules are flagged as possible duplicates (when embeddings are configured).
MYELINATE_DEDUP_JACCARD float 0.3 Lexical similarity that flags possible duplicates without embeddings; an LLM decides merge or keep.
MYELINATE_CURATE_EVERY_N_EPISODES int 25 Run library upkeep (dedup, lifecycle, nomination, profiles) every N episodes per agent.

Governance

Variable Type Default Description
MYELINATE_AUTO_APPROVE_MEMORIES bool True Apply new memories without review (still safety-scanned; flagged ones wait for approval).
MYELINATE_AUTO_APPROVE_LOW_RISK bool True Auto-apply purely additive skill changes (new rules / new skills).
MYELINATE_AUTO_APPROVE_MEDIUM_RISK bool False Auto-apply edits to existing rules and duplicate merges. Keep false for agents that act on production.
MYELINATE_AUTO_APPROVE_MIN_EVAL_SCORE float 0.7 Changesets with an offline eval score below this are never auto-applied.
MYELINATE_MAX_SKILL_CHARS int 16000 Maximum characters of new text in one changeset (larger ones are flagged).
MYELINATE_MAX_BULLET_WORDS int 80 Rules longer than this many words get a lint warning.

Canary experiments

Variable Type Default Description
MYELINATE_CANARY_ENABLED bool True Serve changes to proven skills beside the current version on live traffic before applying them.
MYELINATE_CANARY_MIN_SAMPLES int 20 Uses a skill needs before its changes are canaried, and samples per arm before a verdict.
MYELINATE_CANARY_MAX_SAMPLES int 300 Samples after which an inconclusive canary keeps the current version.
MYELINATE_CANARY_THRESHOLD float 0.95 Posterior probability needed to promote (or, mirrored, to reject) a candidate.
MYELINATE_CANARY_FLOOR float 0.1 Minimum share of traffic each arm always gets (exploration floor).
MYELINATE_CANARY_MAX_DAYS int 14 Canaries without a verdict after this many days expire and keep the current version.

Evolution (GEPA-style)

Variable Type Default Description
MYELINATE_EVOLVE_MIN_USES int 10 New uses of a skill required before it can be evolved again.
MYELINATE_EVOLVE_MAX_SUCCESS_RATE float 0.7 Skills whose posterior success rate is below this are candidates for evolution.
MYELINATE_EVOLVE_ITERATIONS int 4 Mutation iterations per evolution run.
MYELINATE_EVOLVE_MINIBATCH int 3 Episodes in each cheap pre-gate minibatch.
MYELINATE_EVOLVE_EVAL_SAMPLE int 10 Held-out episodes used to score candidates.
MYELINATE_EVOLVE_MIN_IMPROVEMENT float 0.05 Held-out score gain a candidate needs over the current skill to be proposed.

Lifecycle

Variable Type Default Description
MYELINATE_STALE_AFTER_DAYS int 14 Days unused before a skill is marked stale (still recallable, ranked lower).
MYELINATE_ARCHIVE_AFTER_DAYS int 30 Days unused before a skill is archived (not recalled; never deleted). Pinned skills are exempt.
MYELINATE_PROFILE_MAX_CHARS int 1400 Maximum length of a per-user profile card.
MYELINATE_SHARE_LEARNED_FACTS bool False Share facts learned from one user's runs with all users of the agent (off: they stay user-scoped).

Ops

Variable Type Default Description
MYELINATE_WORKER_ENABLED bool True Run the background job worker inside the gateway process. Set false when running myelinate worker pods.
MYELINATE_WORKER_METRICS_PORT int 9464 Port for Prometheus metrics served by standalone myelinate worker processes. 0 disables.
MYELINATE_DB_POOL_SIZE int 10 Database connections per process (PostgreSQL), and extra connections allowed under burst.
MYELINATE_DB_MAX_OVERFLOW int 20
MYELINATE_WORKER_POLL_SECONDS float 2.0 Seconds between job-queue polls when idle.
MYELINATE_WORKER_CONCURRENCY int 4 Jobs a worker runs concurrently.
MYELINATE_JOB_MAX_ATTEMPTS int 3 Attempts before a job is marked failed.
MYELINATE_RATE_LIMIT_PER_MINUTE int 600 Requests per minute per authenticated principal (per process).
MYELINATE_IP_RATE_LIMIT_PER_MINUTE int 3000 Requests per minute per client IP, applied before authentication (per process).
MYELINATE_REDACT_PII bool True Redact emails, phone numbers, card numbers, secrets etc. before anything is stored.
MYELINATE_EPISODE_RETENTION_DAYS int 90 Episodes, recall logs and finished jobs older than this are removed by myelinate purge.
MYELINATE_AUDIT_RETENTION_DAYS int 365 Audit-log entries older than this are removed by myelinate purge.
MYELINATE_MAX_REQUEST_BYTES int 4000000 Maximum request body size in bytes (also enforced for chunked uploads).
MYELINATE_CORS_ORIGINS list[str] [] Browser origins allowed by CORS (JSON list). Empty disables CORS.
MYELINATE_MCP_ALLOWED_HOSTS list[str] ["localhost:*", "127.0.0.1:*"] Host headers accepted by the /mcp endpoint (DNS-rebinding protection). Add your public hostname.