Skip to main content

AI Assistant

AFFiNE’s AI Assistant (also known as Copilot) brings the power of large language models directly into your workspace. Write faster, think clearer, and explore ideas with AI-powered features integrated seamlessly into the editor and whiteboard.
AI features require an active subscription and API key configuration. Check your workspace settings to enable AI capabilities.

Overview

The AI Assistant provides:
  • Writing assistance: Generate, rewrite, and improve text
  • Content creation: Brainstorm ideas and outlines
  • Editing tools: Fix grammar, tone, and clarity
  • Code generation: Write and explain code
  • Translation: Convert between languages
  • Summarization: Condense long documents
  • Q&A: Ask questions about your content

AI Providers

AFFiNE supports multiple AI providers:

OpenAI

GPT-4, GPT-4 Turbo, GPT-3.5 Turbo

Anthropic

Claude 3 Opus, Sonnet, Haiku (official & Vertex AI)

Google

Gemini Pro, Gemini Pro Vision (Generative AI & Vertex)

Others

  • Perplexity (web search capabilities)
  • Fal (image generation)
  • Custom providers via API

Provider Configuration

Self-hosted instances can configure providers via environment variables:
# OpenAI
OPENAI_API_KEY=sk-...

# Anthropic
ANTHROPIC_API_KEY=sk-ant-...

# Google Gemini
GOOGLE_API_KEY=AIza...

# Perplexity
PERPLEXITY_API_KEY=pplx-...
AFFiNE Cloud users can enable AI through workspace settings.

Using the AI Assistant

Inline AI Menu

Access AI features while editing:
  1. Select text in the editor
  2. Click the AI icon or press ⌘/Ctrl + /
  3. Choose an AI action:
    • Continue writing: Extend your text
    • Improve writing: Enhance clarity and style
    • Fix grammar: Correct errors
    • Make shorter: Condense content
    • Make longer: Expand with details
    • Change tone: Adjust formality/casualness
    • Simplify: Use simpler language
    • Translate: Convert to another language
You can also type /ai in the editor to insert an AI-generated block.

AI Chat Panel

Have conversations with AI:
  1. Click AI Chat button in sidebar
  2. Select a prompt template or start fresh
  3. Type your question or request
  4. AI responds in chat interface
  5. Iterate with follow-up questions
  6. Insert responses directly into documents
Chat Features:
  • Context-aware: AI reads the current page
  • Multi-turn: Continue conversations
  • History: Review past chat sessions
  • Pin important: Save useful chats
  • Share: Export chat conversations

Prompt Templates

Pre-configured prompts for common tasks:
  • Blog post: Generate article outlines
  • Email: Compose professional emails
  • Social media: Create posts for platforms
  • Product description: Marketing copy
  • Press release: Company announcements

Custom Prompts

Create your own reusable prompts:
  1. Navigate to SettingsAI
  2. Click “Add Prompt”
  3. Define:
    • Name: Prompt identifier
    • Description: What it does
    • System message: AI behavior instructions
    • Variables: Dynamic placeholders
  4. Use in chat or inline menu
Example Custom Prompt:
Name: Technical Blog Post
Description: Convert technical notes to blog format

System Message:
You are a technical writer. Convert the user's notes into a well-structured blog post with:
- Engaging introduction
- Clear headings
- Code examples with syntax highlighting
- Practical takeaways
Tone: Professional but approachable

AI Features by Use Case

Writing Assistance

Continue Writing:
  • Place cursor at end of text
  • Press ⌘/Ctrl + / → “Continue writing”
  • AI extends your content naturally
  • Accept, regenerate, or edit
Improve Writing:
  • Select paragraph or section
  • Choose “Improve writing”
  • AI enhances clarity, flow, and impact
  • Compare original and improved versions
Fix Grammar:
  • Select text with errors
  • Choose “Fix grammar”
  • AI corrects spelling, punctuation, grammar
  • Maintain your original meaning

Content Generation

Generate Outlines:
  • Start with topic or title
  • Ask AI to “create an outline for [topic]”
  • Get hierarchical structure
  • Expand sections as needed
Blog Posts:
  • Use “Blog post” template
  • Provide topic and key points
  • AI generates full draft
  • Edit and refine
Meeting Notes:
  • Describe meeting context
  • AI creates structured agenda
  • Includes sections for notes, decisions, action items

Translation

Translate content while preserving formatting: Supported Languages:
  • English, Spanish, French, German
  • Chinese (Simplified/Traditional), Japanese, Korean
  • Portuguese, Italian, Dutch, Russian
  • Arabic, Hindi, and 50+ more
How to Translate:
  1. Select text to translate
  2. Choose “Translate to…”
  3. Pick target language
  4. AI preserves formatting, links, code blocks

Code Assistance

