Skip to content

shadow-byte-warrior/Email-summarizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

📧 Email Summarizer

Local LLM ETL Pipeline — Gmail → Ollama → Google Sheets

Extracts unread emails, summarizes each one with a fully local LLM, and loads structured results into a spreadsheet — zero external API calls, zero cost per run.

n8n Ollama TinyLlama


Stars Forks Last Commit


ExtractTransformLoad  ·  the whole pipeline runs on your own machine


📋 Table of Contents


🚀 What This Pipeline Does

Step Action
📥 Fetches the latest emails from Gmail
📄 Extracts subject + email body
🤖 Sends content to a local AI model (TinyLlama via Ollama)
Generates a short 2-line summary
📊 Stores subject + summary in Google Sheets

⚙️ Architecture

flowchart LR
    A[📥 Gmail Inbox] -->|OAuth2| B[n8n: Fetch Latest Emails]
    B --> C[📄 Extract Subject + Body]
    C --> D{{"🤖 Local LLM\nTinyLlama via Ollama"}}
    D -->|"Summarize in 2 lines"| E[✨ Generated Summary]
    E --> F[(📊 Google Sheets)]
Loading
📸 View the actual n8n workflow screenshot
n8n workflow architecture

🧠 AI Model Used

  • Model: tinyllama
  • Runs locally via:
    http://127.0.0.1:11434/api/generate
    
  • Prompt:
    Summarize this email in 2 lines only
    

📁 Output Format

Results land directly in Google Sheets:

subject summary
Email Title AI-generated short summary

🔌 Required Integrations

Gmail Google Sheets Ollama


🛠️ Setup Instructions

1. Import the workflow
  • Open n8n
  • Click Import
  • Upload My workflow.json from this repo
2. Configure Gmail
  • Connect your Gmail account
  • Ensure read access is enabled
3. Set up Ollama (local AI)

Install Ollama and run:

ollama run tinyllama

Make sure the API is running at:

http://127.0.0.1:11434
4. Configure Google Sheets
  • Connect your Google account
  • Ensure the target sheet has columns:
    • subject
    • summary
5. Run the workflow
  • Click Execute Workflow
  • Check results in Google Sheets

⚠️ Good to know: the workflow runs manually (can be automated later), only works while Ollama is running locally, and is subject to Gmail API rate limits.


🔐 Security

Do NOT expose:

  • Gmail credentials
  • Google Sheets API keys
  • Local Ollama endpoints

🗺️ Roadmap

██░░░░░░░░ 0 / 5 complete

  • Auto-trigger on new emails
  • Use GPT / OpenAI as a swappable cloud model option
  • Add spam filtering
  • Store full email + summary (not just the summary)
  • Build an analytics dashboard over summarized history


👨‍💻 Author

Arun Pandian — Data Analyst & Data Engineer

LinkedIn GitHub


If this saved you time, a star helps others find it.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors