Ask questions about PDFs and text files, with a local document library and inspectable source excerpts.
iOS 15+ · macOS 12+ · Swift · MIT License
- Import selectable-text PDFs and UTF-8 text files.
- Retrieve relevant passages with deterministic keyword scoring.
- Stream answers from an Ollama-compatible chat endpoint and stop an in-progress response.
- Inspect the numbered passages supplied to the model alongside its answer.
Open AI Document Assistant.xcodeproj in Xcode 16 or later. The shared scheme has the same name. No third-party Swift packages are required. Builds were checked with Xcode 27; minimum OS declarations are not a claim that every older OS was runtime-tested.
Choose My Mac or an iPhone/iPad simulator. Import a file or use Add sample handbook.
For answers, install Ollama, download a model such as llama3.2, and run its server. Enter the server URL and model name in Model settings. The Mac default is http://localhost:11434. An iPhone needs an authenticated HTTPS endpoint; localhost refers to the phone itself. An optional bearer token is kept only in memory.
The chat API must return newline-delimited streaming JSON. A model, hosted backend, and credentials are not included.
Bundle identifier: com.dd.documentassistant.
Add the sample handbook and ask “When are project reviews?” after configuring a model. Expand the source excerpts and compare the answer with the document.
DocumentIndex splits and ranks passages without external dependencies. DocumentStore imports files off the main actor and writes the local library atomically. AnswerModel owns cancellable streaming requests, request generations, and response limits.
Run swift test for chunking, ranking, empty input, and stable passage IDs. The app builds for iOS and macOS. A live model endpoint is required to verify generated answers; core tests do not pretend to exercise an LLM.
Retrieval uses keyword overlap, not embeddings or a vector database. Scanned PDFs require OCR elsewhere. Imports are limited to 20 MB and 500,000 characters. Citations are model-generated and can be wrong; the source excerpts remain available for checking. There is no cross-document search or conversation history.
See PRIVACY.md for storage and network behavior. Sample data is fictional.
MIT. Original source and app artwork are included under the same license.
