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

@@ -17,3 +17,4 @@
| #13 | Session config sidebar component | COMPLETED | [issue-013.md](issue-013.md) |
| #14 | Preset configurations | COMPLETED | [issue-014.md](issue-014.md) |
| #15 | Agent lineage visualization | COMPLETED | [issue-015.md](issue-015.md) |
| #16 | Memory candidates viewer | COMPLETED | [issue-016.md](issue-016.md) |

View File

@@ -0,0 +1,37 @@
---
---
# Issue #16: Memory candidates viewer
**Status:** COMPLETED
**Issue:** https://git.shahondin1624.de/llm-multiverse/llm-multiverse-ui/issues/16
**Branch:** `feature/issue-16-memory-viewer`
## Acceptance Criteria
- [x] Dedicated `/memory` route
- [x] List of `MemoryCandidate` entries
- [x] Each entry shows: content, source badge, confidence score
- [x] Entries grouped by session
- [x] Confidence score visualized (progress bar with color-coding)
- [x] Filterable by source or confidence threshold
## Implementation
### New Files
- `src/lib/stores/memory.svelte.ts` — reactive store for memory candidates grouped by session ID, with localStorage persistence, sample/demo data, and `addCandidates()` / `getAllBySession()` / `clearSession()` API
- `src/lib/components/MemoryCandidateCard.svelte` — card component displaying a single memory candidate with content, color-coded source badge (Tool Output=blue, Model Knowledge=purple, Web=green, Unspecified=gray), and horizontal confidence progress bar with percentage
- `src/routes/memory/+page.svelte` — dedicated memory route with session-grouped layout, source dropdown filter, confidence threshold slider, empty state, and back-to-chat link
- `src/routes/memory/+page.ts` — SSR disabled for this route
### Modified Files
- `src/routes/+page.svelte` — added Memory Candidates navigation link on the home page
- `src/routes/chat/+page.svelte` — added Memory link in the header next to Lineage; wired up capture of `finalResult.newMemoryCandidates` into the memory store
### Key Decisions
- Uses sample/demo data seeded into localStorage on first load, since the orchestrator doesn't currently include memory candidates in typical responses
- `StoredMemoryCandidate` type decouples the UI store from protobuf Message dependency (same pattern as lineage's `SimpleAgentIdentifier`)
- Confidence bar color-coded: green (>=80%), amber (>=50%), red (<50%)
- Source badge colors match the project's existing badge conventions (blue, purple, green, gray)
- Grid layout (1-3 columns responsive) for candidate cards within each session group
- Filter controls use a source dropdown and a range slider for confidence threshold