Skip to content

Repository files navigation

SourceDesk

Download source Download app Build
Download ZIP Latest release Build status

A local-first AI research notebook for macOS. Collect sources — websites, PDFs, text, Markdown, DOCX — store everything on your Mac, and ask questions grounded in your research with citations.

Status: Code complete and organized; not yet built/verified in Xcode. Building requires Xcode 15+ (SwiftData macros do not ship with the Command Line Tools). See Building.

Highlights

  • Local-first. All notebooks, sources, chunks, chat history, and notes live in a SwiftData store on your Mac. Nothing is uploaded by SourceDesk itself.
  • RAG-grounded chat. Answers are generated from the sources you've collected, with [Source N] citation markers and a citation inspector.
  • Flexible AI providers. Ollama (fully local, detected — never auto-downloaded), OpenAI, and Anthropic Claude. API keys are stored in the macOS Keychain.
  • Web search. Optional Brave or DuckDuckGo results can be mixed into chat (Notebook + Web or Web Only modes), clearly separated from your sources.
  • Offline-first. A network monitor tracks connectivity; cloud features are blocked with helpful messages while offline or when Local-Only Mode is on.
  • Study tools. Ten generators — summary, key points, timeline, FAQ, quiz, flashcards, study guide, outline, quotations, and source comparison — with one-click "Save to Notes".
  • Unlimited sources. Add websites, PDFs, TXT, Markdown, HTML, DOCX, and pasted text in any quantity.
  • Import / export. Notebooks export to a documented .zip archive and can be imported back on the same or another Mac.

Download the app

Ready-to-run builds are attached to every tagged Release, and a fresh unsigned build is produced on demand via Actions → Build SourceDesk → Run workflow. Grab the .dmg, mount it, and drag SourceDesk into /Applications.

The app is unsigned (open-source, no paid Developer ID), so macOS asks the first time: right-click SourceDesk → Open instead of double-clicking. Everything else works like a normal installed Mac app.

Requirements

  • macOS 14 Sonoma or later
  • Xcode 15 or later (SwiftData build support) — the latest Xcode is recommended
  • Ollama for local models (optional)
  • API keys for OpenAI / Anthropic / Brave (optional)

Building

Clone or open the project, then:

  1. open SourceDesk.xcodeproj
  2. Select the SourceDesk scheme (⌘⇧<)
  3. Choose your team under Signing & Capabilities and (optionally) enable the App Group entitlement group.com.sourcedesk.app for shared storage. Without the entitlement the app falls back to a per-app store automatically.
  4. Run (⌘R).

The result is a normal macOS app: SourceDesk.app, built from the product folder. You can copy it into /Applications; open it from Finder, launch it from Spotlight, or pin it to the Dock. (For distribution to other Macs, use Archive → Distribute App, or wrap the .app in a .dmg.)

The Xcode project is generated by scripts/generate_project.py; re-run it if you add or remove source files.

Note: SwiftData @Model macros require Xcode's build system. A plain swift build from the terminal will fail with "external macro implementation not found" — this is expected and only affects Command Line Tool installs.

Getting Started

  1. Create a notebook (⌘N).
  2. Add sources (⌘U) — paste a URL, choose files, or paste text.
  3. Ask questions in the Research tab. Pick a search mode in the header.
  4. Inspect answers — click a citation pill to see the source excerpt.
  5. Generate study material in the Study Tools tab and save it to Notes.
  6. Move fast — press ⌘K for a command palette that jumps to any notebook, source, or tab.

Configuration

  • AI Providers — choose a local Ollama model (only models you've already installed are listed) or enter OpenAI/Anthropic API keys.
  • Privacy — enable Local-Only Mode to restrict everything to local processing, and Confirm before sending content to cloud AI for a warning before your questions (and retrieved source excerpts) leave your Mac.
  • Search — DuckDuckGo works with no key; Brave offers fuller results.
  • Advanced — chunk size, overlap, retrieval count, and semantic embeddings.

Architecture

See docs/ARCHITECTURE.md for the layout: models, the AI provider abstraction, ingestion pipeline, RAG flow, view models, and views.

Layout in brief:

SourceDesk/
├── App/            entry point, shared app state (AppState)
├── Models/         SwiftData models + SwiftData-free types (Types.swift)
├── Services/
│   ├── AI/         provider protocol, Ollama/OpenAI/Anthropic, AIManager
│   ├── Ingestion/  web download, text/document extraction, ingestion service
│   ├── RAG/        chunking, embeddings, vector store, pipeline
│   ├── Search/     DuckDuckGo + Brave providers, SearchManager
│   ├── Storage/    Keychain, notebook exporter/importer
│   └── StudyToolsService.swift
├── Utilities/      token estimate, chunking, text cleaning (pure Swift)
├── ViewModels/     observable view models
└── Views/          SwiftUI three-column interface

Data & Privacy

  • Notebook data: ~/Library/Application Support/SourceDesk/
  • API keys: macOS Keychain (service sourcedesk)
  • Your sources and notes stay local. Cloud AI and web search are opt-in and only send what's needed for the task you trigger, always with a clear indicator in the UI (toolbar online/offline pill, provider menu, privacy settings).

Testing

Unit tests in SourceDeskTests/ cover token estimation, chunking, vector math, citation parsing, robots handling, and more. Run them with ⌘U in Xcode.

License

MIT — see LICENSE.

Contributing

See CONTRIBUTING.md.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages