ReMe/docs/en/configuration.md
jinliyl 524b1b6908
feat(studio): unify the workbench and proactive runtime (#764)
* fix(proactive): simplify round files and restore failed summaries

* fix(proactive): validate document-relative Markdown links

* feat(proactive_agent): implement v2 daily record workflow with single-file decision

- Add ProactiveAgentStepV2 class to support single daily note decision and reminder
- Introduce RoundOutputs for v2 round file tracking, and keep RoundArtifacts for v1 summary backup
- Refactor AgentOutbox to support both v1 standalone reminder files and v2 daily reminder records
- Add proactive_record utilities to parse and validate v2 daily record frontmatter and metadata
- Enhance proactive_agent to prepare, read, and manage artifacts for both v1 and v2 flows
- Add configuration profile proactive_v2 to enable new workflow with backward compatibility
- Update proactive.yaml and reactive proactive_agent_step configuration comment for easy switching
- Provide extensive schema validation for v2 reminders ensuring priority and message consistency
- Document v2 workflow and usage in English and Chinese runtime docs
- Add unit tests for v2 step verifying single file output and proper decision handling

* refactor(agent/runtime): replace ReminderRef with string keys and simplify reminder handling

- Remove ReminderRef model and switch to using workspace-relative string keys for reminders
- Simplify AgentOutbox to read, write, and manage reminders keyed by strings
- Change file locking and version checking to protect concurrent edits on daily record files
- Replace legacy and v2 reminder file handling with unified ReminderFiles storage
- Adjust ChatNotifications to operate with the new key scheme and update pending/read sets
- Refactor RoundOutputs to RoundRecord for safer round record tracking and rollback
- Remove unused ProactiveRunResult and related references from imports and exports
- Update InboxWakeRequest, AgentReminder, and related models for consistent ID and path validation
- Adjust proactive agent runtime and local runtime to check reminder versions before commit
- Correct language and docs to describe reminders as daily records instead of separate files
- Clean up roles of inbox and outbox for reminder ownership, delivery, and acknowledgments

* fix(proactive): serialize round commits and align desktop reminders

* refactor(proactive): unify task triggers in Proactive Runtime

* fix(proactive): bound reminder payloads and simplify receipts

* refactor(studio): share workbench and simplify proactive delivery

* fix(studio): update and centralize build dependencies

* fix(proactive): guard draft repair and verify Studio deployments

* chore(docs): update source-map-js

* feat(release): support publishing selected artifacts from a tag

* chore(studio): remove the public playground

* refactor: simplify reminders and release workflows

* fix: preserve proactive records and align release provenance

* test(proactive): remove brittle prompt and preset assertions

* fix(proactive): register reminders after input acknowledgement

* feat(notebook): list projects across todos and ideas

* feat(studio): connect mobile apps to configurable ReMe services

* fix(proactive): reserve registered reminder paths

* fix(studio): request Android local network access

* fix(proactive): reserve reminder paths referenced by receipts
2026-11-23 17:19:21 +08:00

15 KiB

title description
Configuration ReMe configuration files, environment expansion, command-line overrides, and core components.

Configuration

ReMe uses YAML or JSON to describe its Service, Jobs, and Components. The built-in default is reme/config/default.yaml. Select another configuration at startup and apply command-line overrides when needed.

Precedence

Configuration is merged in this order, with later values winning:

  1. application_defaults from enabled plugins.
  2. The selected file; default is used when none is specified.
  3. CLI dot-notation overrides.

Choose one startup command in one terminal and leave the service running:

reme start
reme start config=demo
reme start config=cookbook
reme start config=/absolute/path/to/app.yaml
reme start service.port=8181 workspace_dir=/data/reme

config accepts a built-in name or a .yaml, .yml, or .json file. Overrides are deep-merged, so changing service.port preserves sibling service settings. The optional cookbook variant extends default and composes the separately installed Auto Fin, Daily Paper, and DingTalk plugins. It requires the three DingTalk application credential environment variables before configuration loading. It also enables text-embedding-v4 vector retrieval, uses AgentScope with ${LLM_MODEL_NAME:-qwen3.8-max} by default, and runs the DingTalk bridge through Claude Code with the same LLM_MODEL_NAME and LLM_API_KEY.

From another terminal, call reme <job-name>, such as reme help; the CLI discovers the running service configuration.

CLI values

Arguments use key=value; leading - or -- is accepted:

reme start --service.port=8181 --service.web_enabled=false

Values support null, booleans, numbers, JSON arrays and objects, quoted JSON strings, and plain strings. Numeric-looking values with leading zeroes, such as 007, remain strings, as do nan, inf, and Infinity. Quote values such as "true" in JSON when they must remain strings.

Environment variables

Configuration recursively expands:

api_key: ${LLM_API_KEY}
base_url: ${LLM_BASE_URL:-https://example.com/v1}

${VAR} fails when undefined; ${VAR:-default} uses its fallback. ReMe also searches for .env from the command's working directory through at most five parents.

Keep secrets in .env or the process environment, never in committed configuration.

Application fields

Field Default Purpose
app_name ReMe Display name
workspace_dir .reme User-owned workspace root, normalized to an absolute path
metadata_dir metadata Rebuildable indexes, graphs, and catalogs
session_dir session Agent sessions; standard transcripts use session/dialog
mem_session_dir mem_session Agent-wrapper sessions and configuration
resource_dir resource External resources
daily_dir daily Daily memory
digest_dir digest Consolidated long-term memory
timezone Asia/Shanghai IANA timezone used for dates and cron jobs
language empty Default language for LLM interactions
plugins [] Installed plugins enabled for this Application
service HTTP Service configuration
jobs default Jobs Job configurations by name
job_history_limit 100 Completed executions retained per Job in application memory; running records are always retained
components defaults Components grouped by type and name

session_dir must remain workspace-relative.

Enabling jobs

jobs.<name>.enabled defaults to true for all Job types. Disabled jobs retain their configuration but do not start, expose service interfaces, or accept calls through Application.run_job() / run_stream_job(). For example, disable ReMe's Dream cron when a host plugin owns the schedule:

reme start jobs.dream_cron.enabled=false

Restart the service to apply the override. The separate auto_dream API remains available, and other jobs continue running. enable_serve independently controls service exposure: enabled=true, enable_serve=false keeps a Job available for local calls. Background and cron jobs are never service-exposed.

jobs.<name>.track_execution defaults to true for background/cron Jobs and false for base/stream Jobs. Set it explicitly to override either default, for example reme start jobs.chat.track_execution=true. Execution records are memory-only and disappear when the Application is recreated. job_history_limit=0 retains only running executions. See Job execution status for queries and step paths.

Cron initialization

Cron Jobs accept optional init_steps (default []). They run in order before the scheduler waits for its first trigger. For example, the proactive preset keeps Codex dialogue initialization and collection in one Job:

jobs:
  codex_dialogue_cron:
    backend: cron
    cron: "*/5 * * * *"
    init_steps:
      - backend: codex_dialogue_init_step
        codex_home: &codex_home ${CODEX_HOME:-~/.codex}
    steps:
      - backend: codex_dialogue_step
        agent_name: work
        codex_home: *codex_home

Only steps run at each scheduled time, using the application's timezone. Initialization and each trigger get fresh Step instances and separate runtime contexts and execution records. Share durable progress through workspace files or Components, rather than initialization outputs. Waiting creates no execution record.

An initialization exception or success=False stops the initialization chain and prevents scheduling. With supervision enabled, the existing background supervisor retries with backoff; supervisor=false leaves the failure unretried. Initialization runs again whenever the job body restarts, so its Steps must be idempotent. Shutdown uses the same stop signal and cancellation cleanup as other background Jobs. Nonempty init_steps are rejected by other built-in Job types.

LLM

The default LLM uses an OpenAI-compatible interface:

components:
  as_llm:
    default:
      backend: openai
      model: qwen3.7-plus
      context_size: 200000
      credential:
        api_key: ${LLM_API_KEY:-}
        base_url: ${LLM_BASE_URL:-}

Built-in registrations include openai, anthropic, dashscope, deepseek, gemini, moonshot, ollama, and xai. Their detailed model fields follow the corresponding AgentScope wrappers.

File operations, BM25 search, wikilink traversal, and proactive_read do not require an LLM. Evolution workflows such as auto_memory, auto_resource, auto_dream, and proactive refresh do.

With reme-ai[core] installed, dashscope_search calls qwen3.8-flash through the DashScope SDK, independently of LLM settings. Set the key and start the service in one terminal:

export DASHSCOPE_API_KEY=sk-xxx
reme start config=default

From another terminal, call reme dashscope_search query="Latest Qwen models". A missing key does not prevent service startup; calls to this Job return a failure. The result's search_info.search_results preserves provider source fields; content is separate model-generated text. Page bodies and snippets are not guaranteed. See reme/config/default.yaml for the model, search strategy, and timeout.

Decision Model Configuration

as_decision_model is a provider-independent interface for probabilistic decisions. The current agentscope adapter calls the TypeSafe API through AgentScope 2.0.11. It evaluates named binary, choice, or score questions against shared text or a JSON object.

Install the optional dependencies:

pip install "reme-ai[core,decision]"
# For a source checkout:
pip install -e ".[core,decision]"

core excludes the decision model SDK; full includes this extra. Environment variables alone do not enable decision models, and the default decision model configuration remains commented out. Startup does not import optional decision model modules or create a client. The first decision request checks dependencies and credentials; shutdown waits for active requests before closing the shared client.

Environment variable Default Purpose
DECISION_MODEL_BACKEND agentscope Decision model backend
DECISION_MODEL_NAME null (adapter default) Model name or alias
DECISION_MODEL_API_KEY Empty TypeSafe API key, required for decision requests
DECISION_MODEL_BASE_URL null Optional API URL; empty values use the SDK default

To enable a component:

components:
  as_decision_model:
    default:
      backend: ${DECISION_MODEL_BACKEND:-agentscope}
      model: ${DECISION_MODEL_NAME:-null}
      credential:
        api_key: ${DECISION_MODEL_API_KEY:-}
        base_url: ${DECISION_MODEL_BASE_URL:-null}
      timeout: 30
      max_retries: 2
      retry_delay: 0.5

timeout is the per-request timeout in seconds; max_retries counts retries after the initial request; retry_delay is the initial backoff in seconds. Configure these fields through YAML or CLI overrides. The SDK performs retries.

The decision_demo configuration uses extends: default to inherit the HTTP/MCP service, components, and Jobs, then adds a decision model and a service-exposed decide Job. The default background tasks also start. First start the service in one terminal:

export DECISION_MODEL_API_KEY=your-typesafe-api-key
reme start config=decision_demo \
  components.as_decision_model.default.timeout=15

Then call it from another terminal; the client discovers the running service configuration:

reme decide state="My account was charged twice. Please help urgently."

Calls send the state and questions to TypeSafe. Omitting questions evaluates urgency, customer-support routing, and priority together. You can replace the demo questions completely and pass a JSON object as state:

reme decide \
  state='{"request":"My account was charged twice","channel":"email"}' \
  questions='{"urgent":{"type":"binary","instructions":"Does this need urgent attention?"}}'

Question types are binary, choice, and score. Binary questions accept optional criteria.true / criteria.false descriptions. Choice questions require a non-empty criteria object mapping category names to descriptions or null. Score questions require a non-empty ordered list of descriptions, starting at score zero. Each question can include instructions. Explicit empty questions fail validation instead of selecting the demo defaults.

reme decide displays the standard Response JSON, with the decision result under answer, including model, content, usage, response identity, and timing information. Answers preserve probabilities and confidence and are keyed by question name; integer score-distribution keys become strings in JSON. The Step also writes context.data["decision_result"] for subsequent Steps in that request, without automatically writing memory files. SDK errors follow BaseJob's success=false contract.

Use decision_demo_step in your own Job and select a named component with the Step setting as_decision_model: <name>. Implement BaseAsDecisionModel and register a backend to add another provider. Jobs select a component by name; they do not select a provider directly. The current adapter uses AgentScope classifier question and answer schemas. See reme/components/as_decision_model/ for the interface. A null model uses the adapter default.

For tool-history compaction, start reme start config=decision_compaction and call reme compact_context from another terminal with messages and any protection or budget options. It uses the same decision model interface and returns a proposed snapshot; the caller owns archiving and applying it. Request token budgets are estimates with overhead headroom, independent of the host model tokenizer.

See Context compaction with decision models for the strategy, SVG walkthrough, and live integration cases.

Speech recognition and synthesis

The proactive configuration exposes asr and tts for Desktop voice input and playback. The demo preset extends it with the speech_demo TTS-to-ASR round trip. Set DASHSCOPE_API_KEY, then start the service:

reme start config=demo

From another terminal:

reme tts text="Hello from ReMe."
reme speech_demo text="Hello from ReMe."

asr accepts Base64 audio, audio_format (wav, mp3, pcm, or opus), and optional sample_rate. Its answer is the recognized text; silence returns an empty string. tts returns Base64 audio, format, sample_rate, and is_last=true inside the standard response answer. Provider failures return success=false.

Select components through Step settings asr: <name> and tts: <name>. Configure model, voice, provider parameters, and timeout under components.asr and components.tts. Missing credentials do not prevent startup. DashScope speech uses its native /api/v1 base URL, separately from OpenAI-compatible LLM endpoints.

Implement BaseASR.transcribe or BaseTTS.stream to add a backend; BaseTTS.synthesize collects the same stream. Components exchange audio bytes; Steps handle Base64 transport. Capture and playback belong to the client. See reme/components/asr/, reme/components/tts/, and reme/schema/speech.py for the contracts.

Embeddings

Vector retrieval is disabled by default. Credentials alone do not enable it: configure as_embedding, embedding_store, and connect the store to file_store.

components:
  as_embedding:
    default:
      backend: openai
      model: text-embedding-v4
      dimensions: 1024
      credential:
        api_key: ${EMBEDDING_API_KEY}
        base_url: ${EMBEDDING_BASE_URL:-https://dashscope.aliyuncs.com/compatible-mode/v1}
  embedding_store:
    default:
      backend: local
      as_embedding: default
  file_store:
    default:
      backend: local
      embedding_store: default
      keyword_index: default
      file_graph: default

Rebuild the embedding index after changing the model or dimensions.

Configure the Inbox, execution wrapper, Remy's initial memory, background tasks, and reminder delays through components.proactive_runtime.default. See Proactive Runtime.

Service and Jobs

Minimal HTTP configuration:

service:
  backend: http
  host: 127.0.0.1
  port: 2333
  web_enabled: true
  mcp_enabled: true
  mcp_path: /mcp

A Job declares a backend, parameter schema, and ordered Steps:

jobs:
  example:
    backend: base
    description: Example job
    parameters:
      type: object
      properties:
        text: { type: string }
      required: [text]
    steps:
      - backend: example_step

Set enable_serve: false to keep a Job internal. Background and cron Jobs are never service-exposed.

Inspect the effective configuration

reme app_config

The result is the merged, validated configuration with secrets redacted. Use it when diagnosing plugin or override precedence. The authoritative contracts remain reme/schema/application_config.py and reme/config/default.yaml.