Email Summarizer
Summarize long email threads with key points and action items extraction. Built on top of the email skill for Gmail integration.
Features
- Thread Summarization: Extract concise summaries from long email threads
- Key Points Extraction: Identify the most important points from the conversation
- Action Items Detection: Automatically detect tasks, deadlines, and follow-ups
- Adjustable Length: Short, medium, or long summaries based on your needs
- Multiple Formats: Paragraph, bullet points, or numbered list output
- History Tracking: Keep a record of all generated summaries
Installation
cd skills/email-summarizer
npm install
npm run build
CLI Usage
# Summarize a thread
email-summarizer summarize <threadId>
# With options
email-summarizer summarize <threadId> --length short --format numbered
# View history
email-summarizer history
# Get specific summary
email-summarizer get <id>
# Show statistics
email-summarizer stats
# Check health
email-summarizer health
Options
--length, -l: Summary length - short, medium, or long (default: medium)
--format, -f: Output format - paragraph, bullet, or numbered (default: bullet)
--no-actions: Skip action item extraction
--profile, -p: Email profile to use (default: default)
API Usage
import { EmailSummarizerSkill } from '@openclaw/email-summarizer';
const summarizer = new EmailSummarizerSkill('default');
// Summarize a thread
const summary = await summarizer.summarize({
threadId: '123abc456def',
length: 'medium',
format: 'bullet',
extractActionItems: true
});
console.log(summary.summary);
console.log(summary.keyPoints);
console.log(summary.actionItems);
// Get history
const history = await summarizer.getHistory(10);
// Get statistics
const stats = await summarizer.getStats();
await summarizer.close();
How It Works
- Thread Retrieval: Fetches the entire email thread using the Gmail API
- Text Processing: Extracts and combines all message bodies
- Sentence Scoring: Scores sentences based on:
- Email-specific keywords (action, deadline, decided, etc.)
- Position in message (first/last sentences weighted higher)
- Presence of dates, times, numbers
- Summary Generation: Selects top-scoring sentences and formats them
- Action Item Detection: Uses pattern matching to find tasks and deadlines
- Storage: Saves summaries to SQLite for future reference
Action Item Patterns
The skill detects action items using patterns like:
- "Need to...", "Should...", "Must..."
- "Please...", "Action item:..."
- "Follow up on..."
- "Deadline is...", "By [date]..."
Action items include:
- Priority level (high/medium/low)
- Assignee (when detectable)
- Deadline (when specified)
Data Storage
Summaries are stored in SQLite at ~/.openclaw/skills/email-summarizer/summaries.db:
thread_summaries: Thread summaries with metadata
- Thread ID, subject, participants
- Summary text, key points, action items
- Length, format, creation date
Dependencies
@openclaw/email: For Gmail API access
sqlite3: For local data storage
Requirements
- Gmail account connected via
email skill
- OAuth credentials with Gmail scope
Error Handling
The skill handles common errors:
- Thread not found
- Empty threads
- Email skill connection issues
- Invalid thread IDs
1---2name: email-summarizer3description: Email Summarizer4---56# Email Summarizer78Summarize long email threads with key points and action items extraction. Built on top of the email skill for Gmail integration.910## Features1112- **Thread Summarization**: Extract concise summaries from long email threads13- **Key Points Extraction**: Identify the most important points from the conversation14- **Action Items Detection**: Automatically detect tasks, deadlines, and follow-ups15- **Adjustable Length**: Short, medium, or long summaries based on your needs16- **Multiple Formats**: Paragraph, bullet points, or numbered list output17- **History Tracking**: Keep a record of all generated summaries1819## Installation2021```bash22cd skills/email-summarizer23npm install24npm run build25```2627## CLI Usage2829```bash30# Summarize a thread31email-summarizer summarize <threadId>3233# With options34email-summarizer summarize <threadId> --length short --format numbered3536# View history37email-summarizer history3839# Get specific summary40email-summarizer get <id>4142# Show statistics43email-summarizer stats4445# Check health46email-summarizer health47```4849### Options5051- `--length, -l`: Summary length - `short`, `medium`, or `long` (default: `medium`)52- `--format, -f`: Output format - `paragraph`, `bullet`, or `numbered` (default: `bullet`)53- `--no-actions`: Skip action item extraction54- `--profile, -p`: Email profile to use (default: `default`)5556## API Usage5758```typescript59import { EmailSummarizerSkill } from '@openclaw/email-summarizer';6061const summarizer = new EmailSummarizerSkill('default');6263// Summarize a thread64const summary = await summarizer.summarize({65 threadId: '123abc456def',66 length: 'medium',67 format: 'bullet',68 extractActionItems: true69});7071console.log(summary.summary);72console.log(summary.keyPoints);73console.log(summary.actionItems);7475// Get history76const history = await summarizer.getHistory(10);7778// Get statistics79const stats = await summarizer.getStats();8081await summarizer.close();82```8384## How It Works85861. **Thread Retrieval**: Fetches the entire email thread using the Gmail API872. **Text Processing**: Extracts and combines all message bodies883. **Sentence Scoring**: Scores sentences based on:89 - Email-specific keywords (action, deadline, decided, etc.)90 - Position in message (first/last sentences weighted higher)91 - Presence of dates, times, numbers924. **Summary Generation**: Selects top-scoring sentences and formats them935. **Action Item Detection**: Uses pattern matching to find tasks and deadlines946. **Storage**: Saves summaries to SQLite for future reference9596## Action Item Patterns9798The skill detects action items using patterns like:99- "Need to...", "Should...", "Must..."100- "Please...", "Action item:..."101- "Follow up on..."102- "Deadline is...", "By [date]..."103104Action items include:105- Priority level (high/medium/low)106- Assignee (when detectable)107- Deadline (when specified)108109## Data Storage110111Summaries are stored in SQLite at `~/.openclaw/skills/email-summarizer/summaries.db`:112113- `thread_summaries`: Thread summaries with metadata114 - Thread ID, subject, participants115 - Summary text, key points, action items116 - Length, format, creation date117118## Dependencies119120- `@openclaw/email`: For Gmail API access121- `sqlite3`: For local data storage122123## Requirements124125- Gmail account connected via `email` skill126- OAuth credentials with Gmail scope127128## Error Handling129130The skill handles common errors:131- Thread not found132- Empty threads133- Email skill connection issues134- Invalid thread IDs