Generate Code:
Prompt: "Write a Python function to sort a list of dictionaries by a key"

AI Response:
def sort_by_key(items, key):
    return sorted(items, key=lambda x: x[key])
Explain Code:
  • Paste code block
  • Ask “Explain this code”
  • Get line-by-line breakdown
  • Understand complex logic
Debug Code:
  • Share error messages
  • AI identifies issues
  • Suggests fixes
  • Explains root cause

Summarization

Document Summary:
  • Open long document
  • Click AI chat → “Summarize this page”
  • Get concise overview
  • Extract key insights
Meeting Summary:
  • Paste meeting transcript
  • Request “Summarize with action items”
  • Get structured summary
  • Identify tasks and owners

Workspace AI Features

Workspace Search (Coming Soon)

AI-powered semantic search:
  • Ask natural language questions
  • Search by concept, not just keywords
  • Get relevant results across all pages
  • Summarize findings

Document Embeddings

Enable context-aware AI:
  1. Navigate to Workspace SettingsAI
  2. Enable “Document Embeddings”
  3. AI indexes workspace content
  4. Chat answers use your docs as context
Benefits:
  • AI references your actual content
  • More accurate, context-specific answers
  • Cite sources from your workspace
  • Private knowledge base
Vector Embeddings:
  • Each document converted to numerical vector
  • Semantic similarity measured by vector distance
  • Fast retrieval using vector database (Elasticsearch/Manticore)
Indexing Process:
  1. Document content extracted
  2. Text split into chunks
  3. Chunks embedded via AI model
  4. Vectors stored in search index
  5. Updated on document changes
Query Process:
  1. User question embedded
  2. Similar vectors retrieved
  3. Relevant docs sent to AI as context
  4. AI generates answer using docs

AI Workflows

Automate complex AI tasks: Available Workflows:
  • Brainstorm: Generate and organize ideas
  • Presentation: Create slide decks from notes
  • Image Filter: Process and tag images
Workflow Architecture:
// Workflows are graphs of AI operations
Workflow: Brainstorm
  └── Node 1: Generate ideas (LLM)
      └── Node 2: Categorize ideas (LLM)
          └── Node 3: Expand top ideas (LLM)
              └── Node 4: Format as mind map

Image Generation (Fal Provider)

Generate images with AI:
  1. Type /image in editor
  2. Describe desired image
  3. Select model (DALL-E, Stable Diffusion, etc.)
  4. AI generates image
  5. Insert into document
Use Cases:
  • Concept art and illustrations
  • Diagrams and infographics
  • Social media graphics
  • Product mockups

Privacy and Security

Data Handling

Self-Hosted

  • Full control over AI API keys
  • Data sent directly to provider (OpenAI, etc.)
  • No data stored by AFFiNE servers
  • Configure on-premise LLM models

AFFiNE Cloud

  • Encrypted transmission to AI providers
  • Temporary context only (not stored long-term)
  • Workspace embeddings stored securely
  • GDPR and SOC 2 compliant

Best Practices

  • Avoid sensitive data: Don’t include passwords, API keys, PII in prompts
  • Review outputs: AI can make mistakes—always verify
  • Use embeddings carefully: Only index non-sensitive content
  • Set permissions: Control who can use AI features

Keyboard Shortcuts

ActionShortcut
Open AI menu⌘/Ctrl + /
Open AI chat⌘/Ctrl + Shift + A
Insert AI block/ai
Continue writing⌘/Ctrl + J (after selection)
Accept suggestionTab
Reject suggestionEsc

Pricing and Quotas

AFFiNE Cloud

  • Free tier: Limited AI requests per month
  • Pro tier: Higher quotas and advanced models
  • Team tier: Shared workspace quotas
  • Enterprise: Custom limits and on-premise options

Self-Hosted

  • Bring your own API keys: Pay providers directly
  • No AFFiNE quotas: Limited only by provider
  • Cost management: Monitor usage in provider dashboards

Troubleshooting

AI Not Responding

  • Check API keys: Verify keys are valid in settings
  • Quota exceeded: Check if you’ve hit rate limits
  • Model availability: Some models may be unavailable
  • Network issues: Ensure connection to provider

Poor Quality Outputs

  • Refine prompts: Be more specific
  • Try different model: Switch to GPT-4 or Claude
  • Provide context: Include relevant background
  • Iterate: Use follow-up prompts to improve

Slow Responses

  • Model speed: GPT-4 slower than GPT-3.5
  • Provider load: High demand can cause delays
  • Long context: Large documents take longer
  • Try streaming: Enable real-time response streaming

Future Roadmap

AI Search

Semantic search across all workspace content

Auto-categorization

AI-powered page tagging and organization

Meeting Transcription

Real-time voice-to-text with AI summaries

Data Analysis

AI-powered database insights and visualizations

Next Steps