feat: add memory candidates viewer with filtering and confidence visualization

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
shahondin1624
2026-03-12 12:33:48 +01:00
parent 5efc5c351c
commit 9ad772f83f
8 changed files with 374 additions and 0 deletions

View File

@@ -18,6 +18,7 @@
import { processRequest, OrchestratorError } from '$lib/services/orchestrator';
import { OrchestrationState } from '$lib/proto/llm_multiverse/v1/orchestrator_pb';
import { sessionStore } from '$lib/stores/sessions.svelte';
import { memoryStore } from '$lib/stores/memory.svelte';
let messages: ChatMessage[] = $state([]);
let isStreaming = $state(false);
@@ -30,6 +31,7 @@
);
let showConfig = $state(false);
const lineageHref = resolveRoute('/lineage');
const memoryHref = resolveRoute('/memory');
const isNonDefaultConfig = $derived(
sessionConfig.overrideLevel !== OverrideLevel.NONE ||
@@ -106,6 +108,16 @@
}
if (response.finalResult) {
finalResult = response.finalResult;
if (response.finalResult.newMemoryCandidates.length > 0) {
memoryStore.addCandidates(
sessionId,
response.finalResult.newMemoryCandidates.map((mc) => ({
content: mc.content,
source: mc.source,
confidence: mc.confidence
}))
);
}
}
const idx = messages.length - 1;
messages[idx] = {
@@ -145,6 +157,12 @@
>
Lineage
</a>
<a
href={memoryHref}
class="rounded-lg px-2.5 py-1.5 text-sm text-gray-600 hover:bg-gray-100 hover:text-gray-900"
>
Memory
</a>
<!-- eslint-enable svelte/no-navigation-without-resolve -->
<button
type="button"