agentleFS
agentscope-aiagentscope-ai/ReMe/AGENTS.md

ReMe

AGENTS.md3.6k starsChanged 3 months agoApache-2.0View on GitHub

This file guides coding agents working in the ReMe repository. Keep changes small, testable, and consistent with the contracts expressed by the current code. ReMe is a local-first, file-native memory system for agents. When convenience conflicts with these principles, favor data ownership, recoverability, and explicit behavior. Use this order when documentation and implementation disagree: Do not duplicate large implementation descriptions in documentation. Express the stable contract and link to the relevant module where useful. When behavior changes intentionally, update the…

  • Reads credentials
  • Installs packages

Trending

Quiet since September.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 11 mentionsApr 2026: 3 mentionsMay 2026: 1 mentionJun 2026: 1 mentionJul 2026: 2 mentionsAug 2026: 1 mentionSep 2026: 4 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the agentscope-ai/ReMe repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about agentscope-ai/ReMe

The biggest 5 of 23 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 23

Talked about on GitHub and Bluesky (23 times).

On GitHub · 21

16 more on GitHub
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository6 other files it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

20 rules. About 0 are common, 15 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Prefer transparent formats and predictable behavior over hidden state.

    line 12
  2. Distinctive:

    Keep concepts focused on project intent.

    line 14
  3. Distinctive:

    When convenience conflicts with these principles, favor data ownership, recoverability, and explicit behavior.

    line 16
  4. Distinctive:

    Use this order when documentation and implementation disagree:

    line 20
  5. Distinctive:

    Do not duplicate large implementation descriptions in documentation.

    line 27
  6. Distinctive:

    Before changing behavior, inspect the adjacent implementation, schema, built-in config, and focused tests.

    line 75
  7. Distinctive:

    If startup fails, already-started resources are closed.

    line 114
  8. Distinctive:

    Keep async clients, tasks, executors, and services under this lifecycle.

    line 118
  9. Distinctive:

    Treat Step instances as invocation-scoped:

    line 127
  10. Very specific:

    Use narrow, namespaced keys in app_context.metadata and protect shared mutable values against concurrent access.

    line 139
  11. Distinctive:

    Do not bypass the existing file steps or stores in a way that weakens workspace containment.

    line 164
  12. Very specific:

    Never write test state into the repository's .reme/.

    line 165
  13. Distinctive:

    Do not delete or rewrite user memory to repair an index or make a test pass.

    line 166
  14. Distinctive:

    Use the narrowest useful check while iterating, then broaden it according to risk.

    line 171
  15. Very specific:

    If documentation or the documentation theme changes, run npm test and npm run build from github-pages/.

    line 199
  16. Very specific:

    Do not edit generated output when the source can be changed instead.

    line 206
  17. Distinctive:

    Do not silently change CLI flags, configuration keys, workspace layouts, serialized schemas, endpoint shapes, streaming termination, or …

    line 209
  18. Distinctive:

    Do not introduce dependencies without a concrete repository-level need.

    line 212
  19. Very specific:

    Do not commit .env files, credentials, runtime memory, logs, indexes, caches, benchmark outputs, or generated Studio distributions.

    line 213
  20. Distinctive:

    If a requirement is ambiguous, infer intent from nearby code, schemas, defaults, and tests.

    line 217

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

This file guides coding agents working in the ReMe repository. Keep changes small, testable, and consistent with the contracts expressed by the current code.

Project Principles

ReMe is a local-first, file-native memory system for agents.

  • User-owned workspace files are the durable source of truth.
  • Indexes, catalogs, graphs, caches, and generated metadata must remain rebuildable.
  • Prefer transparent formats and predictable behavior over hidden state.
  • Preserve user control over workspace paths, configuration, and service boundaries.
  • Keep concepts focused on project intent; let code and schemas describe implementation.

When convenience conflicts with these principles, favor data ownership, recoverability, and explicit behavior.

Sources of Truth

Use this order when documentation and implementation disagree:

  1. Current code and public Pydantic schemas.
  2. Tests that describe supported behavior.
  3. CLI behavior and the built-in configuration.
  4. README files and other development documentation.

Do not duplicate large implementation descriptions in documentation. Express the stable contract and link to the relevant module where useful. When behavior changes intentionally, update the implementation, schemas, tests, defaults, and concise documentation together.

