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:
| Service | Role | Purpose |
|---|---|---|
| Document Analysis | Vision | Classify and extract document attachments |
| Email Classification | Text | Categorize incoming emails |
| Email Analysis | Text | Pull out action items and signals |
| Reminder Extraction | Text | Spot dated commitments and turn them into reminders |
| Email Chat | Text | Chat about a specific email thread |
| Draft Reply | Text | Generate email reply drafts |
| Compose Chat | Text | Assist while composing a message |
| Global Chat | Text | The Scout assistant |
Providers
Campbooks supports five providers. Three are vision-capable (needed for document analysis); all five handle text.
| Provider | Vision | Data residency | Env key |
|---|---|---|---|
| OpenAI | ✓ | US | OPENAI_API_KEY |
| Anthropic (Claude) | ✓ | US | ANTHROPIC_API_KEY |
| Gemini | ✓ | US | GEMINI_API_KEY |
| Mistral | — | EU | MISTRAL_API_KEY |
| DeepSeek | — | China | DEEPSEEK_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):
| Provider | Models |
|---|---|
| Anthropic | claude-sonnet-4-6, claude-haiku-4-5, claude-opus-4-7, claude-sonnet-4-5 |
| OpenAI | gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-4, o3-mini, o4-mini |
| Mistral | mistral-large-latest, mistral-medium-latest, mistral-small-latest, ministral-8b-latest |
| DeepSeek | deepseek-v4-pro, deepseek-chat, deepseek-reasoner |
| Gemini | gemini-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. WithSELF_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
- Go to Settings → AI and click Add adapter.
- Choose the provider (OpenAI, Anthropic, Mistral, DeepSeek, or Gemini).
- Enter the API key — or leave it blank to fall back to the instance env key (self-hosted).
- 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).
- 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.
Semantic search
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).