Skip to content

bug(memory): extraPaths in defaults duplicates embeddings across all agents #46558

@rendrag-git

Description

@rendrag-git

Summary

When agents.defaults.memorySearch.extraPaths is configured, every agent independently indexes and embeds all files in those paths. For a setup with N agents and M files in extraPaths, this produces N × M embedding operations and N copies of the same vectors in separate sqlite databases.

Impact

  • Wasted embedding API calls (cost + latency on every sync)
  • Duplicate storage in each agent's .sqlite file
  • Sync time scales linearly with agent count for the same shared files

Expected behavior

Files in shared/extra paths should be indexed once and searched from all agents, not duplicated per-agent.

Workaround

#46542 introduces a shared memory store (sharedPaths) that indexes once in _shared.sqlite and merges results into agent searches. It also soft-migrates extraPaths to sharedPaths with a deprecation warning.

Repro

  1. Configure agents.defaults.memorySearch.extraPaths: ["~/shared-docs"] with multiple agents
  2. Run openclaw memory index
  3. Observe each agent's sqlite independently embedding the same files

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions