Building Contacts from Emails
Hi, Just thought I'd share a little n8n / Ollama AI workflow I've been playing with. The aim is to be able to build a simple contacts list / database through scanning email content received, and analyzing it via AI to extract company details. Not finished by any means but it seems to be working well so far.
The tools I am using:
  1. n8n self hosted (on a Synology XEON based NAS, 48 GB RAM)
  2. MIcrosoft Outlook via M365
  3. Ollama - using the Mistral-small model which is hosted on a Razer 15" Notebook (RTX3080 GPU)
  4. MS SQL hosted on Linux / my Synology NAS
The major steps are as follows:
  1. I use the workflow name to identify the database I'm ultimately saving to
  2. I retrieve emails from 2 Outlook accounts and merge them into a single stream
  3. I filter unwanted email subjects or addresses to cut down the number of records to be processed
  4. I use a code node to isolate the primary email content (vs chained previous emails
  5. I use the AI agent with Mistral-small to interrogate the email body and extract company names, websites, addresses, phone numbers
  6. I write this to SQL, and remove duplicate records from the database, favoring those with more info over those with just an email address and name
Ultimately I'd like to transition from MS SQL to a Qdrant Vector database (also hosted on my Synology), however I am yet to get my head around how to set this up to ensure I get consistent results. for example queries for one name have returned vector results for another record's company name etc.
Anyway, this has been set up for a base for when I wish to import into a CRM, or for mailing lists etc.
I'd also like to add another AI node to isolate the email addresses from people, and ignore those from mailing lists etc. I've experimented with this with both ChatGPT and various Ollama LLMs, but am yet to get consistent intelligent filtering to work.
Happy for comments, feedback, improvements etc, as I'm still new to the I game.
Enjoy!
4
2 comments
James Walls
6
Building Contacts from Emails
AI Automation Society
skool.com/ai-automation-society
A community built to master no-code AI automations. Join to learn, discuss, and build the systems that will shape the future of work.
Leaderboard (30-day)
Powered by