feat: same-turn memory retrieval in provider mode #6

Merged
Pakobbix merged 1 commits from feature/same-turn-prefetch into main 2026-08-15 17:53:03 +00:00
1 Commits
Author SHA1 Message Date
ARIA c79cf43ff8 feat: same-turn memory retrieval in provider mode
prefetch() now reuses the in-flight background search when it matches
the current query, or falls back to a synchronous search (capped at 3s,
split across both requests in case-insensitive mode) so memories are
injected on the same turn instead of one turn behind.

- Track _prefetch_query to scope cached results to their query
- Reset _prefetch_result when starting a new background search to
  prevent stale cross-turn injection after a timed-out join
- Guard background thread writes against superseded queries
- Add optional per-request timeout override to LocalMem0Client
- Update AGENTS.md and README to describe the same-turn flow
2026-08-15 19:52:25 +02:00