feat(memory-v2): close Phase A with auto-review, product events, and H5 recall UI.
Add candidate auto-review pipeline, shadow audit tooling, admin metrics page, and user-visible memory recall hints in chat with phase-a readiness checks. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1461,11 +1461,37 @@ export function createAgentRunGateway({
|
||||
memoryCount: Array.isArray(agentMemoryContext.memories)
|
||||
? agentMemoryContext.memories.length
|
||||
: 0,
|
||||
memoryPreviews: buildMemoryRecallPreviews(agentMemoryContext.memories),
|
||||
skipped: Boolean(agentMemoryContext.skipped),
|
||||
degraded: Boolean(agentMemoryContext.degraded),
|
||||
reason: agentMemoryContext.reason ?? null,
|
||||
latencyMs: Number(agentMemoryContext.latencyMs ?? 0),
|
||||
});
|
||||
if (agentMemoryContext.injectionEnabled) {
|
||||
const memoryCount = Array.isArray(agentMemoryContext.memories)
|
||||
? agentMemoryContext.memories.length
|
||||
: 0;
|
||||
void recordMemoryV2ProductEvent(pool, {
|
||||
eventType: MEMORY_V2_PRODUCT_EVENT_TYPES.RESOLVED_INJECTED,
|
||||
userId: row.user_id,
|
||||
sessionId: row.agent_session_id ?? null,
|
||||
runId,
|
||||
data: {
|
||||
mode: agentMemoryContext.mode,
|
||||
memoryCount,
|
||||
source: agentMemoryContext.source ?? null,
|
||||
},
|
||||
}).catch(() => {});
|
||||
if (memoryCount > 0) {
|
||||
void recordMemoryV2ProductEvent(pool, {
|
||||
eventType: MEMORY_V2_PRODUCT_EVENT_TYPES.RECALL_HIT,
|
||||
userId: row.user_id,
|
||||
sessionId: row.agent_session_id ?? null,
|
||||
runId,
|
||||
data: { memoryCount, mode: agentMemoryContext.mode },
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn(
|
||||
|
||||
Reference in New Issue
Block a user