Skip to content

fix(memory): spreading activation timeout (500ms) is hardcoded and too short for first-turn queries #2514

@bug-ops

Description

@bug-ops

Description

The spreading activation recall timeout is hardcoded at 500ms in crates/zeph-core/src/agent/context/assembly.rs:122. This timeout is consistently triggered on first-turn queries in sessions with fresh or lightly populated databases.

Observed log:

WARN zeph_core::agent::context::assembly: spreading activation recall timed out (500ms)

Reproduction

Fresh DB + 2-turn session — occurs on Turn 2 context assembly during spreading activation query.

Root cause

The 500ms bound is too tight for:

  1. Fresh DB sessions where SQLite needs to perform FTS5 queries with no cached page data
  2. Sessions with active background graph extraction (async write) from the prior turn creating potential lock contention

Impact

When spreading activation times out, graph-based context facts are not injected into the LLM request for that turn. This silently degrades response quality for queries that would benefit from graph recall.

Proposed fix

  1. Make the timeout configurable via [memory.graph.spreading_activation] recall_timeout_ms (default: 500ms for backward compatibility)
  2. Consider increasing default from 500ms to 1000ms — consistent with prior benchmark data showing FTS5 queries completing within 200-400ms on populated DBs

References

  • Hardcoded timeout at crates/zeph-core/src/agent/context/assembly.rs:122

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexitybugSomething isn't workingmemoryzeph-memory crate (SQLite)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions