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:
- The AI Summary (Rich Text/Markdown).
- Personal User Notes (Yellow-background callouts).
- 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
- Trigger: User shares URL via Mobile Share Sheet.
- Scrape:
CommonMainmodule calls Firecrawl API. - Store: Markdown is saved to
SavedLink. - Intelligence:
- If
AutoSummarize == true: Call LLM API -> Save tosummaryFull. - Update UI observers to reflect “Summary Ready.”
- If
The “RAG” (Ask AI) Workflow
- User Query: User asks “What is the timeline mentioned?”
- Context Assembly: App retrieves
SavedLink.markdownContentfrom SQLite. - Inference: App sends
[System Prompt] + [Markdown Content] + [User Query]to the selected LLM. - 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.