How memex-lab/memex works
Memex is a local-first AI journal: people capture fragments, which the app organizes into cards and knowledge and uses for insights and companion chat. The supplied tree and excerpts cover only native iOS/Android integration, not the Flutter product core or its AI, storage, and knowledge implementation. The graph therefore focuses on the evidenced platform bridge and its capture, media, backup, and background-execution capabilities; README-documented product stages are described but not assigned unsupported source paths.
Main entry points: ChannelRegistrar.kt Android channel registrar · ChannelRegistrar.swift iOS channel registrar · MainActivity.kt Android activity · AgentBackgroundChannelHandler.kt Agent background channel
Components 19
Platform Bootstrap
- Android activity
android/app/src/main/kotlin/com/weshop/memex/MainActivity.kt - Android channel registrar
android/app/src/main/kotlin/com/memexlab/memex/channels/ChannelRegistrar.kt - iOS app delegate
ios/Runner/AppDelegate.swift - iOS channel registrar
ios/Runner/ChannelRegistrar.swift
Capture & Links
- Clipboard preview
android/app/src/main/kotlin/com/memexlab/memex/channels/ClipboardPreviewChannelHandler.kt - Clipboard preview
ios/Runner/ClipboardPreviewChannelHandler.swift - App actions
ios/Runner/AppActionChannelHandler.swift - External file import
android/app/src/main/kotlin/com/memexlab/memex/channels/ExternalFileImportChannelHandler.kt
Media & Rendering
- Audio conversion
android/app/src/main/kotlin/com/memexlab/memex/channels/AudioConverterChannelHandler.kt - Audio conversion
ios/Runner/AudioConverterChannelHandler.swift - WebView rendering
ios/Runner/WebViewChannelHandler.swift
Background Agents
- Agent background channel
android/app/src/main/kotlin/com/memexlab/memex/channels/AgentBackgroundChannelHandler.kt - Agent status service
android/app/src/main/kotlin/com/memexlab/memex/AgentBackgroundService.kt - Agent background tasks
ios/Runner/AgentBackgroundTaskChannelHandler.swift
Storage & System
- Backup file access
android/app/src/main/kotlin/com/memexlab/memex/channels/BackupStorageChannelHandler.kt - Backup import
android/app/src/main/kotlin/com/memexlab/memex/channels/BackupImportChannelHandler.kt - iCloud path access
ios/Runner/StorageChannelHandler.swift - System actions
android/app/src/main/kotlin/com/memexlab/memex/channels/SystemActionsChannelHandler.kt
Other components
- Memex Flutter app
Connections 24
- Memex Flutter app → Android activity: invokes bridge
- Memex Flutter app → iOS channel registrar: invokes bridge
- Android activity → Android channel registrar: registers channels
android/app/src/main/kotlin/com/weshop/memex/MainActivity.kt - Android activity → Agent background channel: handles intents
android/app/src/main/kotlin/com/weshop/memex/MainActivity.kt - Android activity → Backup import: handles intents
android/app/src/main/kotlin/com/weshop/memex/MainActivity.kt - Android activity → External file import: handles intents
android/app/src/main/kotlin/com/weshop/memex/MainActivity.kt - Android activity → Backup file access: routes activity results
android/app/src/main/kotlin/com/weshop/memex/MainActivity.kt - Android channel registrar → Agent background channel: registers
android/app/src/main/kotlin/com/memexlab/memex/channels/ChannelRegistrar.kt - Android channel registrar → Clipboard preview: registers
android/app/src/main/kotlin/com/memexlab/memex/channels/ChannelRegistrar.kt - Android channel registrar → Audio conversion: registers
android/app/src/main/kotlin/com/memexlab/memex/channels/ChannelRegistrar.kt - Android channel registrar → Backup file access: registers
android/app/src/main/kotlin/com/memexlab/memex/channels/ChannelRegistrar.kt - Android channel registrar → Backup import: registers
android/app/src/main/kotlin/com/memexlab/memex/channels/ChannelRegistrar.kt - Android channel registrar → External file import: registers
android/app/src/main/kotlin/com/memexlab/memex/channels/ChannelRegistrar.kt - Android channel registrar → System actions: registers
android/app/src/main/kotlin/com/memexlab/memex/channels/ChannelRegistrar.kt - iOS app delegate → iOS channel registrar: registers channels
ios/Runner/AppDelegate.swift - iOS app delegate → App actions: routes links
ios/Runner/AppDelegate.swift - iOS channel registrar → Clipboard preview: registers
ios/Runner/ChannelRegistrar.swift - iOS channel registrar → Audio conversion: registers
ios/Runner/ChannelRegistrar.swift - iOS channel registrar → WebView rendering: registers
ios/Runner/ChannelRegistrar.swift - iOS channel registrar → Agent background tasks: registers
ios/Runner/ChannelRegistrar.swift - iOS channel registrar → iCloud path access: registers
ios/Runner/ChannelRegistrar.swift - iOS channel registrar → System actions: registers
- Agent background channel → Agent status service: starts or updates
android/app/src/main/kotlin/com/memexlab/memex/channels/AgentBackgroundChannelHandler.kt - Agent background tasks → Memex Flutter app: dispatches tasks
ios/Runner/AgentBackgroundTaskChannelHandler.swift