Skip to content

Services and Deployment ​

ReMe can run as a local HTTP service, a standalone MCP server, or a one-shot CLI Job. By default HTTP binds to 127.0.0.1:2333; one public port serves JSON, SSE, streamable HTTP MCP, and optional ReMe Studio.

HTTP API ​

Start the service in one terminal and leave it running. Choose one of these startup commands:

bash
reme start
reme start service.host=127.0.0.1 service.port=8181

IPv6 literals such as ::1 can be used as the host; ReMe formats them correctly when HTTP or MCP clients connect. If a service binds to the IPv6 wildcard ::, in-process clients use the connectable loopback address ::1.

From another terminal, call a Job through the CLI client:

bash
reme search query="user preferences" limit=5

Regular Jobs also become POST /<job-name>; this HTTP example uses the default port 2333:

bash
curl -s http://127.0.0.1:2333/search \
  -H 'Content-Type: application/json' \
  -d '{"query":"user preferences","limit":5}'

Job arguments live at the request body's top level. A regular response follows the Response schema:

json
{"success": true, "answer": "...", "metadata": {}}

Unhandled Step failures become unsuccessful responses.

On shutdown or restart, a supervised HTTP worker gives active requests up to two seconds to finish. service.timeout_graceful_shutdown can shorten that interval. The supervisor allows eight seconds in total for requests and application cleanup, then terminates a stalled worker and its descendants. A failed shutdown stops the restart and returns a nonzero exit status.

Remote connectors ​

Desktop opens Remy and restores the selected service, defaulting to local. It starts the bundled backend when the local port is free. Mobile opens the connection chooser until a service is selected. For a remote workspace, open Settings → Connection to enable Codex or Claude Code collection on this computer. Both sources start disabled. Desktop saves source choices and cursors per endpoint and workspace. First activation starts from the current position. Re-enabling a source resumes its saved cursor. Mobile connects directly to the selected service.

Desktop runs the collector preset in a local process while at least one dialogue source is enabled. This preset shares the two dialogue cron definitions with proactive. Each job selects a named HTTP client through remote_client. Credentials come from the process environment. Desktop pins each request to the selected workspace. A standalone collector can set the HTTP client’s expected_workspace to the receiver’s workspace_dir for the same check. To run the same collector independently, save this configuration and run reme start config=./desktop.yaml.

yaml
extends: collector
workspace_dir: ~/.reme-desktop-collector
components:
  client:
    cloud:
      backend: http
      base_url: https://example-reme.hf.space
      api_token_env: REME_REMOTE_API_TOKEN
      platform_token_env: REME_REMOTE_PLATFORM_TOKEN
jobs:
  codex_dialogue_cron:
    enabled: true
    remote_client: cloud

The proactive preset keeps its own collections in its workspace. Its service.accept_resource_uploads: true setting lets other devices send packages to this service. A connector sends files and events to another instance only when it has a remote_client. It makes two requests:

  1. POST /files?action=resource takes multipart fields. Set path to the complete package directory relative to the receiving workspace, including the package name. Send the native manifest JSON as the text field metadata and one binary files part per manifest entry, with its relative path as the filename. Success returns {"path":"…"}. Repeating an identical upload succeeds. Conflicting content returns HTTP 409.
  2. POST /manage_connector takes JSON with action: send, runtime_names, and events. A dialogue event references the remote manifest, Markdown and images. The upload also contains the full JSONL. An empty recipient list publishes only the resource.

For a dialogue package containing two files, run this command from its directory with REME_URL set to the receiver:

bash
curl --fail-with-body "$REME_URL/files?action=resource" \
  -H "X-ReMe-API-Token: $REME_REMOTE_API_TOKEN" \
  -F 'path=imports/codex/example' -F 'metadata=<metadata.json' \
  -F 'files=@dialogue.md' -F 'files=@dialogue.jsonl'

Streaming and SSE ​

The HTTP service sends SSE comments during silent waits to keep the connection active. Clients ignore these comments; only the terminal event ends the stream. Disconnecting cancels the request's job.

Jobs with backend: stream also use POST /<job-name>, returning text/event-stream. Error paths emit an error chunk and always terminate the stream. The default chat Job is streaming:

