Skip to content

Improve macOS launcher, document search, and file browsing - #3

Open
Shriprasad-P wants to merge 8 commits into
githubbermoon:feature/document-pipelinefrom
Shriprasad-P:codex/macos-hotkey-clear-history
Open

Shriprasad-P wants to merge 8 commits into
githubbermoon:feature/document-pipelinefrom
Shriprasad-P:codex/macos-hotkey-clear-history

Conversation

@Shriprasad-P

@Shriprasad-P Shriprasad-P commented Aug 14, 2026 •

Copy link
Copy Markdown

What changed

  • Change the global launcher shortcut to Option+Space and keep the compact palette exclusive to that shortcut.
  • Install and activate the native macOS executable reliably, with visible Clear Search and Clear Chat controls.
  • Add local ingestion for PDF, TXT, Markdown, CSV, TSV, JSON, HTML, DOCX, PPTX, and XLSX files.
  • Extract page, slide, sheet, or section text and split long documents into overlapping searchable chunks.
  • Store document chunks in the existing SQLite metadata and LanceDB text-vector pipeline, including content type, section label, and chunk index.
  • Return documents alongside images in semantic and keyword search and make grounded chat use retrieved document text.
  • Add separate All Files and Images library controls. All Files displays images and one card per document, even when a document has many indexed chunks.
  • Render document icons and metadata in the main result grid and the Option+Space command palette.
  • Add pypdf and the previously missing einops runtime dependency declarations.
  • Document the supported formats and mixed-folder ingestion workflow.

Why

Smart Stack previously focused its gallery and ingestion workflow on images. Documents could not be indexed through the same local search pipeline, and the only browse action was All Photos, making non-image content impossible to inspect. The macOS launcher also needed reliable application activation, a conflict-free shortcut, and clear reset controls.

This change reuses the existing local text-embedding and LanceDB architecture so images and documents can be searched together without introducing a separate database or cloud service.

User impact

Users can drag supported files or whole mixed folders into Smart Stack, retrieve document passages by meaning or keywords, use those passages in grounded chat, browse all indexed files, or switch to an image-only gallery. Multi-page documents appear once in the library while their individual chunks remain available to search.

Selectable-text PDFs are supported. Image-only scanned PDFs still require a future OCR pass.

Validation

  • Full Python suite: 76 tests passed.
  • Native macOS build: ./local_run.sh --build-only --force-build.
  • Reinstalled and relaunched /Users/shriprasad/Applications/SmartStackUI.app successfully.
  • Real isolated document smoke test ingested a TXT file, embedded it, stored it, and retrieved it with content_type=document and section metadata.
  • Verified photos-list --content-type all returns each indexed document once.
  • git diff --check passed.

@githubbermoon
githubbermoon marked this pull request as ready for review August 14, 2026 05:02
@Shriprasad-P Shriprasad-P changed the title Improve macOS shortcut and history controls Improve macOS launcher, document search, and file browsing Aug 15, 2026
@githubbermoon

Copy link
Copy Markdown
Owner

change the hardcoded hotkey to customizable person wise.

@Shriprasad-P

Copy link
Copy Markdown
Author

Implemented the requested per-user customizable hotkey in commit 7837989. The shortcut setting is available from both the existing slider-style Settings button in the app and the native SmartStackUI → Settings… menu (⌘,). It persists per user, applies immediately, reports registration conflicts, and can be reset to Option+Space. Verified by building/installing the native app and running all 76 tests successfully.

@Shriprasad-P

Copy link
Copy Markdown
Author

Follow-up UI refinement in d98a54e: removed the Settings icon/popover from the main console and moved every option it contained into the native SmartStackUI → Settings… window. This now includes search mode, file filter, Top K, minimum score, visual/browse actions, history clearing, watched folders, exclusions, ingestion, maintenance, and the customizable global shortcut. Native build succeeds and all 76 tests pass.

@githubbermoon githubbermoon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the substantial work here. The document ingestion/search direction and customizable launcher shortcut are useful, and I verified that the full Python suite passes (76 tests) and git diff --check is clean. I am requesting changes for the following issues before merge.

1. Prevent image-only verification from penalizing document results

MultimodalSearchEngine currently passes the complete result set to verify_candidates(). That verifier assumes every candidate is an image and calls VLMAnalyzer.generate_text(Path(image_path), ...). For PDF, DOCX, TXT, and other document results, this fails and the exception is converted into the default satisfies=false payload. The search engine subsequently multiplies that document's score by 0.35.

This can demote or hide correct document matches whenever constrained-query verification runs. Please either:

  • send only content_type == "image" candidates to the image verifier and leave unverified document scores unchanged; or
  • implement a separate text-based verification path for documents.

Please add a regression test covering a constrained query whose leading results include documents and confirm those documents are not treated as failed image verifications.

Relevant areas: mm_stack/search_engine.py around lines 732–749 and mm_stack/verification.py around lines 47–95.

