Skip to Content

Classification

Opt-in sorting with a local model or any Mastra provider.

Classification is opt-in and off by default. Free plans cannot turn it on, including if Settings is bypassed: the desktop main process refuses classification, Ask AI, and saving a model key. Items stay Unsorted unless you sort them by hand. Pro unlocks BYOK models (including Ollama and any OpenAI-compatible base URL). Pro plus the hosted AI add-on can classify without a key after you opt in. When classification is off, every capture is saved as Unsorted with the reason classification not configured, and item chat stays idle. Nothing is sent to a model.

When you turn it on in Settings, captured text is sent only to the provider you chose. Classification runs in the desktop main process with Mastra. The Electron renderer never sees a model call.

The official Mastra Electron guide talks to a Mastra HTTP server from the renderer. Snibl does not do that. Captured text would then sit in a second process and need CORS/CSP holes. The classifier is an Agent from @mastra/core/agent with generate() and structuredOutput. Item chat is a second Agent with stream(). Both use Mastra's model router on @mastra/core@0.24.9. The model also returns a 1–2 sentence summary of the highlight, stored on the item. Older items without a summary simply omit that paragraph.

Local model

Pick Local model (Ollama or any OpenAI-compatible endpoint). Snibl calls { id: "ollama/<model>", url, apiKey } against the endpoint you set (default http://127.0.0.1:11434/v1). Text stays on the machine that runs that endpoint.

Any provider

Pick Any provider (model + API key). Paste a Mastra provider/model id and the API key for that provider. Snibl classifies through Mastra's router: { id: "provider/model", apiKey }. The key is passed on the model object, not through process env.

Examples from the bundled registry:

  • openai/gpt-4o-mini
  • anthropic/claude-sonnet-4-5
  • google/gemini-2.5-flash
  • xai/grok-4

See Mastra model providers and environment variables.

Custom OpenAI-compatible base URL

If the router does not list a provider, set a base URL. Snibl then uses { id: "provider/model", url, apiKey } against that host's /chat/completions. Sarvam AI is not in 0.24.9's router list; use https://api.sarvam.ai/v2 with model sarvam/sarvam-105b.

API key storage

The API key stays on this machine. When Electron safeStorage can use the OS secret store, the key is encrypted at rest in the local SQLite file. If the secret store is missing, Settings says so and the key is stored in that same local file in plaintext. Snibl never logs the key.

Test connection

Settings has Test connection. It sends a short sample (Please reply when you can.), not inbox items, to the chosen provider.

When Snibl refuses to guess

Failures do not silently pick a bucket. The item is Unsorted. The detail view does not show a confidence score. A quiet note can still explain the bucket:

  • Classification toggle off, provider none, missing key, or missing local URL: classification not configured
  • Model confidence below the threshold (default 0.55): Unsorted, reason includes the score and the model's explanation
  • Unknown bucket id from the model: Unsorted, with that id in the reason
  • Model error: Unsorted, classification failed: … (for example classification failed: invalid API key)

Buckets

Starting buckets live in data, not in a hardcoded switch:

IdNameFor
replyReplySomeone to answer later
exploreExplore / LearnArticles and research for yourself
docsDocsDocumentation to read or use
unsortedUnsortedNeeds review (system bucket)

The Unsorted bucket is not a classification target. The model only sees Reply, Explore / Learn, and Docs. You can add buckets later without changing the classifier's control flow.

On this page