AI Features
How to configure and use AI-powered features in Mosaic
AI Features
Mosaic integrates AI for automatic tagging, summaries, diary generation, and conversational bot replies. All AI features are optional and require configuring an AI provider.
Architecture
Mosaic separates per-user chat configuration from server-wide embeddings:
| Config Key | Purpose | Model Type |
|---|---|---|
bot | Current user: chat, tagging, summaries, diary generation | GPT-4o, Claude, etc. |
embedding | Generating vector embeddings for semantic search | text-embedding-3-small, etc. |
Chat features read user_ai_configs. In the administrator AI panel, bot edits
the signed-in administrator’s chat configuration. Manage another user’s chat
configuration through the Users page or /admin/api/users/{userId}/ai-config.
Users can manage their own configuration at /api/user/ai-config. The
embedding configuration is shared server-wide. Each may use its own provider.
Supported Providers
| Provider | Protocol | Examples |
|---|---|---|
| OpenAI-compatible | /chat/completions with Bearer auth | OpenAI, Ollama, Groq, Together AI, vLLM |
| Anthropic | /messages with x-api-key auth | Claude 3.5 Sonnet, Claude Opus |
Available Features
Auto Tagging
Automatically suggests tags when you create a memo without tags.
- Default: Enabled
- Setting:
auto_tag_enabled - Trigger: On memo creation when
tagsis empty
Auto Summary
Generates a one-line summary for each memo.
- Default: Disabled
- Setting:
auto_summary_enabled - Output: Stored in
memo.ai_summaryfield
Auto Diary
Automatically generates daily diary entries from memos created that day.
- Default: Enabled
- Settings:
auto_diary_enabled— Master toggleauto_diary_min_memos— Minimum memos to trigger (default: 2)auto_diary_min_chars— Minimum total character count (default: 150)
- Trigger: After a memo is created meeting the thresholds
- Locking: Manual edits lock a diary against automatic regeneration
Bot Replies
AI-powered bots that reply to your memos automatically.
- Per-bot setting: Each bot has an
auto_replytoggle - Trigger: Keyword matching on memo content
- Context: Bots can be configured to use memory (previous memos) via the Memory System
The first reply and every follow-up share one set of general conversational rules — there are no per-bot few-shot examples. The rules keep the bot's own persona, humour and manner of address, but also:
- Answer what was actually said. A casual remark, joke or photo usually gets a brief reaction of one to four sentences; advice is offered when it is asked for or when a concrete risk needs attention.
- Do not read minds. An unspoken motive stays unknown. The reply describes observable behaviour and keeps uncertainty about motives and causes.
- Avoid empty filler. Skip repeated summaries, stock reassurance, forced profundity and rhetorical reframing such as "not X but Y".
- Use old memories carefully. Retrieved memories are treated as possibly relevant historical excerpts. One is mentioned only when it clearly helps the current topic, its timestamp is preserved, and pronoun references across records are never merged without evidence. The current message outweighs older context.
Reasoning, drafts and internal commentary stay out of the reply.
Configuration
Via Admin Dashboard
- Open Admin Dashboard at
http://your-server:8080/admin - Go to AI Config section
- Toggle between OpenAI or Anthropic provider
- Enter:
Base URL,API Key,Model name - Click Save for each config
Via API
PUT /admin/api/ai-config/bot
{
"provider": "openai",
"baseUrl": "https://api.openai.com/v1",
"apiKey": "sk-...",
"model": "gpt-4o",
"temperature": 0.7,
"maxTokens": 2048,
"timeoutSeconds": 30
}Running AI Locally (Ollama)
For full privacy, you can run local models with Ollama:
- Install Ollama
- Pull models:
ollama pull llama3.2 # For chat/tagging ollama pull nomic-embed-text # For embeddings - In Admin Dashboard → AI Config:
- Provider: OpenAI
- Base URL:
http://host.docker.internal:11434/v1 - Model:
llama3.2
- Repeat for embedding config with model
nomic-embed-text
Note: Local models may be slower and less accurate than cloud APIs.