Skip to content

About

Native iOS and macOS document Q&A with PDF import, source excerpts, streaming Ollama responses, and local storage.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AI Document Assistant icon

AI Document Assistant

Ask questions about PDFs and text files, with a local document library and inspectable source excerpts.

iOS 15+ · macOS 12+ · Swift · MIT License

AI Document Assistant running in the iOS simulator with example data

What it does

  • 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.

Run

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.

Try it

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.

Implementation

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.

Verification

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.

Scope and limitations

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.

Data and privacy

See PRIVACY.md for storage and network behavior. Sample data is fictional.

License

MIT. Original source and app artwork are included under the same license.

About

Native iOS and macOS document Q&A with PDF import, source excerpts, streaming Ollama responses, and local storage.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages