-
Notifications
You must be signed in to change notification settings - Fork 2
fix(memory): spreading activation timeout (500ms) is hardcoded and too short for first-turn queries #2514
Copy link
Copy link
Closed
Labels
P3Research — medium-high complexityResearch — medium-high complexitybugSomething isn't workingSomething isn't workingmemoryzeph-memory crate (SQLite)zeph-memory crate (SQLite)
Description
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:
- Fresh DB sessions where SQLite needs to perform FTS5 queries with no cached page data
- 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
- Make the timeout configurable via
[memory.graph.spreading_activation] recall_timeout_ms(default: 500ms for backward compatibility) - 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Research — medium-high complexityResearch — medium-high complexitybugSomething isn't workingSomething isn't workingmemoryzeph-memory crate (SQLite)zeph-memory crate (SQLite)