bash
curl -N http://127.0.0.1:2333/chat \
  -H 'Content-Type: application/json' \
  -d '{"query":"Summarize my long-term preferences"}'

The proactive preset uses list_workspace, search_workspace, load_file, save_file and get_client_info for workspace access. Studio sends the complete source and uses the mtime from load_file as expected_mtime. A changed file causes a file_conflict response. The default configuration provides list, search, load, save and app_config.

The proactive configuration exposes ask_agent(query, agent_name=Remy) for the fixed Chat Agent. It resumes the current native session; create_chat_session selects a fresh session. The demo preset inherits both Jobs and adds list_chat_sessions, session_read and session_status for history and native session inspection. MCP does not expose Stream Jobs. Studio integration is separate from this backend.

Studio loads the Agent list separately with list_agents. The watch_agent_session stream carries conversation changes, activity and heartbeats. Supply a client-generated request_id to ask_agent. After a disconnect, submit the same Agent, query, target run and request ID with resume: true to reattach. Use cancel_agent_turn(agent_name, request_id) to stop execution. The service retains active requests and the most recent 128 completed receipts in the current process. For a task, include the observed resume_turn_id and run_id to recover its completed answer from native history after a restart or eviction. A resume request never starts another model turn.

If the selected agent cannot read Remy's current history, watch_agent_session emits history_unavailable with the affected session_id. This can happen when changing agent backends in the same workspace because each backend stores native history separately. Choosing Start a new conversation calls create_chat_session(expected_session_id=...) and keeps the old history files. If another device has already switched, the service returns the current conversation.

Proactive Runtime ​

The proactive preset starts one Remy Chat Runtime and four background Runtimes for project memory, Notebook follow-up, finance and technology news. Configure them under components.agent_runtime; components.agent_manager.default manages background identities only. Runtimes own sessions, execution locks, Inbox and Outbox resources. Jobs own execution and scheduling; each call creates fresh Steps. The Application owns the shared AgentWrapper and App Server.

For Claude Code, start reme start config=proactive_cc. This preset uses Claude Code's native system prompt and appends each Runtime's role instructions, including Remy's Chat prompt. Prompt snapshots are disabled so resumed calls use the current appended instructions. In the Codex and Claude Code presets, Remy’s chat shell can access the network. Background tasks run shell commands offline and retain their web search tools. Set sandbox_network_access on a Runtime to configure its shell in workspace-write mode. Both proactive and proactive_cc use LLM_API_KEY, LLM_BASE_URL, and REME_MODEL_NAME. Claude Code requires an Anthropic-compatible endpoint; its preset defaults to https://dashscope.aliyuncs.com/apps/anthropic. Codex uses the Responses API. Select the agent preset in the launch command or Studio. Studio submits the launch and waits for the replacement service to become ready.

Start AgentScope with reme start config=proactive_as. It shares the default of the two LLM jobs in demo, Bailian's Responses API at https://dashscope.aliyuncs.com/compatible-mode/v1 with qwen4-max. Set LLM_API_KEY for authentication and optionally REME_MODEL_NAME for the model. To use Bailian Anthropic Messages, run LLM_BASE_URL=https://dashscope.aliyuncs.com/apps/anthropic reme start config=proactive_as components.as_llm.proactive.backend=anthropic. Both protocols support hosted web_search. AgentScope runs without a sandbox by default, with Read, Glob, Grep, Edit, Write and Bash enabled. Read supports local images. Read-only queries and notification forks keep the read-only workspace tools. Remy defaults to xhigh effort and background agents to low. Native context compression uses a 0.6 trigger ratio and a 0.1 reserve ratio.

bash
# Terminal one
reme start config=proactive
# Terminal two
reme manage_proactive_runtime action=list
reme manage_proactive_runtime action=create agent_type=event agent_name=experiment_watch \
  task_description='Follow experiment logs. Report errors and completion; record normal progress.'

manage_proactive_runtime supports list/create/status/update/delete/query. All background tasks use the private run_proactive_agent Job. Configure preset initial_task, skills, job_tools and session options under components.agent_runtime. A Runtime creates TASK.md only when missing and reads the current document on each run. Dynamic creation accepts task_description, skills and job_tools; AgentManager applies runtime_defaults and checks allowed_job_tools. Trusted injected tool constraints are configured by the operator. Existing task files are preserved. Trigger type and session bindings are fixed after creation and retained on restoration. Dynamic settings remain in the workspace's per-task config.json. Management responses expose settings under config and execution through running; list returns items/total. Client Agent views remain available through list_agents and the session endpoints.

Creation requires agent_type=event or agent_type=time. Time-triggered tasks require a schedule Cron expression in the application timezone; event-triggered tasks have no schedule. Trigger type, skills and tool bindings are immutable after creation. Update accepts enabled, schedule, min_trigger_interval_seconds and notify_windows. Pause allows the current round to finish. Delete cancels execution and preserves files; restoring the same name retains its bindings and history. Use task_document action=read/save to edit TASK.md, and pass the read response's mtime as expected_mtime when saving.

notify_windows is a list of {start,end} periods in HH:MM, using the application timezone. The default is [{"start":"09:00","end":"12:00"},{"start":"14:00","end":"23:00"}]. Any matching period permits reminders; [] removes time restrictions. Starts are inclusive and ends exclusive. Overnight periods are supported; equal endpoints mean all day. This controls reminder processing and sending, independently of task execution. Existing task config.json files must use the same list field.

components.agent_runtime.Remy.initial_memory creates {reme_agent_dir}/Remy/MEMORY.md only when absent. Remy's notification_config sets the P0 delay (0 seconds), P1 idle threshold (10 seconds) and P2 idle threshold (1800 seconds). P0 can reach an active native foreground turn; P1/P2 wait for idle. The sender's enabled and notify_windows settings also apply.

Collection and Connector controls ​

After starting reme start config=proactive, call manage_connector through HTTP or MCP. Configured collectors and custom SSE subscriptions share one source catalog and stable source_id. Preset IDs are preset:<job-name>; custom subscriptions use source_<uuid>.

ActionInputs and behavior
listOnly action; returns a shared source view in items/total.
createname, nonempty runtime_names, binding: {url: "https://example.com/events"}. SSE/CloudEvents is fixed; no format or trigger_type parameter.
updatesource_id and any nonempty subset of name, runtime_names, enabled. Omitted fields are untouched; null patches are rejected.
sendruntime_names and nonempty events; returns per-target deliveries, rejected and errors.

runtime_names replaces the full target list; [] collects without delivering new events. Targets must exist, be event-triggered and be unique ignoring case. Pause with update enabled=false; resume with enabled=true. Names do not change identities. Saved batches retain original recipients and source display names; source gates remain independent of Runtime enabled settings.

json
{"action":"update","source_id":"preset:screen_capture_cron","name":"Project observations","enabled":false}

Collectors publish complete workspace resource packages before delivering Events. SSE GET endpoints return text/event-stream with one CloudEvents 1.0 JSON envelope per data field. Original JSON and the first reception time are retained under {resource_dir}/cloudevents; subscription definitions and delivery checkpoints live under {metadata_dir}/proactive/sources. Event identity is CloudEvents source + id. Changed content under the same identity is an error. Successful configuration does not confirm connection, delivery or processing. The shared view separates enabled, available, connected, pending_delivery_count and last_error. Invalid subscription definitions are reported per source without stopping other subscriptions or the service. Repair the original file and restart to load it. Manual subscription definition edits require a restart; updates refuse to overwrite unloaded edits.

Subscriptions reconnect with the committed Last-Event-ID after restart; replay depends on upstream support. Errors/rejections retain the pending event and block cursor advancement. HTTP 204 stops reconnect until explicitly resumed or restarted. SSE lines/events are limited to 1 MiB; custom authentication and provider-specific handshakes are not configured. Custom HTTP collectors continue to send workspace-relative Events through action=send; source=time is reserved. Time sources are projected from Runtime schedules. Studio assigns default icons by source type.

Reminder commits and recovery ​

Task EventInbox → NotificationOutbox → Remy NotificationInbox → decision fork → ChatOutbox → native user conversation. A round acknowledges inputs only after successful inference and validated output. With proactive-record, daily frontmatter contains reminder_priority (P0/P1/P2/skip) and reminder_message. The record skill asks the Agent to reread and correct its output before finishing. Model failure, timeout or invalid output removes this round's unchanged draft and preserves inputs for a fresh round. Once an input receipt is durable, reminder handoff can recover after restart without another model call.

Notifications either reference a daily record or contain an inline summary. Record references read priority and content from daily Markdown. Memory tasks use the private submit_summary tool to persist an inline P2 message directly in their Outbox, without creating a daily file. The same nonempty submission is idempotent within a round; a different submission is rejected. Queued summaries survive a later model failure and recover after restart. AgentReminder.id is the record path or inline notification ID; use it unchanged when reading reminder details. Receiver InboxReceipt owns send/skip processing facts, sender Outbox owns delivery facts, and ChatOutbox links native messages. read_at means Remy processed a reminder, not that the user read it. A read-only fork calls submit_chat_reply with action=send and content, or action=skip without content. Commit rechecks source versions, foreground activity, native session revisions and sender eligibility. ChatOutbox persists dispatching before calling the native writer. An uncertain native outcome keeps its notifications reserved, including after restart, until history confirms the original immutable message ID. An intention can be aborted for a new decision only before dispatch or after an explicit native guard or protocol rejection. An empty history read does not prove that a dispatched reply was rejected.

agent_manager_loop schedules tasks; chat_notifications_loop schedules reminders. Both are private BackgroundJobs. run_chat_agent, run_proactive_agent, process_chat_notifications, submit_chat_reply and submit_summary are private execution endpoints. The public ask_agent stream owns DONE. For tasks, pass the displayed run_id to ask about that run. By default the request selects the active run or latest committed run. After a successful commit, each question adds a read-only turn to the selected session. A failed or interrupted target returns an error.

Each Runtime binds ReMe skills by name. When Remy opens a primary session, it renders the bound built-ins in the configured language under {reme_agent_dir}/{agent_name}/skills/.generated/. The Runtime preserves a file edited in place and uses an available path for the next render. Queries in the same session reuse those files. Opening a new session renders them again. Closing the Runtime removes them. Background tasks own their generated files for one automatic execution and release them on completion, failure or cancellation. Read-only follow-ups and notification forks receive an empty ReMe skill list.

User-authored skills live at {reme_agent_dir}/{agent_name}/skills/{name}/SKILL.md. Keep the name and description in YAML frontmatter and any supporting files alongside the manifest.

Wrappers accept a list of {name, description, path} references. The system prompt lists only the selected ReMe skills with workspace-relative paths. An empty list omits the section. Codex, Claude Code and AgentScope manage their own native skill settings. Job tools are bound separately.

For a background task with proactive-record, ReMe renders the daily directory, output path, lookback window and search limit before opening the session.

The workflow selects the execution Jobs. The shared prompt loader is reme/utils/prompt.py; Runtime initialization does not inspect execution Steps. Per-run query and input templates belong to reme/steps/proactive/agent.yaml. Customize them through jobs.run_proactive_agent.steps[0].prompt_dict, using query, record_instruction, event_input and time_input or their _zh variants. Runtime prompt_dict configures role and initialization text. Notebook automatic-write constraints are injected through trusted Runtime configuration and checked by manage_notebook.

See components, workflows and configuration.

Proactive overview subscription ​

After starting reme start config=proactive, subscribe through HTTP POST /watch_proactive_overview with {} or {"agent_names":["proactive_memory"]}. The optional filter selects background Runtimes; shared Remy is included automatically. This read-only StreamJob does not run models, create native sessions, claim inputs or acknowledge reminders. Existing conversation and detail Jobs remain available.

Each StreamChunk of type data carries one of:

  • snapshot {epoch, revision, as_of, overview}: replace all six sections: sources, agents, event_inbox, remy_inbox, reminders and workspace; errors isolates unavailable facts.
  • update {epoch, previous_revision, revision, as_of, changes, transitions}: replace/remove entities by collection and business identity; a null change value removes an entity. Transitions have stable IDs and link successful admissions, batch claims, record commits, notification deliveries and final messages.
  • heartbeat: transport liveness, normally every 15 seconds. Errors and termination use the usual StreamChunk error and done contract.

