Tech Specs

Core Components

  1. Data Models

struct Entry: Codable {
    let id: UUID
    let content: String
    let timestamp: Date
    let embeddings: [Float]
}

struct Cluster: Codable {
    let id: UUID
    let entries: [Entry]
    let threshold: Float
    let category: String?
}

  1. Training Data Structure

  • A training data manager to handle our training data

  • A model trainer service

  • A way to save and load our trained model

  1. NLP Processing

  • CoreML for text embeddings

  • Natural Language framework for tokenization

  • Local clustering using k-means algorithm

  • Threshold detection using cosine similarity

  1. Storage Layer

protocol StorageProvider {
    func saveEntry(_ entry: Entry) async throws
    func fetchClusters() async throws -> [Cluster]
    func updateCluster(_ cluster: Cluster) async throws
}
  1. UNPARTY Wrapper

  • REST API endpoints for processing

  • JWT authentication

  • Webhook support for cluster updates

  • Response handling for inference requests

  1. SwiftUI Views

struct EntryView: View {
    @StateObject var viewModel: EntryViewModel
    @State private var entries: [Entry] = []
    @State private var clusters: [Cluster] = []
}

struct ClusterView: View {
    let cluster: Cluster
    @State private var isProcessing: Bool = false
}

Processing Flow

  1. Entry Creation → Local NLP → Embedding Generation

  2. Cluster Detection → Threshold Check → Storage Update

  3. Wrapper Processing → Documentation Site API → Response Handling

  4. UI Update → Visualization → State Management

API Integration

struct WrapperEndpoint {
    static let base = "https://docs.unparty.app/api"
    static let process = "/process"
    static let inference = "/inference"
}

Demo Requirements

  • iOS 16.0+

  • CoreML 3.0+

  • Natural Language framework

  • Async/await support

  • Network connectivity

Last updated