Add lightweight history and memory retrieval / 增加轻量历史与记忆检索#4071
Conversation
530c64a to
590b0f3
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
approve |
|
Merged — thank you, this is genuinely excellent work. What stood out: you didn't just avoid breaking the cache-first prefix, you fenced it with regression tests — provider-visible tool order + schema/description stability, and asserting retrieval content stays out of the cached system prompt. That invariant is what this project lives or dies on, and it's now protected against future drift. The BM25-only approach (no SQLite/CGO/embeddings) is exactly the right call here, and the path handling is careful and correct throughout — Two notes, neither blocking:
Thanks again for the care here — look forward to more. |
Summary
historytool for searching local session transcripts and reading bounded context around a hit.memoryrecall tool for active saved memory search/list/read.rememberandforgetcalls, including a local preview of the memory content being saved or archived.docs/SESSION_MEMORY_RETRIEVAL.mdand link it from the guide/spec docs.Technical Notes
This keeps Reasonix cache-first: dynamic session history is retrieved on demand, while the stable system prompt prefix remains unchanged during a session. Saved memory acts as a synthesis cache for approved, reusable conclusions rather than as a raw transcript dump.
The implementation avoids SQLite, CGO, vector databases, and embedding models. Retrieval is lexical BM25 with a relative score floor to keep strong matches while trimming common-word noise.
The desktop management UI now treats active memories, candidate suggestions, archived memories, and instruction files as separate views. Candidate suggestions are drafts: scans do not write memory or skills, the auto-generate toggle only controls local candidate generation on the Suggestions tab, and accepting a candidate goes through the existing memory store or skill store validation paths. Active memories can be searched, filtered, expanded, quick-added, and archived; archived entries remain read-only for audit/recovery; instruction files use the same collapsed card interaction pattern as memory entries.
Memory archive file operations are confined through the standard library root-scoped file APIs, so archive moves operate on validated names inside the memory store rather than passing absolute paths between helpers.
Validation
go test ./...from the desktop module.go test ./internal/control.go test ./internal/memory.npm run typecheck.npm run check:css.wails generate module, followed bynpm run typecheck.git diff --check.Created as a draft PR for review.