How hanxiao/omni-macos works
Omni is an on-device macOS app for semantic search across files, with browsing, multimodal indexing, optional OCR, folder-embedding visualization, and a localhost HTTP/MCP serving surface. The main workflow is selecting local sources, crawling and extracting content, embedding and indexing it, then searching and browsing results. The README documents multimodal formats, airgapped operation, and serving. Some UI and OCR wiring is unsampled; those links are omitted where source evidence is unavailable.
Main entry points: AppModel.swift App coordinator · Indexer.swift Index pipeline · ServingController.swift Serving controller · Router.swift Request router
Components 21
Mac App
- App coordinator
App/AppModel.swift - Browse and results
App/ContentView.swift - Folder embedding map
App/FolderEmbeddingVisualization.swift - OCR interface
App/OCRView.swift
Indexing
- File crawler
Sources/OmniKit/FileCrawler.swift - Content extraction
Sources/OmniKit/FileExtractor.swift - Index pipeline
Sources/OmniKit/Indexer.swift
Embedding and OCR
- Omni embedding engine
Sources/OmniKit/OmniEngine.swift - OCR model
Sources/OmniKit/OCR/OCRModel.swift
Search and Storage
- Query parser
Sources/OmniKit/SearchQueryParser.swift - Vector index
Sources/OmniKit/VectorStore.swift - Embedding projection
Sources/OmniKit/ProjectionEngine.swift
Serving
- Serving controller
App/Serving/ServingController.swift - HTTP server
App/Serving/HTTPServer.swift - Request router
App/Serving/Router.swift - Serving backend
App/Serving/ServingBackend.swift - MCP adapter
App/Serving/MCPAdapter.swift - Sources API
App/Serving/SourcesAdapter.swift
Other components
- Mac user
- Local sources
- API or MCP client
Connections 28
- Mac user → App coordinator: uses
- Local sources → File crawler: crawls
Sources/OmniKit/FileCrawler.swift - App coordinator → Index pipeline: starts indexing
App/AppModel.swift - Index pipeline → File crawler: crawls files
Sources/OmniKit/Indexer.swift - File crawler → Content extraction: extracts content
Sources/OmniKit/FileCrawler.swift - Index pipeline → Content extraction: reads content
Sources/OmniKit/Indexer.swift - Index pipeline → Omni embedding engine: embeds content
Sources/OmniKit/Indexer.swift - Index pipeline → Vector index: writes index
Sources/OmniKit/Indexer.swift - App coordinator → Omni embedding engine: loads model
App/AppModel.swift - App coordinator → Vector index: opens index
App/AppModel.swift - App coordinator → Query parser: parses queries
App/AppModel.swift - App coordinator → Browse and results: updates results
App/AppModel.swift - Mac user → Browse and results: browses
- App coordinator → Embedding projection: projects embeddings
App/FolderEmbeddingVisualization.swift - Embedding projection → Omni embedding engine: uses GPU engine
Sources/OmniKit/ProjectionEngine.swift - App coordinator → Serving controller: owns serving
App/Serving/ServingController.swift - Serving controller → Serving backend: attaches backend
App/Serving/ServingController.swift - Serving controller → HTTP server: starts server
App/Serving/ServingController.swift - Serving controller → Request router: configures routes
App/Serving/ServingController.swift - HTTP server → Request router: dispatches requests
- Request router → MCP adapter: routes MCP
App/Serving/Router.swift - Request router → Sources API: routes sources
App/Serving/Router.swift - MCP adapter → Serving backend: calls backend
App/Serving/MCPAdapter.swift - API or MCP client → HTTP server: sends requests
- Serving backend → Omni embedding engine: embeds queries
App/Serving/ServingBackend.swift - Serving backend → Vector index: searches index
App/Serving/ServingBackend.swift - OCR interface → OCR model: transcribes
- Index pipeline → OCR model: OCR for scans