MindLink


Project Specification: Nexus Archive (Working Title)

Concept: A Local-First, AI-powered link saving and research application.
Platform: Mobile (iOS/Android) via Kotlin Multiplatform (KMP).
Core Philosophy: User privacy via on-device management and user-provided API keys.


1. Technical Strategy

  • Framework: Compose Multiplatform (KMP).
  • Database: Room (SQLite)
  • Networking: Ktor for API communication.
  • Scraping Engine: Firecrawl (converts URLs to Markdown).
  • Intelligence: Openrouter (Ability sel use any AI model)
  • Security: API keys stored in System Keychain/EncryptedSharedPreferences.

2. Core User Features

A. Smart Ingestion & Library Management

  • Firecrawl Integration: Every saved link is processed into clean Markdown. Junk (ads, navbars) is stripped at the source.
  • Automated Metadata: Calculate “Reading Time” and extract “Source Domain” locally from the Markdown content.
  • AI Contextualizing: If “Auto-Summarize” is enabled, a background job triggers a summary immediately upon save.
  • Visual Status: Library cards must reflect state (e.g., New, Processing..., Summary Ready, Note Attached).

B. The “Hybrid” Article View

  • Unified Feed: Instead of separate tabs, the article view is a vertical stream containing:
    1. The AI Summary (Rich Text/Markdown).
    2. Personal User Notes (Yellow-background callouts).
    3. AI Chat History (Threaded conversation).
  • In-Place QA: A persistent input bar labeled “Ask about this article…” allowing the user to query the content using RAG (Retrieval-Augmented Generation).

C. Global “Ask AI” (Cross-Document Synthesis)

  • Global RAG: A dedicated navigation tab to ask questions across the entire library. (Planned for later)
  • Implementation: The app fetches summaries of relevant articles and feeds them as context to the LLM to identify trends or synthesize information.

D. User-Centric AI Settings

  • Token Health Dashboard: A visual progress bar tracking token usage based on API responses.
  • Prompt Configuration: UI toggles to change the “Style” of summaries (Concise vs. Detailed), which modifies the system prompt dynamically.

3. Data Schema

WIP


4. Key Workflows

The “Save” Workflow

  1. Trigger: User shares URL via Mobile Share Sheet.
  2. Scrape: CommonMain module calls Firecrawl API.
  3. Store: Markdown is saved to SavedLink.
  4. Intelligence:
    • If AutoSummarize == true: Call LLM API -> Save to summaryFull.
    • Update UI observers to reflect “Summary Ready.”

The “RAG” (Ask AI) Workflow

  1. User Query: User asks “What is the timeline mentioned?”
  2. Context Assembly: App retrieves SavedLink.markdownContent from SQLite.
  3. Inference: App sends [System Prompt] + [Markdown Content] + [User Query] to the selected LLM.
  4. Display: Response is streamed to the Hybrid Feed and stored in Interactions.

5. UI/UX Guidelines (Based on Mockups)

  • Theme: Dark-mode primary with high-contrast accent colors (Blue for actions, Gold for notes).
  • Typography: Clean sans-serif; prioritize readability in the Article View.
  • Components:
    • Badges: Use capsule-style badges for categories (e.g., “Tech”, “Recipe”).
    • Input: Floating “Analyze” bar on the dashboard for quick manual entry.
    • Navigation: Bottom bar (Library, Ask AI, Saved, Settings).

See the directory /design for mockups.


6. Privacy & Compliance

  • Zero-Server Footprint: No user data or API keys ever touch our backend.
  • Local Cache: Provide a “Clear Cache” button to remove local images and raw Markdown while keeping summaries.