Every connection starts with an authoritative snapshot. A reader that falls behind the bounded journal also receives a new snapshot. Apply updates only when their epoch and previous revision match; reconnect on a gap. The watermark precedes the read, so changes during snapshot assembly remain available in subsequent updates. Never animate snapshot history, and deduplicate live transition IDs. The shared Studio client provides watchProactiveOverview and ProactiveOverviewModel, including reconnect, version checks and reduced-motion support. Subscriptions share bounded read projections. Durable owner changes and execution activity invalidate them; external file edits are checked within about five seconds. Agent waiting_reason, waiting_until and retry_at use the scheduler's own eligibility decision. Current runs include tool and turn identity; waiting state is not duplicated in runs.

Inbox waiting and processing counts are disjoint. The admission envelope stores admission time and the source snapshot separately from the original Event. Committed receipts retain input/source/run/file provenance, including records that produce no reminder. Final reminders include only sent native messages; transport delivery, Remy processing and user reading remain distinct. Workspace entries are original relative file references; content and editing use existing file Jobs. See the public models. Reminder queries separate created_at from confirmed delivered_at; an unconfirmed delivery time stays null. delivery describes the sender, remy_processing describes the receiver, and its state is null before admission. Configured source targets follow the current definition; historical events retain their source snapshots without restoring removed connections. Workspace entries include configured locations, each task's three latest delivery records, current/latest run outputs, and files referenced by recent lists. Historical deliveries are not all added to the workspace; use existing detail and paging Jobs for full history.

MCP ​

ReMe 0.4.2.2 uses FastMCP 4 and MCP Python SDK 2. Upgrade ReMe and host-side MCP bridges together; standalone bridge environments require fastmcp>=4.1.4,<5. CLI tool catalogs use SDK 2 snake_case fields, including input_schema, output_schema, and annotation hints.

The default HTTP service mounts streamable HTTP MCP at /mcp:

yaml
service:
  backend: http
  mcp_enabled: true
  mcp_path: /mcp
  mcp_stateless_http: false

For a standalone MCP service:

bash
reme start service.backend=mcp service.transport=stdio
reme start service.backend=mcp service.transport=sse service.port=2333
reme start service.backend=mcp service.transport=streamable-http service.port=2333

MCP tools come from non-stream Jobs with enable_serve: true. Use service.jobs as an allowlist. injected_job_kwargs adds server-managed values that callers cannot override.

yaml
service:
  backend: http
  jobs: [search, read, traverse, auto_memory]
  injected_job_kwargs:
    tenant_id: local-user
  tool_error_on_failure: true

ReMe Studio ​

Install reme-ai[core] and run reme start config=proactive to serve Studio:

text
http://127.0.0.1:2333/

Disable it with service.web_enabled=false or select a build with service.web_static_dir. Missing static assets do not prevent the Job API from starting.

Backend settings ​

Run reme start config=setup to open Studio before configuring a model. In a second terminal, run reme get_launch_config to inspect the current launch. Studio can select Codex (proactive), Claude Code (proactive_cc), AgentScope (proactive_as), or a server-side config file.

The supervisor reads the first project .env once at cold start. System environment values take precedence over the file. Each restart rereads YAML, expands it against that initial environment plus the submitted overrides, and applies the explicit CLI arguments. Store durable changes in your launch command, YAML or deployment environment. Studio overrides last for this supervisor session.

POST /get_launch_config returns the complete restart input in answer. Its metadata contains the current run_id, editable environment field types and credential presence. POST /restart_service accepts both required objects. For example:

json
{"cli_args":{"config":"proactive","workspace_dir":"/data/reme"},"env":{"LLM_BASE_URL":"https://provider.example/v1"}}

Studio converts form fields into CLI and environment overrides. For a custom server-side YAML file, use the complete CLI arguments editor to configure its components. ReMe applies the normal YAML and CLI merge rules, including the enabled flags for speech jobs. Studio unlocks through get_launch_config and checks restart readiness independently of the configured jobs.