Repository Map

  • reme/reme.py: CLI entry point; dispatches start, find_reme, and client calls.
  • reme/application.py: application assembly, dependency ordering, job execution, and lifecycle.
  • reme/config/config_parser.py: YAML/JSON loading, environment expansion, dot-notation parsing, and deep config merging.
  • reme/config/default.yaml: default service, jobs, steps, and components. Other files in reme/config/ are named configuration variants.
  • reme/schema/application_config.py: typed application, component, and job configuration.
  • reme/schema/: request, response, streaming, memory, graph, and file contracts.
  • reme/components/application_context.py: application-wide wiring and in-memory shared state.
  • reme/components/runtime_context.py: request-scoped data, response, streaming queue, and stop event.
  • reme/components/base_component.py: component lifecycle, dependency binding, and workspace helpers.
  • reme/components/component_registry.py: the frozen built-in registry template and application-local registry factory.
  • reme/components/job/: base, stream, background, and cron job implementations.
  • reme/components/service/: local CLI, HTTP, and MCP service backends.
  • reme/components/: agent wrappers, model adapters, stores, catalogs, graphs, indexes, clients, tokenizers, and outbound proxies.
  • reme/steps/: registered job steps grouped by common, file I/O, index, evolve, cookbook, and transfer concerns.
  • reme/utils/: shared utilities, including service discovery, logging, web-static resolution, session I/O, token accounting, and wikilink handling.
  • tests/unit/: primary fast, isolated validation suite.
  • tests/integration/: service/model tests that may need credentials or external processes.
  • reme_studio/: ReMe Studio frontend source plus the independently published reme_studio Python package and @agentscope-ai/reme_studio npm static distribution.
  • plugins/: installable ReMe extensions, including Auto Fin and LME/BEAM plugins.
  • integrations/: adapters that connect ReMe to external agent hosts, including the independent, self-contained DSH and OpenClaw TypeScript plugins plus the Claude Code and Hermes Agent integrations.
  • skills/: standalone skills; reme_memory calls ReMe, while other skills may use separate tools or direct-file conventions.
  • benchmark/ and cookbook/: runnable evaluations and example workflows.
  • docs/: README-linked supporting pages and figures.
  • github-pages/: VitePress build shell, generated-content assembly, documentation checks, and GitHub Pages output. The canonical theme and guides remain under docs/; .generated/ and dist/ are disposable.

Development Setup

ReMe requires Python 3.11 or newer. Install the editable development environment with:

pip install -e reme_studio -e ".[dev,core]"

Before changing behavior, inspect the adjacent implementation, schema, built-in config, and focused tests. Follow existing async and typing patterns unless the task explicitly requires a new contract.

Configuration and CLI Contracts

  • CLI syntax is reme ACTION key=value ...; leading - or -- on arguments is accepted.
  • Nested overrides use dot notation. Values support null, booleans, numbers, JSON collections, and quoted JSON strings; leading-zero numeric-looking values remain strings.
  • config=<name-or-path> loads a discovered config name or a .yaml, .yml, or .json file. With no explicit config path, default is loaded when available.
  • Config files expand ${VAR} and ${VAR:-default} recursively. An undefined variable without a default is an error.
  • CLI/config overrides are deep-merged over the loaded file. Do not silently change this merge behavior or stable configuration keys.
  • ApplicationConfig normalizes workspace_dir to an expanded absolute path. session_dir must remain workspace-relative; standard transcripts live under {session_dir}/dialog.
  • reme start runs the configured service. reme start job=<name> ... switches to the one-shot CLI service and runs the job through the normal application lifecycle.
  • Other actions use a client selected from the running service configuration when discoverable, otherwise from local config. Client-selection arguments must not leak into the job payload.

Registration and Application Lifecycle

Component and Step discovery is import-driven:

  • Implementations declare a non-BASE component_type and register with @R.register("backend") or R.register(Class, "backend").
  • Component packages must be imported through reme/components/__init__.py.
  • Step packages/modules must be reachable through their package __init__.py chain and ultimately reme/steps/__init__.py.
  • Adding an implementation without its registration import leaves it undiscoverable at runtime. Treat implementation, registration, import side effect, defaults, and tests as one change.

Application validates config through ApplicationContext, creates workspace directories, instantiates the service, configured components, and jobs, and then manages lifecycle as follows:

  • Components start in topological dependency order. Missing required dependencies and cycles fail explicitly; optional dependencies may resolve to None.
  • Jobs start after components in this order: base jobs, stream jobs, background jobs, then cron jobs.
  • Shutdown closes everything in reverse start order and then shuts down the optional thread pool.
  • If startup fails, already-started resources are closed.
  • BaseComponent.start() and close() are lock-protected and idempotent. Dependencies created by a standalone default_factory are owned and closed by the parent component.

Keep async clients, tasks, executors, and services under this lifecycle. Do not introduce an untracked long-lived resource.

Jobs, Steps, and State

BaseJob resolves configured Step classes during job startup and constructs fresh Step instances for every invocation. Job-level kwargs are merged into each RuntimeContext, with call-time kwargs taking precedence. Sequential Steps in one invocation share the same RuntimeContext and Response.

Treat Step instances as invocation-scoped:

  • Constructor fields and self.kwargs hold Step configuration and resolved dependencies. They may be cached or adjusted during that one invocation, but must not be relied on across Job calls.
  • self.context.data holds request inputs and intermediate values shared by sequential Steps.
  • self.context.response.answer, success, and metadata are request-scoped output. Because the same response travels through the Step chain, later Steps may consume metadata produced earlier, but it is not application-lifetime or durable storage.
  • self.app_context.metadata holds in-memory state shared across Job/Step invocations for the life of one Application, such as counters, tool-context state, session maps, or locks.
  • Workspace files or a dedicated Component/store hold durable state that must survive restart.

Use narrow, namespaced keys in app_context.metadata and protect shared mutable values against concurrent access. The search/draft helpers intentionally mirror tool-context state into self.kwargs only when no ApplicationContext exists for standalone use and unit tests; do not generalize that compatibility fallback into persistent runtime state. If shared state becomes a stable service contract or needs dedicated lifecycle, locking, or persistence, promote it to a typed context field or Component.

Additional Step contracts:

  • Ref dependencies resolve in this order: Step kwargs, current RuntimeContext, then the named application component. The value is cached only on the current Step instance and cleared before each call.
  • input_mapping and output_mapping copy keys within RuntimeContext.data; missing sources are ignored.
  • Dispatched Steps receive the current RuntimeContext, so their data and response are shared.
  • Base jobs convert uncaught Step errors into Response(success=False); stream jobs emit an error chunk and always a terminal DONE; background jobs let errors reach their supervisor.
  • Background jobs are never service-exposed. MCP also skips stream jobs. Respect enable_serve and any configured service job allowlist.

Workspace and File Safety

  • Application startup creates the workspace plus configured metadata, session, memory-session, resource, daily, and digest directories.
  • File-operation paths are resolved against the workspace and must stay inside it. Home-relative paths are unsupported, traversal escapes are rejected, and _allowed_paths restrictions fail closed when invalid.
  • Preserve per-path locking, encoding detection, byte limits, truncation behavior, and optimistic expected_mtime checks when modifying file operations.
  • Do not bypass the existing file steps or stores in a way that weakens workspace containment.
  • Never write test state into the repository's .reme/; use tmp_path or another isolated workspace.
  • Do not delete or rewrite user memory to repair an index or make a test pass. Rebuild derived state from source files instead.

Validation

Use the narrowest useful check while iterating, then broaden it according to risk.

Focused test:

pytest tests/unit/path/to/test_file.py -v

Main unit suite:

pytest tests/unit -v --tb=long -s --log-cli-level=WARNING

Repository formatting and lint checks:

pre-commit run --all-files

Black and Flake8 use a 120-character line limit and Python 3.11 formatting; Pylint is also run by pre-commit. If reme_studio/ changes, use its Node 22.13+ scripts and run the proportionate checks from that directory, such as npm run format:check, npm run lint, or npm test.

Integration tests may contact real model providers, services, or agent subprocesses and can require credentials. Do not run credentialed or externally mutating tests automatically; run them only when the task requires them and the necessary environment has been supplied or authorized. Mock network, model, and subprocess boundaries in unit tests.

If documentation or the documentation theme changes, run npm test and npm run build from github-pages/. The Job reference is generated from reme/config/default.yaml; do not edit generated pages directly.

Change Guardrails

  • Preserve unrelated user changes in a dirty working tree.
  • Make the smallest coherent change and avoid unrelated cleanup or broad refactors.
  • Do not edit generated output when the source can be changed instead. The publish workflow builds reme_studio/dist-static and stages it under reme_studio/src/reme_studio/static; change reme_studio/ source for frontend work.
  • Do not silently change CLI flags, configuration keys, workspace layouts, serialized schemas, endpoint shapes, streaming termination, or service interfaces. Preserve compatibility where practical and document intentional migrations.
  • Do not introduce dependencies without a concrete repository-level need.
  • Do not commit .env files, credentials, runtime memory, logs, indexes, caches, benchmark outputs, or generated Studio distributions.
  • State which validations passed and which relevant checks were not run in the final handoff.

If a requirement is ambiguous, infer intent from nearby code, schemas, defaults, and tests. Ask the user only when the remaining choice would materially alter a public contract, user data, or an external system.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.