symfonic.capabilities.memory.phases.window¶
window ¶
The recently-updated semantic rows a cycle works over, read once.
Legacy's quick_nap queried the semantic layer once, filtered it to the
lookback window, and handed the same list to phase 1 and phase 5. Splitting
those into two phase objects would have split the query too -- two full scans
of a tenant's semantic graph per nap, on the one cadence that runs inside a
turn.
Memoised on the cycle, not on the phase. The key is the scope path and the cycle's start instant, so two scopes consolidating concurrently never see each other's window, and a second cycle over the same scope re-reads rather than replaying a stale one. One entry is kept: a cycle runs its phases back to back, and a cache that grew would be a per-tenant copy of the semantic graph held for the lifetime of the process.
RecentSemanticNodes ¶
One scan of a scope's recent semantic rows, shared across a cycle.
Source code in src/symfonic/capabilities/memory/phases/window.py
for_cycle
async
¶
The window for context's cycle, querying at most once.