agentscope-ai/ReMe

feat: support horizontal scaling / cluster deployment for production

开放

#386 创建于 2026年7月22日

 (1 条评论) (0 个反应) (0 位负责人)Python (256 个派生)github user discovery
help wanted

仓库指标

星标
 (3,051 个星标)
PR 合并指标
 (平均合并 17小时 48分钟) (30 天内合并 44 个 PR)

描述

Feature Request: Horizontal Scaling / Cluster Deployment Support

Is your feature request related to a problem?

Yes. ReMe is designed as a local-first, single-instance application. While this works great for personal/single-agent use cases, it becomes a bottleneck when deploying ReMe as a shared memory service in production environments (e.g., Kubernetes / cloud VM clusters) that require horizontal scaling.

Currently, running multiple ReMe replicas causes three critical problems:

  1. Index inconsistency: Each replica holds its own in-memory FAISS vector index and BM25 keyword index. Search results differ across replicas, and new replicas need time to rebuild indexes on startup.

  2. Duplicate background task execution: The 3 background watch jobs (index_update_loop, resource_watch_loop, digest_watch_loop) and the cron job (dream_cron) run on every replica, causing duplicate file writes and potential race conditions on the shared workspace.

  3. No built-in authentication: The HTTP service has no API key or token validation. Anyone who can reach the port can read/write/delete all workspace files and trigger LLM calls (costing API quota). Production deployment requires at least an API key middleware.

These limitations force production deployments to a single instance, preventing horizontal scaling under high load.

Describe the solution you'd like

1. External index backends (pluggable)

The component architecture is already well-designed with abstract base classes (BaseKeywordIndex, BaseEmbeddingStore, BaseFileStore) and the @R.register() registry. We'd like official backend implementations for:

Component Current (local) Requested (external)
Keyword index BM25Index (in-memory + pickle) Elasticsearch / OpenSearch backend
Vector store FaissLocalFileStore (in-memory FAISS) DashVector / Milvus / Qdrant backend
File graph LocalFileGraph / NetworkX Neo4j (already partially supported)

This way, all replicas share the same external index state, achieving consistency without each replica rebuilding its own index.

Configuration example:

components:
  keyword_index:
    default:
      backend: elasticsearch
      es_url: ${ES_URL}
      index_name: reme-keywords

  file_store:
    default:
      backend: external_vector_store
      embedding_store: default
      keyword_index: default
      file_graph: default

贡献者指南