Building a macOS Tray App with Ollama as Your Knowledge Base

Fazm Team··2 min read

Building a macOS Tray App with Ollama as Your Knowledge Base

The best productivity tools are the ones you can reach instantly. A macOS tray app with a global keyboard shortcut, connected to Ollama running locally, gives you a personal AI knowledge base that is always one keystroke away.

Why a Tray App

Menu bar apps on macOS have a unique advantage - they are always accessible without switching contexts. Hit your global shortcut, ask your question, get your answer, and you are back in your flow. No browser tab, no app switching, no loading screens.

The Architecture

The setup is straightforward:

  1. Ollama runs as a background service, serving your chosen model locally
  2. A Swift menu bar app registers a global keyboard shortcut (e.g., Cmd+Shift+Space)
  3. The app sends queries to Ollama's local API at localhost:11434
  4. Responses appear in a popover anchored to the menu bar icon

All inference happens on your machine. Your queries never leave your network.

Global Shortcut UX

The shortcut interaction matters more than the model quality. Users abandon tools with friction. The ideal flow:

  • Invoke: Global shortcut opens a text field
  • Query: Type your question, hit Enter
  • Response: Answer streams in the same popover
  • Dismiss: Escape or click away to close

Keep the UI minimal. A text field and a response area. No sidebar, no history panel, no settings cluttering the interaction. Put those behind a gear icon.

Loading Your Knowledge

The real power comes from loading your own documents into the knowledge base. Use Ollama's embedding models to index your notes, documentation, or project files. Store the embeddings in a local SQLite database. When you query, search embeddings first, then pass relevant chunks to the model as context.

This gives you a private, searchable AI that knows your specific domain - running entirely on your Mac with zero cloud dependencies.

Fazm is an open source macOS AI agent. Open source on GitHub.

More on This Topic

Related Posts