Find a file
jinliyl cf22ef3b1d
feat: add codex auth modes, background embedding/index repair, and qwenpaw logging (#371)
* feat(codex): add authentication mode support with thread-safe logging

- Implement _CodexAuthConfig dataclass for resolved auth settings
- Add auth_mode parameter with auto/api_key/oauth options
- Separate API key and OAuth authentication flows
- Force specific login method based on auth mode
- Add explicit API key validation requirement
- Serialize concurrent logger initialization in thread lock
- Close logging handlers properly during cleanup
- Update default config with auth_mode presets for codex and codex_oauth
- Add comprehensive tests for authentication modes and concurrent logging

* feat(file_store): implement background embedding backfill and keyword index repair

- Add _after_embedding_backfill hook in FAISS local file store
- Schedule startup embedding repair without delaying component readiness
- Cancel and collect embedding backfill task during component shutdown
- Log progress at fixed percentage boundaries for long-running operations
- Process embedding backfill in configurable batch sizes with progress reporting
- Rebuild keyword index in bounded batches with detailed mismatch diagnostics
- Format stdlib logs consistently with QwenPaw console output using relative paths
- Run embedding backfill as background task that doesn't block component startup
- Add comprehensive tests for background embedding and keyword index repair scenarios

* fix(file-store): repair graph-chunk consistency on load

- Add _repair_graph_chunk_consistency method to detect and fix mismatched graph/chunk states
- Clear torn graph/chunk state when missing or orphaned chunks are detected
- Ensure keyword index sync handles empty chunks properly
- Add comprehensive tests for graph-chunk consistency scenarios
- Update test utilities to properly seed graph/chunk snapshots
- Increment version to 0.4.1.2

* feat(file_io): enhance list step response format and add comprehensive logging

- Format list output with bullet points for better readability
- Add explicit "No files found" message when directory is empty
- Include detailed timing information for file store startup phases
- Add logging for chunk loading, graph consistency checks, and keyword indexing
- Provide detailed metrics for embedding backfill operations
- Add comprehensive test coverage for empty directory scenarios
- Include batch processing statistics for embedding operations

* feat(logger): add QwenPaw logging integration with forwarding mechanism

- Introduce _ForwardToLoggerHandler to forward log records to target logger
- Add qwenpaw logger integration that forwards ReMe logs to QwenPaw handlers
- Maintain ReMe logger stability for modules that cache it at import time
- Enable QwenPaw handlers to take effect without ReMe reconfiguration
- Add comprehensive tests for stdlib forwarding to QwenPaw sinks
- Support explicit REME_DISABLE_LOGURU=false to keep original Loguru backend
- Preserve existing logging behavior when QwenPaw is not configured

* fix(file_store): serialize concurrent FAISS dump operations to prevent corruption

- Add asyncio lock to ensure only one FAISS dump operation runs at a time
- Generate unique temporary filenames using UUID tokens for atomic replacement
- Implement proper cleanup of temporary files in finally block
- Add comprehensive test to verify concurrent dumps are serialized
- Ensure atomic writes by replacing both index and idmap files together
- Prevent partial state writes during concurrent access scenarios
2026-07-20 14:47:34 +08:00
.github/workflows feat(benchmark): add LongMemEval golden answer validation (#335) 2026-07-13 21:26:27 +08:00
benchmark/longmemeval chore(benchmark): remove longmemeval final answer review file (#366) 2026-07-16 20:32:28 +08:00
docs docs: add comprehensive documentation for auto-dream, auto-link, and auto-resource flows (#343) 2026-07-14 15:34:15 +08:00
plugins feat(plugins): add Hermes Agent memory provider (#365) 2026-07-17 14:06:12 +08:00
reme feat: add codex auth modes, background embedding/index repair, and qwenpaw logging (#371) 2026-07-20 14:47:34 +08:00
skills feat: add Claude Code plugin with auto-memory functionality (#297) 2026-06-26 14:46:42 +08:00
tests feat: add codex auth modes, background embedding/index repair, and qwenpaw logging (#371) 2026-07-20 14:47:34 +08:00
.gitignore feat(benchmark): add lme benchmark steps (#326) 2026-07-07 18:53:39 +09:00
.pre-commit-config.yaml feat(benchmark): add lme benchmark steps (#326) 2026-07-07 18:53:39 +09:00
AGENTS.md docs: add comprehensive documentation for auto-dream, auto-link, and auto-resource flows (#343) 2026-07-14 15:34:15 +08:00
CLAUDE.md docs: restructure documentation and update content organization (#339) 2026-07-13 16:50:46 +08:00
example.env init: reme version 0.4.0 (#284) 2026-06-22 15:41:19 +08:00
LICENSE feat(reme_ai): implement memory retrieval and merging functionality 2025-08-25 16:10:53 +08:00
pyproject.toml feat(agent): add Codex agent wrapper and ReMe MCP bridge (#358) 2026-07-17 13:39:18 +08:00
README.md feat(core): add shell execution and runtime memory status (#344) 2026-07-14 16:31:41 +08:00
README_ZH.md feat(core): add shell execution and runtime memory status (#344) 2026-07-14 16:31:41 +08:00

ReMe Logo

Python Version PyPI Version PyPI Downloads GitHub commit activity License English 简体中文 GitHub Stars DeepWiki

agentscope-ai%2FReMe | Trendshift

An agent memory layer that turns conversations and resources into readable, editable, searchable Markdown memory.

Previous versions: 0.3.x · 0.2.x · MemoryScope

🧠 ReMe is a local-first memory layer for AI agents. It turns conversations and resources into file-based long-term memory, then continuously indexes, links, and consolidates that memory for future recall.

Core Ideas

  • Memory as File: Markdown files with frontmatter and wikilinks serve as memory nodes that both users and agents can read and write directly.
  • Self-evolving knowledge base: Auto Memory, Auto Resource, and Auto Dream progressively transform conversations and resources into long-term memories, while automatically building wikilink relationships.
  • Progressive hybrid search: ReMe combines wikilinks, BM25, and embeddings for hybrid retrieval across keyword matching, semantic recall, and relationship expansion.
  • Agent-friendly integration: SKILL.md + CLI integration makes it easy for different agents to read, write, maintain, and reuse memory.

ReMe Design Philosophy

🔭 Use Cases

  • Personal assistants: Give personal assistants such as QwenPaw, OpenClaw, and Hermes a user-editable long-term memory layer.
  • Coding agents: Preserve coding style, project background, repository decisions, and workflow experience across sessions when integrating with coding agents such as Claude Code.
  • LLM Wiki: Turn conversations, notes, and resources into a searchable, traceable, and linked Markdown knowledge base that both users and agents can maintain.
  • Self-evolving agents: Support agents that learn from experience by saving successful paths, failed attempts, reusable procedures, and periodic reflections as memory.

📰 News

🚀 Quick Start

Installation

ReMe requires Python 3.11+.

Install from pip:

pip install "reme-ai[core]"

Install from source:

git clone https://github.com/agentscope-ai/ReMe.git
cd ReMe
pip install -e ".[core]"

Environment Variables

Configure environment variables when you want LLM-powered memory evolution or embedding retrieval. Embeddings are disabled by default, so the default setup does not start an embedding model or require an embedding API key.

cat > .env <<'EOF'
# Optional: used only after embedding components are explicitly enabled in the config.
# EMBEDDING_API_KEY=sk-xxx
# EMBEDDING_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1

# Required for auto_memory, auto_resource, and auto_dream.
LLM_API_KEY=sk-xxx
LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
EOF

Basic file operations, BM25 search, wikilink traversal, and reading proactive topics can run without LLM credentials.

Note

To enable embedding-based semantic retrieval, uncomment components.as_embedding and components.embedding_store in reme/config/default.yaml, then change components.file_store.default.embedding_store from "" to default. See the memory search guide for details.

Start the Service

reme start

The default service address is 127.0.0.1:2333. If the port is occupied, specify another port:

reme start service.port=8181
# reme start workspace_dir=/tmp/reme-demo service.port=8181

After startup, check the service status. If you use a custom port, replace 2333 in the URL below with that port.

reme version
curl -s http://127.0.0.1:2333/version -H 'Content-Type: application/json' -d '{}'

5-Minute Memory Demo

With the service running, write a memory node, let ReMe index it, then retrieve it:

reme write \
  path=digest/wiki/quick-start-demo \
  name="Quick Start Demo" \
  description="A first ReMe memory node" \
  content="# Quick Start Demo

ReMe stores agent memory as readable Markdown.

Related: [[digest/wiki/memory-as-file.md]]"

reme search query="agent memory markdown" limit=5
reme read path=digest/wiki/quick-start-demo start_line=1 end_line=20

The generated file is ordinary Markdown with frontmatter:

---
name: Quick Start Demo
description: A first ReMe memory node
---

# Quick Start Demo

ReMe stores agent memory as readable Markdown.

Related: [[digest/wiki/memory-as-file.md]]

📁 Memory System

Memory as File, File as Memory.

ReMe treats memory as files, progressively processing raw conversations and external resources from session/ and resource/ into daily/, then consolidating them into reusable long-term memory nodes under digest/.

Directory Structure

<workspace_dir>/
├── metadata/       # Persistent system state such as indexes, graphs, and catalogs
├── session/        # Raw conversations and agent sessions
│   ├── dialog/
│   │   └── <session_id>.jsonl
│   ├── agentscope/
│   └── claude_code/
├── resource/            # External raw materials
│   └── YYYY-MM-DD/
│       └── <resource>.<ext>
├── daily/               # Lightly processed memory: daily facts, conversation summaries, resource readings
│   ├── YYYY-MM-DD.md
│   └── YYYY-MM-DD/
│       ├── <session_event>.md
│       ├── <resource_stem>.md
│       └── interests.yaml
└── digest/              # Long-term memory: personal facts, procedural experience, knowledge nodes
    ├── personal/
    │   └── {topic/event}.md
    ├── procedure/
    │   └── {topic/event}.md
    └── wiki/
        └── {topic/event}.md

ReMe file-based memory system overview

🧭 Memory Design Philosophy

Capture raw dialogs and resources, refine them into long-term preferences, reusable experience, and valuable knowledge, while keeping the result editable by humans and agents.

Automatic Memory Flow

ReMe follows a capture → index → consolidate → recall loop. Conversations and resources first become daily memory cards; background jobs keep files searchable; auto_dream distills stable knowledge into digest/; agents recall memory through search, wikilinks, or proactive topics.

Capability Entry point What it does Output
auto_memory Agent hook or reme auto_memory Distills useful conversation facts while preserving the raw session. session/dialog/*.jsonl, daily/<date>/<session>.md
auto_resource Resource watcher or reme auto_resource Turns files under resource/<date>/ into source-linked daily cards. daily/<date>/<resource-card>.md
auto_index Background watcher or reme reindex Maintains chunks, the BM25 index, the wikilink graph, and the optional embedding index. Searchable daily/, digest/, and resource/ content
auto_dream dream_cron or reme auto_dream Consolidates changed daily cards into long-term personal, procedure, and wiki memory. digest/**, daily/<date>/interests.yaml
proactive reme proactive before an agent decides to act Reads topics generated by auto_dream; the host agent decides whether and how to mention them. Structured topics from daily/<date>/interests.yaml
Memory as File Auto Memory and Resource
Auto Dream and Proactive Auto Index and Memory Search

🤝 Agent-friendly Integration

ReMe runs as a local memory service and offers multiple integration paths: CLI, HTTP API, MCP server, and SDK. Different agents can choose the path that fits their runtime while sharing the same local memory workspace.

Agents Recommended path What works out of the box
QwenPaw Embed ReMe via the Python SDK. Reuse the app's own lifecycle and model config while keeping memory local and file-based.
Claude Code Start ReMe as an MCP service and install plugins/reme. MCP recall tools, a reme-memory skill, and a Stop hook that records sessions automatically.
Other CLI-capable agents (OpenClaw/Hermes/Codex) Copy or install skills/reme_memory/SKILL.md. Search/read/write memory and call auto_memory, auto_dream, and proactive via the CLI.

Integration demos

Auto Memory Auto Dream
QwenPaw QwenPaw Auto Memory demo QwenPaw Auto Dream demo
Claude Code Claude Code Auto Memory demo Claude Code Auto Dream demo

🛠️ ReMe Operations

ReMe operates the workspace through a unified job interface exposed by the CLI. Agents usually only need retrieval, reading, writing, editing, and automatic memory commands. Lower-level indexing, frontmatter, and file operation commands are mainly for maintenance, debugging, or advanced integration. Run reme help for the full job list.

Command Purpose
reme start Start the local ReMe service.
reme version / reme health_check Check package and component status.
reme status Show stateful data-component memory estimates and process RSS.
reme search Retrieve memory with BM25 and wikilinks by default, plus vectors when enabled.
reme read / reme write / reme edit Inspect and maintain Markdown memory files.
reme auto_memory Turn conversation messages into daily memory cards. Requires LLM credentials.
reme auto_resource Interpret files under resource/ into daily resource cards. Requires LLM credentials.
reme auto_dream / reme proactive Consolidate daily memory into long-term digest and surface topics worth attention.
reme reindex Rebuild search and wikilink indexes from existing files.

🤝 Community and Support

  • Issues and requests: Check Open Issues first. If there is no related discussion, open a new issue with background, expected behavior, and impact scope.
  • Code contributions: Before making changes, read the contribution guide. Source, schemas, and tests are the authoritative architecture and extension guide.
  • Documentation contributions: Submit user-facing documentation changes to the unified documentation repository under reme/<version>/{en,zh}/.
  • Commit convention: Conventional Commits are recommended, for example feat(search): add link expansion option or docs(zh): update quick start.
  • Pre-submit checks: Before submitting a PR, try to run pre-commit run --all-files and pytest. If tests that depend on LLMs, embeddings, or external services cannot run, explain that in the PR.
  • Get help: Use GitHub Issues for bugs and feature requests. Project documentation is available at https://docs.agentscope.io/.

Contributors

Thanks to everyone who has contributed to ReMe:

Contributors

📄 Citation

@software{ReMe2026,
  title = {Remember me, Refine me: Memory Management Kit for Agents},
  author = {ReMe Team},
  url = {https://reme.agentscope.io},
  year = {2026}
}

⚖️ License

This project is open source under the Apache License 2.0. See LICENSE for details.