learning_ai_notes/docs/SMART_ACTIONS_USER_GUIDE.md

181 lines
6.4 KiB
Markdown

# Smart Actions — User Guide
> NoteLett's AI-powered features for transforming, analyzing, and enriching your notes.
---
## What are Smart Actions?
Smart Actions use large language models (LLMs) to help you work with your notes — summarizing, rewriting, extracting information, detecting duplicates, and more. They're available on both web and mobile.
---
## Getting Started
Smart Actions are gated behind the `notelett_smart_actions_enabled` feature flag. When enabled, you'll see the **Smart Actions** panel on note detail pages and a **Prompts** item in the sidebar.
### Requirements
- An LLM provider configured via environment variables (`LLM_PROVIDER`, `OPENAI_API_KEY`, etc.)
- Feature flag `notelett_smart_actions_enabled` set to `true`
---
## 20 Built-in Prompt Templates
### Transform
| Template | Description | Input | Output |
|----------|-------------|-------|--------|
| **Summarize** | Create a concise summary | text | new_note |
| **Shorten** | Condense while keeping key points | text | replace |
| **Expand** | Add more detail and examples | text | replace |
| **Bullet Points** | Convert to bullet points | text | replace |
| **Fix & Rewrite** | Fix grammar, improve clarity | text | replace |
| **Change Tone** | Rewrite in a different tone | text | replace |
| **Translate** | Translate to another language | text | new_note |
### Extract
| Template | Description | Input | Output |
|----------|-------------|-------|--------|
| **Extract Key Facts** | Pull out key facts and data | text | artifact |
| **Extract Action Items** | Find action items and tasks | text | artifact |
| **Parse Receipt** | Extract line items from receipt | image | artifact |
### Generate
| Template | Description | Input | Output |
|----------|-------------|-------|--------|
| **Continue Writing** | Continue from where you left off | text | replace |
| **Explain** | Explain selected concept | text | artifact |
| **Generate Outline** | Create a structured outline | text | new_note |
### Analysis
| Template | Description | Input | Output |
|----------|-------------|-------|--------|
| **Compare Notes** | Compare 2-5 notes side by side | multi-note | new_note |
| **Merge Notes** | Combine notes into one | multi-note | new_note |
| **Rate Food Label** | Analyze nutritional info | image | artifact |
### Export
| Template | Description | Input | Output |
|----------|-------------|-------|--------|
| **Shareable Summary** | Polished version for sharing | text | new_note |
| **Presentation Outline** | Slide-ready outline | text | new_note |
| **Email Draft** | Draft an email from notes | text | clipboard |
| **Social Post** | Generate a social media post | text | clipboard |
---
## Using Smart Actions
### On the Web
1. **Open a note** → the Smart Actions panel appears on the right
2. **Click any action** → it runs immediately on the current note
3. **View the result** → copy, save as new note, apply to note, or discard
4. **Suggest Tags** → click to get AI-suggested tags, then accept individually
### On Mobile
1. **Open a note** → tap **Smart Actions** to expand the panel
2. **Tap an action** → runs and shows result inline
3. **Quick Capture** → 6 capture modes: Text, Photo, Voice, URL, Scan, Paste
### Custom Templates
1. Navigate to **Prompts** in the sidebar
2. Click **Create Custom Prompt**
3. Fill in name, category, system prompt, and user prompt template
4. Use template variables: `{{note.title}}`, `{{note.body}}`, `{{note.tags}}`
---
## Intelligence Features
### Reading Time (F10)
Displayed automatically on every note — word count and estimated reading time.
### Tag Suggestions (F5)
Click "Suggest Tags" to get 3-5 AI-suggested tags based on note content.
### Duplicate Detection (F8)
When `notelett_duplicate_check_enabled` is on, similar notes are flagged after save.
### Related Notes (F9)
When `notelett_suggest_links_enabled` is on, related notes are suggested for linking.
### Knowledge Gaps (F12)
Navigate to a workspace → **Knowledge Gaps** to analyze topic coverage and find gaps.
### Auto-Summarize (F6)
When `notelett_auto_summarize_enabled` is on, long notes (300+ words) get automatic summaries.
---
## Scheduled Actions (F25)
Create scheduled prompts that run automatically:
1. Go to the scheduler API: `POST /api/prompt-schedules`
2. Set a cron expression (e.g., `0 17 * * 5` for every Friday at 5pm)
3. Choose a template and workspace
4. The scheduler runs every 60 seconds and matches due schedules
**Weekly Digest (F11)**: A special scheduled action that summarizes all notes created/modified in a workspace that week.
---
## Webhook-Triggered Actions (F26)
Set up webhooks to run prompts when events occur:
- `note.created` — when a note is created
- `note.updated` — when a note is updated
- `note.tagged` — when a note is tagged
- `external` — triggered via API
---
## Approval-Gated Actions (F27)
Templates with `requiresApproval: true` create proposed actions instead of applying immediately. Review and approve/reject via the existing approval queue.
---
## Feature Flags
| Flag | Default | Controls |
|------|---------|----------|
| `notelett_smart_actions_enabled` | false | All Smart Actions UI + API |
| `notelett_auto_summarize_enabled` | false | Auto-summarize on save |
| `notelett_duplicate_check_enabled` | true | Duplicate detection |
| `notelett_suggest_links_enabled` | true | Auto-link suggestions |
| `notelett_auto_link_enabled` | false | Auto-link on save |
| `notelett_copilot_llm_enabled` | false | Editor AI (F1-F4) |
| `notelett_voice_capture_enabled` | false | Voice-to-note |
| `notelett_scheduled_actions_enabled` | false | Scheduled actions |
| `notelett_webhooks_enabled` | false | Webhook triggers |
---
## Environment Variables
| Variable | Description |
|----------|-------------|
| `LLM_PROVIDER` | Provider type: `azure`, `openai`, or `mock` |
| `OPENAI_API_KEY` | OpenAI API key (for openai provider) |
| `AZURE_OPENAI_ENDPOINT` | Azure OpenAI endpoint URL |
| `AZURE_OPENAI_KEY` | Azure OpenAI key |
| `AZURE_OPENAI_DEPLOYMENT` | Azure deployment name |
| `LLM_EMBEDDING_MODEL` | Embedding model override |
---
## MCP Tools (for AI Agents)
| Tool | Description |
|------|-------------|
| `notes.prompts.run` | Run any prompt template on a note |
| `notes.intelligence.suggest_tags` | Suggest tags for a note |
| `notes.intelligence.check_duplicates` | Check for duplicate notes |
| `notes.intelligence.suggest_links` | Suggest related notes to link |