@startuml lagrange-search !include _lagrange.iuml ' Recall on every prompt: the UserPromptSubmit hook pulls up to 3 similar past sessions ' (see lagrange-search-mcp.puml for an explicit search / MCP tool call). autonumber participant "Claude Code" as CC participant "cc-recall" as REC participant "cchist" as H database "archive.nosync\n(FTS5 + vectors)" as DB participant "llama-server\n:8179 embed" as LLAMA CC -> REC : prompt JSON (stdin) REC -> H : recall "" H -> DB : rank_fts -- bm25, ru stemming H -> LLAMA : embed(query) LLAMA --> H : query vector H -> DB : rank_sem -- cosine H -> H : hybrid(fts, sem, rrf) H --> REC : up to 3 ranked sessions REC --> CC : additionalContext (~60 tokens/hit) @enduml