Today is Friday, March 13, 2026. We have successfully shifted the project scope from a general Agentic system to a highly specialized Expert-in-the-Loop Relabeling Module, focusing on an In-Graph Reference System that leverages existing data points to create visual anchors rather than relying on external image uploads.


Executive Summary - The “Visual Anchor” Pivot

We redefined how reference images are handled to minimize storage and maximize contextual relevance.

  • New UI model: Reference images now live inside the scatter plot as top‑docked thumbnails instead of a separate gallery.
  • Dual-mode workflow: Introduced two modes:
    • Reference Selection Mode - curate which points become reference images
    • Relabel Mode - label points using the curated references

Key Achievements (Today)

1) In-Graph Reference System (State + UI)

  • Persistence architecture: Designed .state/references.json to store only image_id + layout coordinates, avoiding file bloat.
  • State machine: Defined switch between Reference Selection and Relabeling states.
  • Rendering on load: onMount now rehydrates stored IDs into visible thumbnails reliably.

2) UI Enhancements (Scatter Plot)

  • Added a reference shelf at the top of the plot (reserved Y-axis zone).
  • Implemented the promotion flow to morph a point into a reference image.
  • Planned collision detection logic to allow dropping points onto reference thumbnails, triggering label updates.

3) UX & Reliability Improvements

  • Prevented storage redundancy by referencing IDs instead of uploading/duplicating files.
  • Introduced a safe “Selection Mode” to avoid accidental workspace edits during relabeling.
  • Ensured the expert’s workspace state survives refresh via persistent JSON state.

System Architecture (Current Status)

Component Responsibility Status
State Storage .state/references.json ✅ Logic Defined
Selection Mode Toggle in Settings 🟡 Implementation Pending
Reference Shelf Top-docked SVG container 🟡 UI Layout Pending
Image Resolver Map ID → Local Path ✅ Core Logic Ready

Development Snapshot (Feature Work + Fixes)

Backend / Infrastructure

  • Added cached embeddings + endpoints: POST /workers/update, GET /workers/query, GET /workers (main.py).
  • Improved DB helper: safe pgvector registration + better error messaging (database.py).
  • Updated Docker Compose to mount host directory for persistent DB state.

Frontend (SvelteKit)

  • Built pages for worker updates and NL query (multiple +page.svelte).
  • Wired server proxies (/api/search, /api/dispatch) and added header nav links (+server.ts).

Docs & Repository Hygiene

  • Fixed README schema to use bio (matches seed script). Updated README.md and .env.example to use LOCAL_VAULT_URL.
  • Fixed Mermaid parse error in current-working.md sequence diagram.

Fixes & Verification

  • Added missing bio column via ALTER TABLE, re-ran seed_workers.py successfully.
  • Verified backend imports/startup (model loads once).
  • Confirmed frontend typecheck and production build pass.

Next Recommendations

  • Add schema migrations (Alembic) for reproducible DB state.
  • Add health-check endpoint reporting missing vector extension / embedding status.
  • Add lightweight API-key auth for vault endpoints before exposing publicly.
  • Optionally add embedding_updated_at column and surface it in the UI.

Feature Notes (Reference Image UX)

  • Image sizing: Reference photos are now 150×150 px with updated offsets/margins.
  • Visual link: Added blue dotted line from each reference image to the X-axis (drawn/removed with the image).
  • Persistence: Active reference IDs persist in localStorage and restore on refresh.
  • Removal UI: Added a red “X” close button to drop individual reference images.
  • Dynamic layout: Top margin adjusts automatically to prevent clipping.
  • Notifications: Fixed save flow to accurately display the reference count.

🔭 Suggested Next Enhancements

  • Add hover tooltip on the dotted line showing image ID + point coordinates.
  • Animate line/image entry+exit for smoother UX.
  • Add a settings toggle for image size and line style (persisted to user preferences).

This site uses Just the Docs, a documentation theme for Jekyll.