Skip to main content

NDI Flow

01 Taming Digital Chaos

Your Downloads folder is a graveyard. Files named 'final_v2_FINAL.pdf' live next to 'IMG_4521.jpg'. NDI Flow doesn't care about filenames. It reads the content, understands the meaning, and organizes by what files actually contain.

Core/SemanticAnalyzer.swift
// Semantic file analysis
struct SemanticAnalyzer {
    private let embedder: NLEmbedding
    private let classifier: DocumentClassifier

    func analyze(_ file: URL) async -> SemanticProfile {
        let content = try await extractContent(file)
        let embedding = embedder.vector(for: content)
        let category = classifier.classify(embedding)

        return SemanticProfile(
            embedding: embedding,
            category: category,
            topics: extractTopics(content),
            entities: extractEntities(content)
        )
    }
}

02 Intelligent Clustering

Files automatically group into semantic clusters. Your machine learning papers cluster together, regardless of whether they're PDFs, screenshots, or markdown notes. Related receipts find each other. Project assets naturally organize.

Clustering/ClusterEngine.swift
// Build semantic clusters
class ClusterEngine {
    func buildClusters(_ profiles: [SemanticProfile]) -> [Cluster] {
        let embeddings = profiles.map { $0.embedding }

        // HDBSCAN for variable-density clustering
        let clusters = HDBSCAN(
            minClusterSize: 3,
            minSamples: 2
        ).fit(embeddings)

        return clusters.map { indices in
            Cluster(
                files: indices.map { profiles[$0].file },
                centroid: computeCentroid(indices, embeddings),
                label: generateLabel(indices, profiles)
            )
        }
    }
}

03 Always Watching

FSEvents monitors your filesystem in real-time. New file appears? Instantly analyzed and placed in the right cluster. Move a file manually? NDI Flow learns your preferences and adjusts future suggestions.

Monitor/FileMonitor.swift
// Real-time file monitoring
class FileMonitor {
    private let stream: FSEventStream

    func startMonitoring(paths: [String]) {
        stream = FSEventStream(
            paths: paths,
            latency: 0.5,
            flags: [.fileEvents, .watchRoot]
        ) { events in
            Task {
                for event in events {
                    await self.processEvent(event)
                }
            }
        }
        stream.start()
    }

    private func processEvent(_ event: FSEvent) async {
        guard event.isFile else { return }
        let profile = await analyzer.analyze(event.path)
        await clusterManager.integrate(profile)
    }
}

04 Your Data, Your Mac

Every byte of processing happens on your Mac. No cloud uploads, no external APIs, no telemetry. The semantic embeddings stay in a local SQLite database. Your file organization habits are nobody's business.

Privacy/PrivacyGuarantee.swift
// Privacy-first architecture
struct PrivacyGuarantee {
    static let networkAccess = false
    static let cloudSync = false
    static let telemetry = false

    static func verify() -> Bool {
        // All ML models run locally
        assert(MLConfig.executionTarget == .local)

        // Database is local SQLite
        assert(Database.location == .applicationSupport)

        // No network entitlements
        assert(!Bundle.main.hasNetworkEntitlement)

        return true
    }
}
ndi_flow