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

貢獻者指南