TencentCloud/TencentDB-Agent-Memory · error
${TAG} [L2] VectorStore unavailable — cannot read L1 memorie
Error message
${TAG} [L2] VectorStore unavailable — cannot read L1 memories for scene extraction (session=${sessionKey}) What it means
The L2 runner needs to read L1 memory records from the VectorStore to perform scene extraction. If the vector store handle is unavailable (not initialized or degraded) at that point, it throws rather than extracting scenes from an empty/incomplete view of memories, and includes the session key for diagnosis.
Source
Thrown at MemoryCore/src/utils/pipeline-factory.ts:762
}
logger.debug?.(
`${TAG} [L2] Incremental query returned ${memRecords.length} record(s) (session=${sessionKey})`,
);
records = memRecords.map((r) => ({
content: r.content,
created_at: r.createdAt,
id: r.id,
updatedAt: r.updatedAt,
teamId: r.teamId,
userId: r.userId,
agentId: r.agentId,
sessionId: r.sessionId,
taskId: r.taskId,
}));
} else {
throw new Error(`${TAG} [L2] VectorStore unavailable — cannot read L1 memories for scene extraction (session=${sessionKey})`);
}
if (records.length === 0) {
logger.debug?.(`${TAG} [L2] No new L1 records found (session=${sessionKey}), skipping scene extraction`);
return;
}
const grouped = new Map<string, typeof records>();
for (const record of records) {
const key = buildIsolationScope(record);
const list = grouped.get(key) ?? [];
list.push(record);
grouped.set(key, list);
}
let processedTotal = 0;
let anyEmptyExtraction = false;
const l2PromptTargets = [...grouped.values()].map((groupRecords) => ({View on GitHub (pinned to 3efcd317b8)
Solutions
- Ensure initStores completed successfully before creating/running the L2 runner
- Re-initialize or restore the VectorStore, then retry scene extraction for the session
- Check pipeline logs for an earlier degraded-mode failure (see VectorStore degraded error)
- Short-circuit L2 processing when the store is unavailable instead of scheduling the runner
Example fix
// before
const runner = await factory.l2Runner(sessionKey); // throws if store gone
// after
if (!factory.hasVectorStore()) { logger.warn('skip L2: no store'); return; }
const runner = await factory.l2Runner(sessionKey); Defensive patterns
Strategy: validation
Validate before calling
if (!factory.hasVectorStore?.()) { logger.warn(`[L2] skipping scene extraction for ${sessionKey}: no vector store`); return; } Try / catch
try { await l2Runner(sessionKey); } catch (e) { if (e.message.includes('[L2] VectorStore unavailable')) { logger.warn(`L2 deferred for ${sessionKey}: store unavailable`); await requeueLater(sessionKey); } else throw e; } Prevention
- Initialize stores before scheduling any L2 work
- Requeue L2 sessions whose store was unavailable instead of failing them permanently
- Tear down L2 runners when the vector store is shut down
When it happens
Trigger: createL2Runner's scene-extraction step runs for a session whose VectorStore is null/unavailable — typically pipeline init failed earlier or the store was torn down while the L2 runner still executes.
Common situations: L2 processing continuing after a degraded store during startup; session replay for an old session after store restart; misconfigured wiring where initStores was never awaited before the L2 runner fires.
Related errors
AI-assisted analysis of TencentCloud/TencentDB-Agent-Memory@3efcd317b8 (2026-09-01).
Data as JSON: /api/errors/3b1818ff1c19b240.
Report an issue: GitHub.