Include every override you intend to keep. Omitting an env override restores the cold-start value. A secret override can be retained with {"keep":true} or replaced with a new value. Include If-Match with the current run ID to detect stale edits. HTTP 202 acknowledges a restart. Studio polls GET /health_check with the acknowledged run ID in If-Match. Once the worker has started, it returns the matching ID. A stale or missing ID returns HTTP 412. This probe works across a port change without forwarding the API token. The detailed POST /health_check job uses the normal instance access policy.

The ReMe child serves Studio and jobs directly. Restarting briefly interrupts the listener. If startup fails after validation, consult the service logs and relaunch. Both routes use the HTTP service’s instance authentication. Agent tools cannot invoke either operation.

When a proxy terminates HTTPS, preserve the public Host and set X-Forwarded-Proto: https. Enable service.proxy_headers=true and restrict service.forwarded_allow_ips to trusted proxy IPs or CIDRs. Use * only when the listener is reachable exclusively through trusted proxies.

For a private ModelScope Studio or Hugging Face Space, follow the cloud deployment guide.

Notebook projects ​

Start the service with reme start config=proactive, then run these commands in another terminal.

bash
reme manage_notebook action=list_projects
reme manage_notebook kind=todo action=list project=ReMe scope=all
reme manage_notebook kind=idea action=list project=ReMe scope=all

manage_notebook action=list_projects lists projects from both Todo and Idea records. The result includes total and items, with project, todo_count, and idea_count in each item. The default scope=all includes active and archived records. Set scope=active or scope=archive to count records in that scope. Use the returned project name to list its Todo or Idea records.

New Todos default to pending. Use in_progress once work starts and closed when it finishes or is cancelled. A closed Todo is archived. Pass close_note with status=closed to record the outcome or reason. Reopening clears the closure time and note.

Active Todos are ordered by target date by default. Use reme manage_notebook kind=todo action=list order=created for newest creation time first, with older records that lack a creation time at the end. Studio offers both orders in the Todos view.

The event-triggered proactive_note runtime receives the same new Codex and Claude Code dialogue as proactive_memory. It loads manage-notebook to find related Todos and Ideas and read the full progress history before updating a Todo. It adds new progress, corrects or removes individual notes when the evidence changes, and can move a Todo to in_progress. Remy handles creation, closure, Idea updates, link changes, and other follow-up through the standard reminder inbox. Each follow-up is one plain-language Markdown bullet with the record, evidence, and next step.

One-shot Jobs ​

bash
reme start job=search query="user preferences" limit=5

This selects the one-shot CLI Service while retaining the normal Application, Component, and Job lifecycle.

Service discovery ​

bash
reme find_reme

Ordinary reme <action> commands prefer the running service's actual backend, host, port, and transport. They fall back to local configuration only when no service is discovered.

Security boundary ​

The HTTP service binds to 127.0.0.1 by default. Set REME_API_TOKEN in the environment or in .env to enable instance authentication. The process environment takes precedence. An unset or whitespace-only token disables this check, including for restart. To rotate the token, change the secret and restart the entire service.

Without a token, API clients can use localhost, a loopback IP, or the configured listener hostname or IP. Wildcard listeners (0.0.0.0 and ::) also accept IP addresses on the network. Set REME_API_TOKEN when clients use another hostname, including a public proxy domain or a Docker Compose service name.

When authentication is enabled, HTTP clients send the token in X-ReMe-API-Token for Jobs, SSE, launch settings, restart, health checks, OpenAPI and public MCP. A missing or incorrect token returns HTTP 401. The standalone MCP service also checks this header on its network transports. Studio loads its sign-in page and remembers the token for that endpoint in the current browser tab.

Codex supplies its own session credential automatically when calling internal tools. Local MCP over stdio requires no API token.

Serve the Web UI and API on the same origin. For remote access, use HTTPS and restrict the platform ingress or enable the instance token. Jobs can read and modify workspace files. Limit exposed Jobs with service.jobs.

OpenAPI ​

FastAPI exposes the active endpoints through /docs, /redoc, and /openapi.json. The Studio SPA fallback preserves these reserved paths.

Released under the Apache-2.0 License.