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)
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:Using the AI Assistant
Inline AI Menu
Access AI features while editing:- Select text in the editor
- Click the AI icon or press
⌘/Ctrl + / - 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
AI Chat Panel
Have conversations with AI:- Click AI Chat button in sidebar
- Select a prompt template or start fresh
- Type your question or request
- AI responds in chat interface
- Iterate with follow-up questions
- Insert responses directly into documents
- 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:- Writing
- Analysis
- Creative
- Technical
- 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:- Navigate to Settings → AI
- Click “Add Prompt”
- Define:
- Name: Prompt identifier
- Description: What it does
- System message: AI behavior instructions
- Variables: Dynamic placeholders
- Use in chat or inline menu
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
- Select paragraph or section
- Choose “Improve writing”
- AI enhances clarity, flow, and impact
- Compare original and improved versions
- 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
- Use “Blog post” template
- Provide topic and key points
- AI generates full draft
- Edit and refine
- 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
- Select text to translate
- Choose “Translate to…”
- Pick target language
- AI preserves formatting, links, code blocks
Code Assistance
Generate Code:- Paste code block
- Ask “Explain this code”
- Get line-by-line breakdown
- Understand complex logic
- 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
- 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:- Navigate to Workspace Settings → AI
- Enable “Document Embeddings”
- AI indexes workspace content
- Chat answers use your docs as context
- AI references your actual content
- More accurate, context-specific answers
- Cite sources from your workspace
- Private knowledge base
How Embeddings Work
How Embeddings Work
Vector Embeddings:
- Each document converted to numerical vector
- Semantic similarity measured by vector distance
- Fast retrieval using vector database (Elasticsearch/Manticore)
- Document content extracted
- Text split into chunks
- Chunks embedded via AI model
- Vectors stored in search index
- Updated on document changes
- User question embedded
- Similar vectors retrieved
- Relevant docs sent to AI as context
- 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
Image Generation (Fal Provider)
Generate images with AI:- Type
/imagein editor - Describe desired image
- Select model (DALL-E, Stable Diffusion, etc.)
- AI generates image
- Insert into document
- 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
| Action | Shortcut |
|---|---|
| Open AI menu | ⌘/Ctrl + / |
| Open AI chat | ⌘/Ctrl + Shift + A |
| Insert AI block | /ai |
| Continue writing | ⌘/Ctrl + J (after selection) |
| Accept suggestion | Tab |
| Reject suggestion | Esc |
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