Skip to content

perf(memory): batch embedding calls in consolidation sweep instead of sequential #2365

@bug-ops

Description

@bug-ops

Context

run_consolidation_sweep in crates/zeph-memory/src/consolidation.rs calls the embedding provider once per memory entry in a sequential loop. For large batches this is slow.

Fix

If the embedding provider supports batch requests (OpenAI /embeddings accepts input: [str]), send all entries in a single request. Fall back to sequential if the provider does not support batching.

Acceptance criteria

Consolidation sweep uses a single batch embedding call when the provider supports it. Test count and correctness unchanged.

Discovered in PR #2358 impl-critic review (MINOR).

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexitymemoryzeph-memory crate (SQLite)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions