Skip to main content

AI Configuration

Campbooks uses AI for inbox triage, document analysis, draft replies, and the Scout assistant. AI is optional — the app runs fully without it, and these features light up once you add a provider key. You can mix providers and assign them to different jobs.

Two roles: text and vision

However many individual AI jobs there are, setup boils down to picking two models:

  • A text model — powers triage, chat, summaries, draft replies, and reminders. Any provider works.
  • A vision model — reads document attachments to classify and extract them. Must be a vision-capable provider (OpenAI, Anthropic, or Gemini).

If you set a single OpenAI key, it covers both roles plus the embeddings used for semantic search. That's the simplest possible setup.

The AI services

Under the hood, those two roles fan out across eight services, each of which can use a different provider if you want fine-grained control:

ServiceRolePurpose
Document AnalysisVisionClassify and extract document attachments
Email ClassificationTextCategorize incoming emails
Email AnalysisTextPull out action items and signals
Reminder ExtractionTextSpot dated commitments and turn them into reminders
Email ChatTextChat about a specific email thread
Draft ReplyTextGenerate email reply drafts
Compose ChatTextAssist while composing a message
Global ChatTextThe Scout assistant

Providers

Campbooks supports five providers. Three are vision-capable (needed for document analysis); all five handle text.

ProviderVisionData residencyEnv key
OpenAIUSOPENAI_API_KEY
Anthropic (Claude)USANTHROPIC_API_KEY
GeminiUSGEMINI_API_KEY
MistralEUMISTRAL_API_KEY
DeepSeekChinaDEEPSEEK_API_KEY

Data residency matters for GDPR. Mistral processes in the EU, which is why it's the preferred default for EU users; the others are international transfers, and DeepSeek (China) has no EU adequacy decision. The provider's region is shown in the AI settings so you can choose with eyes open.

Models

Each provider exposes several models; pick one per service (the default in bold):

ProviderModels
Anthropicclaude-sonnet-4-6, claude-haiku-4-5, claude-opus-4-7, claude-sonnet-4-5
OpenAIgpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-4, o3-mini, o4-mini
Mistralmistral-large-latest, mistral-medium-latest, mistral-small-latest, ministral-8b-latest
DeepSeekdeepseek-v4-pro, deepseek-chat, deepseek-reasoner
Geminigemini-2.5-flash, gemini-2.5-pro, gemini-2.0-flash, gemini-1.5-pro, gemini-1.5-flash

Where keys come from

There are two ways to provide keys:

  • Self-hosted (instance-wide): set the provider env keys above in .env. With SELF_HOSTED=1, the app reads them and every workspace can use AI without entering its own key.
  • Per-workspace (bring your own): a user adds a key in Settings → AI. It's encrypted at rest and scoped to that workspace.

Adding an AI adapter

  1. Go to Settings → AI and click Add adapter.
  2. Choose the provider (OpenAI, Anthropic, Mistral, DeepSeek, or Gemini).
  3. Enter the API key — or leave it blank to fall back to the instance env key (self-hosted).
  4. Optionally set a custom endpoint URL to route through an OpenAI-compatible gateway or a self-hosted/local model server (the URL is validated to block requests to internal infrastructure).
  5. Pick the model.

Then assign the adapter to the services that should use it — or just set the two roles during setup and let them fan out.

Assigning adapters to services

Each service can use a different adapter. In Settings → AI, expand a service and pick its adapter. The change takes effect immediately — so you can run a fast, cheap model for classification and a more capable one for analysis and chat.

Document analysis requires a vision provider. If you assign a text-only provider (DeepSeek or Mistral) to Document Analysis, the app won't let you save it. Use OpenAI, Anthropic, or Gemini for that service.

Embeddings power semantic search across email and documents and are produced by OpenAI or Gemini. With neither configured, search still works — it falls back to keyword (ILIKE) matching.

Testing

After configuring an adapter, test it by sending a message in Scout or reprocessing a document. If something errors, check that the API key and (if set) the endpoint are correct, the model name is one the provider accepts, and the provider supports the feature you're using (e.g. vision for document analysis).