Skip to content

Add optional local DocumentDB semantic-search showcase - #7

Merged
patty-chow merged 5 commits into
mainfrom
workshop/semantic-search-20261018
Oct 19, 2026
Merged

patty-chow merged 5 commits into
mainfrom
workshop/semantic-search-20261018

Conversation

@patty-chow

@patty-chow patty-chow commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add a built-in Search by meaning showcase without adding another required workshop exercise.

  • Real local Nomic 768-dimensional query embeddings and DocumentDB IVF/COS $search.cosmosSearch queries with actual raw searchScore values.
  • Separate semantic panel, prompt chips, explicit day/track filters, source cards and existing favorite actions; cancellation and stale-target guards.
  • Inspectable executed pipeline/model/bundle/dimensions/filter strategy/latencies. Pure vector ranking with disclosed 0.60 metadata-snapshot cutoff; no keyword/static/model fallback or generated factual answers.
  • Checked-in session embeddings: 216 vectors in a 663,552-byte float32 asset plus 69,657-byte manifest (~716 KiB combined). Generated once from this repo's public schedule using the pinned model, not copied private source/data or synthetic vectors.
  • Default optional preparation validates the source-pinned bundle, imports it and builds/probes a native index. Zero per-session embedding calls. Every arbitrary user query still receives a real local model embedding.
  • Search-derived data lives in separate owned collections, with integrity checks, resumable preparation, bundle binding and refusal to overwrite/adopt incompatible legacy search rows. Canonical catalog/favorites remain unchanged.
  • Explicit maintainer-only generator, model attribution and guarded three-file publication; model weights and physical database indexes are not committed.
  • Ordinary startup remains model-free; no attendee API key, paid inference service, generation model, query history or implicit cloud writes.

Runtime and cleanup

Official pinned multi-platform Ollama 0.1.48 is retained for this private educational demo's bounded download/runtime footprint. It is not recommended for public production inference. CPU backend autodetection uses AVX2/AVX when available while requests retain zero GPU layers; no GPU passthrough. The inference service is unpublished, internal-network-only, with read-only model/runner volumes. The underlying server has broader APIs; only the application adapter is embedding-only.

Signal-aware async preparation handles repeated SIGINT/SIGTERM, waits for child closure and verifies its temporary outbound downloader stopped before proceeding. Uncatchable crash/daemon-loss recovery is documented; cleanup errors remain explicit.

Executed evidence

  • Final bundle code on macOS: 151 tests passed, one existing Linux-only skip; 67 doc links passed.
  • Local clean bundle import/index/probe: 1.302s / 1.281s for A/B; full optional preparation with cached model/image 10.775s. Instrumented preparation rejects any model.embed call: zero observed. Actual search performs one query embedding.
  • Both imported vector sets exactly match the checked-in bundle; original catalog/favorite hashes unchanged; real query/filter/no-match/integrity and two-site integration checks passed.
  • Pre-bundle Codespace runtime/UI acceptance at 75547c2 passed: all three search chips, filters, native inspector, no-match query, cancel/retry, target races, saved favorite, real model outage with core browsing/copy still usable, and model-only recovery. 138/138 root tests, 2/2 database integration, 1/1 real-model integration.
  • Codespace CPU comparison measured three warm query embeddings ~10–11x faster using detected AVX2, vector cosine agreement >0.9999994 and unchanged accepted rankings. This is a small sample, not a general benchmark.
  • Final independent bundle review approved d4c10d6, with all 216 rows decoded and integrity/non-destructive import/publication guards checked.
  • Final clean-database Codespace acceptance passed: full cached preparation 17.070s, 1.756s per site for import/index/probes. Real model counter 237→237 proves zero session embedding calls; first UI query then made exactly one live embedding request. All stored coordinates and manifest tuples matched the bundle on both sites.
  • Actual private browser: first cold-model query returned expected 0.747/0.724 leaders in 1.732s; unrelated bread query zero; combined day/track one result; Site B identical five rankings in 248ms; inspector and favorite persistence passed.
  • 152/152 Codespace root tests, 67 documentation links, real bundle/model/vector integration 1/1 in 8.548s. Legacy A4/B3 notebooks and all legacy collection hashes remained unchanged.
  • The final commit records this evidence in documentation only; no runtime change after approval/test. Fresh model downloads are not included in the 17-second cached setup measurement.

No Azure resources, public model ports, mandatory student model downloads, or changes to the user's active Codespace. The owned acceptance Codespace is verified Shutdown after final testing, with its existing 24-hour retention unchanged.

@patty-chow
patty-chow merged commit 1b98ea4 into main Oct 19, 2026
2 checks passed
@patty-chow
patty-chow deleted the workshop/semantic-search-20261018 branch October 19, 2026 04:18
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.

1 participant