Skip to content

feat: memory recall, local embeddings, streaming UI fixes - #13

Merged
forkwright merged 5 commits into
mainfrom
feat/memory-recall-ui-fixes
Feb 18, 2026
Merged

feat: memory recall, local embeddings, streaming UI fixes#13
forkwright merged 5 commits into
mainfrom
feat/memory-recall-ui-fixes

Conversation

@CKickertz

Copy link
Copy Markdown
Collaborator

Summary

  • Local embeddings with Voyage fallback: Sidecar uses fastembed (thenlper/gte-large, 1024d ONNX) when VOYAGE_API_KEY is absent, Voyage when present. HIPAA-safe by default.
  • Pre-turn memory recall: Queries mem0 sidecar before each LLM turn, injects relevant memories as a dynamic system prompt block. Graph-enhanced search with basic fallback. 3s timeout, never blocks the turn.
  • Conversation backfill script: Mines existing sessions.db and Claude Code JSONL transcripts into mem0 for retroactive fact extraction.
  • Streaming UI fixes: Stop button clears on turn_complete, text separators between content blocks in agentic loops, loadHistory guarded during active local streams to prevent message disappearance.

Test plan

  • 808/808 runtime tests pass (verified locally)
  • Pre-turn recall: send message to agent, check logs for "Recalled N memories" line
  • Recall timeout: stop sidecar, send message, verify turn proceeds without blocking
  • Streaming: verify stop button clears after agent finishes, text formatting preserved between tool calls
  • Backfill: python backfill.py --source chiron --dry-run previews chunks without sending

Switch sidecar from Voyage-only to conditional: uses Voyage when
VOYAGE_API_KEY is set, falls back to fastembed (thenlper/gte-large,
1024d ONNX) for HIPAA-safe local embeddings. Health check tests
actual embedder instead of hardcoded Voyage API call.
Mines existing conversations (Aletheia sessions.db and Claude Code
JSONL transcripts) into the mem0 sidecar for fact extraction. Groups
messages into ~3000 char chunks, sends to /add endpoint. Supports
--source chiron|claude-code|all, --dry-run, --max-files.
Query mem0 sidecar before each LLM turn and inject matching memories
as a dynamic system prompt block. Uses graph_enhanced_search with
basic /search fallback. 3s timeout, never blocks the turn. Recall
tokens deducted from history budget to prevent context overflow.
Injected in both streaming and non-streaming paths.
…appearing messages

Three fixes in the WebUI chat:
- Clear isStreaming on turn_complete so stop button disappears promptly
- Add text separators between content blocks in agentic loops
- Guard loadHistory with hasLocalStream to prevent race where SSE
  turn:after event overwrites locally-managed messages mid-stream
- Remove redundant "Agents" header from sidebar
@sonarqubecloud

Copy link
Copy Markdown

@forkwright
forkwright merged commit c3781ad into main Feb 18, 2026
1 check passed
forkwright pushed a commit that referenced this pull request Feb 18, 2026
Superset of PR #13 (memory-recall-ui-fixes). Includes:
- Local embeddings with Voyage fallback (fastembed/gte-large ONNX)
- Pre-turn memory recall from mem0 sidecar
- Conversation backfill script
- Streaming UI fixes: text separators after tools, hasLocalStream guard
- Hex + Redshift signal collectors for prosoche
- 4 learned skills

Conflicts resolved (manager.ts, ChatView.svelte, chat.svelte.ts):
all additive from incoming branch, no HEAD-only changes lost.
@forkwright
forkwright deleted the feat/memory-recall-ui-fixes branch February 18, 2026 17:10
forkwright added a commit that referenced this pull request Feb 18, 2026
Superset of PR #13 (memory-recall-ui-fixes). Includes:
- Local embeddings with Voyage fallback (fastembed/gte-large ONNX)
- Pre-turn memory recall from mem0 sidecar
- Conversation backfill script
- Streaming UI fixes: text separators after tools, hasLocalStream guard
- Hex + Redshift signal collectors for prosoche
- 4 learned skills

Conflicts resolved (manager.ts, ChatView.svelte, chat.svelte.ts):
all additive from incoming branch, no HEAD-only changes lost.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants