research(memory): evaluate deterministic optical visual index for long-horizon retrieval
Why this exists
Memorix already has an optional ingest image flow that asks a vision model to describe a user-supplied image and stores the resulting text. That is useful import tooling, but it is not a long-horizon memory architecture.
The proposed direction is different: render Memorix's existing structured text records into a deterministic, high-density visual index, use a vision model only to locate stable record identifiers, then retrieve the original text from the canonical store.
This issue is a design-and-evaluation track. It is not a commitment to make visual retrieval the default before it demonstrates a net benefit.
Proposed capability: Optical Memory / Visual Atlas
canonical structured observations and knowledge records
-> deterministic renderer (not diffusion / generative image creation)
-> atlas pages + manifest { page, recordId, boundingBox, textHash, rendererVersion }
-> optional visual locator returns record IDs only
-> SQLite fetches the exact original records
-> agent receives textual evidence with provenance
The images are rebuildable retrieval projections. They are never the source of truth and never replace the stored text.
Product boundaries
- Normal retrieval remains the default hybrid text path.
- Optical retrieval is an opt-in, second-stage path for long histories, weak/overbroad text candidates, or layout/relationship-heavy recall.
- It must work as a transparent internal acceleration for all supported agents; host-agent image support is not required when Memorix can call a configured locator and return text evidence.
- Any external vision-model call must be explicit, configurable, and auditable. Nothing should silently export local memory pages.
- The locator must return stable IDs or regions only. It must not generate the recovered evidence itself.
- A text-only fallback is mandatory.
Non-goals
- Do not continuously capture screenshots or treat arbitrary user images as durable memory by default.
- Do not use a diffusion image generator to rewrite, summarize, or decorate records.
- Do not replace canonical SQLite records, normal hybrid retrieval, or structured knowledge/graph work.
- Do not claim the existing
memorix ingest imagecommand is this feature. - Do not close #133 through this work.
Relationship to #133 / #134
#134 is a useful separate provider/provenance foundation: typed embedding inputs, provider capability handling, and attachment metadata. It does not implement controlled media ingestion or an optical retrieval index, so it should not be presented as a complete solution to #133.
If #134 is brought current and passes CI, retain contributor attribution and merge/rebase it on its own merits. This issue should not absorb or rewrite that contribution.
Required architecture decisions
- A deterministic, cross-platform renderer and stable page/segment layout.
- A manifest that maps each rendered segment back to an observation/knowledge record and content hash.
- Invalidation/rebuild rules when a record changes, resolves, is archived, or is deleted.
- A separately configured visual-locator lane rather than overloading the text embedding lane.
- Strict structured output validation, identifier existence checks, confidence handling, and fallback behavior.
- Privacy, provider, timeout, cost, cache, and local-only operation semantics.
Evaluation gates before product default
- [ ] RFC with threat model, privacy behavior, and provider contract.
- [ ] Deterministic renderer + manifest prototype with no data-loss path.
- [ ] Retrieval benchmark against current hybrid text retrieval on long-horizon tasks.
- [ ] Measure source-record recall, evidence fidelity, end-to-end agent task success, prompt/vision tokens, latency, disk usage, and cost.
- [ ] Validate failures: tiny text, stale pages, false locator IDs, unavailable vision provider, and text-only fallback.
- [ ] Ship only as an experimental opt-in until it has a measured advantage in its intended workload.
Research references
- OCR-Memory (ACL 2026): https://aclanthology.org/2026.acl-long.474/
- OCR-Memory paper details: https://arxiv.org/html/2604.26622
- MemOCR: https://github.com/meituan/MemOCR
- VisRet (related but targeted at natural-image retrieval, not the core design here): https://github.com/xiaowu0162/Visualize-then-Retrieve
Closing this research proposal as superseded. The optical visual-index direction is not part of the active protocol or product line.