2. Make document replacement failure-safe

Document chunks are persisted and committed individually inside _process_candidates(), while obsolete chunks are removed only when added == len(candidates). If embedding or persistence fails partway through re-indexing an edited document, the index can expose a mixture of current and obsolete chunks/vectors.

Please make replacement atomic from the user's perspective. For example, stage the complete new chunk/vector set and swap it only after every chunk succeeds, or remove/roll back newly written chunks when the replacement fails. SQLite and LanceDB cleanup should remain consistent if either side fails.

Please add a failure-path test that begins with an indexed multi-chunk document, forces a middle-chunk failure during re-indexing, and verifies that search sees either the complete old version or the complete new version—never a mixed version.

Relevant area: mm_stack/ingestion.py around lines 250–324.

3. Resolve the installed-app memory-watchdog regression

The installer now copies the native Swift executable directly into the app bundle. This fixes LaunchServices activation/reopen behavior, but it also removes the previous launcher's automatic memory-pressure watchdog and process-count kill switch. The remaining Emergency Kill action is manual and may not be reachable if model work has already made the UI or machine unresponsive.

Please either restore equivalent automatic protection through a native/helper mechanism, or explicitly document and justify removal of the automatic watchdog as an accepted product decision. The guarded ingestion startup check alone does not cover search/chat model processes after launch.

Relevant area: SmartStackUI/install_app.sh around lines 75–85.

Verification note

There are no GitHub CI checks on this PR. I reproduced all 76 passing Python tests. I could not independently complete the Swift build on the current machine because its Command Line Tools compiler and SDK versions conflict (Swift 6.1 compiler versus 6.0.3 SDK/module interfaces); this appears environmental rather than a demonstrated PR code failure. Please keep the successful native-build evidence in the PR and, if practical, add a CI or repeatable build check on a matching macOS toolchain.

Once items 1 and 2 are fixed and item 3 is explicitly resolved, this should be in a much safer state to merge.

@githubbermoon

Copy link
Copy Markdown
Owner

Please also rename the source branch to feature/macos-document-search (or another descriptive product-focused name) to comply with the repository naming policy before merge.

@githubbermoon
githubbermoon changed the base branch from master to feature/document-pipeline August 16, 2026 16:14
@githubbermoon

Copy link
Copy Markdown
Owner

The repository now separates image and document development while keeping one stable product. I have changed this pull request's base to feature/document-pipeline, which is the integration branch for PDF, office-document, and other text-document support.

Please update this pull request as follows before requesting another review:

Keep this pull request document-focused

Retain document extraction, chunking, metadata, text embeddings, mixed-content retrieval, document browsing, and document-specific UI required to expose those results.

Move unrelated global-shortcut, settings-window, launcher, and general application-lifecycle changes into a separate pull request based on master. This keeps the document work reviewable and prevents unrelated application changes from blocking or masking ingestion correctness.

Use the documented content boundaries

Synchronize this branch with feature/document-pipeline and follow docs/architecture/CONTENT_PIPELINES.md and CONTRIBUTING.md from that base.

  • Dispatch ingestion and verification using an explicit content_type.
  • Never pass documents to the image-only verifier.
  • If document verification is unavailable, retain the retrieval score and mark the result unverified rather than applying an image-verification failure penalty.
  • Keep image identifiers, vectors, ranking behavior, CLI behavior, and phone ingestion backward compatible.
  • Keep one logical library card per source document while allowing relevant chunks to appear in search.

Make replacement atomic

An edited document must be reindexed as one logical operation. Stage all extracted chunks, SQLite records, and LanceDB vectors before making the new generation visible. On any extraction, embedding, or persistence failure, search must continue seeing the complete previous generation. Add cleanup or reconciliation for abandoned staged data.

Required regression coverage:

  1. A constrained mixed-content query does not send document results to visual verification or penalize them as failed images.
  2. A forced middle-chunk failure leaves the complete old document generation searchable and exposes no mixture of old and new chunks.
  3. Successful replacement removes every obsolete chunk and vector.
  4. Existing image ingestion and search tests remain unchanged and passing.
  5. A multi-page document appears once in library browsing while its relevant chunks remain searchable.

Dependencies and repository checks

Update pyproject.toml and uv.lock together for document-parser dependencies. Large runtime models must not be downloaded during pull-request tests. The protected branch requires Python tests, the native macOS build, dependency review/audit, and Python/workflow security scanning.

Please rename the source branch to a descriptive product name such as documents/add-file-ingestion. Branch names and pull-request metadata must not include personal names or development-tool branding.

The earlier requested changes remain applicable. The earlier note that repository checks were unavailable is now superseded by the protected checks on this document integration branch.

@githubbermoon githubbermoon added area: documents Document extraction, chunking, indexing, or retrieval enhancement New feature or request labels Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: documents Document extraction, chunking, indexing, or retrieval enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants