Mosaic📔

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 KeyPurposeModel Type
botCurrent user: chat, tagging, summaries, diary generationGPT-4o, Claude, etc.
embeddingGenerating vector embeddings for semantic searchtext-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

ProviderProtocolExamples
OpenAI-compatible/chat/completions with Bearer authOpenAI, Ollama, Groq, Together AI, vLLM
Anthropic/messages with x-api-key authClaude 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 tags is empty

Auto Summary

Generates a one-line summary for each memo.

  • Default: Disabled
  • Setting: auto_summary_enabled
  • Output: Stored in memo.ai_summary field

Auto Diary

Automatically generates daily diary entries from memos created that day.

  • Default: Enabled
  • Settings:
    • auto_diary_enabled — Master toggle
    • auto_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_reply toggle
  • 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

  1. Open Admin Dashboard at http://your-server:8080/admin
  2. Go to AI Config section
  3. Toggle between OpenAI or Anthropic provider
  4. Enter: Base URL, API Key, Model name
  5. 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:

  1. Install Ollama
  2. Pull models:
    ollama pull llama3.2       # For chat/tagging
    ollama pull nomic-embed-text  # For embeddings
  3. In Admin Dashboard → AI Config:
    • Provider: OpenAI
    • Base URL: http://host.docker.internal:11434/v1
    • Model: llama3.2
  4. Repeat for embedding config with model nomic-embed-text

Note: Local models may be slower and less accurate than cloud APIs.

On this page