Animated data flow diagram

AI Agent Suite: Email Triage, PDF Q&A, and Smart Appointment Booking

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

OpenAI Anthropic Pinecone Gmail Google Calendar Slack

Overview

Unlock Advanced Business Automation with this AI Agent Suite

This n8n workflow bundle demonstrates a versatile set of AI-driven automations designed to tackle common business challenges. It features three distinct AI agents, each leveraging powerful Large Language Models (LLMs) and n8n's integration capabilities to streamline your operations.

1. AI Email Classification & Organization Agent This agent intelligently processes incoming emails, categorizes them based on content, and applies appropriate labels in Gmail. It's perfect for managing high volumes of emails, ensuring important messages are prioritized and organized efficiently.

  • Ability: Email Understanding & Sorting

2. AI PDF Knowledge Assistant (RAG) Transform your PDF documents into interactive knowledge bases. This agent ingests PDF files, creates vector embeddings of their content using OpenAI, stores them in Pinecone, and allows you to 'chat' with your documents. Ask questions and get precise answers sourced directly from your PDFs, ideal for research, customer support, or internal documentation.

  • Ability: Document Intelligence & Q&A

3. AI Smart Appointment Booking Agent Delegate appointment scheduling to this intelligent agent. Powered by an Anthropic LLM (Claude) and integrated with Google Calendar, it can understand natural language requests, check for availability, and book meetings directly into your calendar. It manages conversation context and uses tools to interact with the calendar API seamlessly.

  • Ability: Conversational Scheduling & Calendar Management

Key Features & Benefits

  • Automated Email Triage: Automatically categorizes emails (e.g., support, sales, project-specific) and applies Gmail labels using OpenAI (GPT-4o).
  • Intelligent PDF Querying: Leverage Retrieval Augmented Generation (RAG) to ask questions and get answers from your PDF documents (e.g., whitepapers, reports, manuals) using OpenAI and Pinecone.
  • AI-Powered Appointment Scheduling: An Anthropic-driven agent interacts with Google Calendar to check availability and book appointments based on chat inputs.
  • Modular Design: Each AI agent can be adapted or used as a foundation for more complex custom solutions.
  • Leverages Langchain Nodes: Utilizes n8n's robust Langchain integration for advanced AI functionalities like text splitting, embeddings, vector stores, and agent creation.
  • Extensible: Easily customize prompts, models, and connected systems to fit your specific needs.

Use Cases

  • For B2B SaaS: Automatically categorize inbound sales leads or support requests from email to specific CRM tags or team inboxes.
  • For B2C E-commerce: Answer customer queries about product manuals or FAQs by allowing them to 'chat with' your product documentation PDFs.
  • For Solopreneurs & Founders: Automate scheduling of discovery calls or consultations directly from a chat interface integrated with your Google Calendar.
  • For CTOs: Quickly build and deploy internal tools for knowledge retrieval from technical documents or company policies using the PDF RAG agent.
  • For Heads of Automation: Use as a blueprint to develop sophisticated multi-step AI agents that combine classification, information retrieval, and action-taking capabilities.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • OpenAI API Key with access to models like GPT-4o (for email classification and PDF RAG).
  • Anthropic API Key with access to a Claude model (for the appointment booking agent).
  • Pinecone account, API Key, and an existing index (e.g., 'whitepapers') for the PDF RAG agent.
  • Google Calendar API credentials (OAuth2 configured in n8n) for the appointment booking agent.
  • Gmail credentials (OAuth2 or App Password configured in n8n) for the email classification agent.

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.

For the AI Email Classification Agent: 3. Locate the 'On new email to nathan's inbox' (Gmail Trigger) node. Configure it with your Gmail credentials and desired listening criteria, or replace it with your preferred email trigger (e.g., IMAP). Note: This trigger is disabled by default in the template. 4. In the 'OpenAI Chat Model1' node (connected to 'Assign label with AI'), ensure your OpenAI credential is selected. 5. In the 'Assign label with AI' node, customize the categories and descriptions to match your email classification needs. 6. Configure the 'Add automation label' and 'Add music label' (Gmail) nodes with your Gmail credentials and desired labels. Adjust or add more label nodes as needed.

For the AI PDF Knowledge Assistant (RAG): 7. Configure the 'PDFs to download' (NoOp) node: Manually add JSON data for the PDFs you want to process (file_url, whitepaper_title, etc.) or modify the workflow to fetch this data dynamically. 8. Ensure the 'Download PDF' (HTTP Request) node can access the PDF URLs. 9. In the 'Embeddings OpenAI' node (underneath 'PDFs to download'), select your OpenAI credential. 10. Configure the 'Insert into Pinecone vector store' node with your Pinecone credentials, index name (e.g., 'whitepapers'), and namespace (e.g., 'whitepaper'). Ensure 'Clear Namespace' is set appropriately for first runs. 11. In the 'Recursive Character Text Splitter' and 'Default Data Loader' nodes, adjust chunking or metadata as needed. 12. For querying, in the 'OpenAI Chat Model' (connected to 'Question and Answer Chain'), select your OpenAI credential (GPT-4o recommended). 13. In the 'Embeddings OpenAI2' and 'Read Pinecone Vector Store' nodes, select your OpenAI and Pinecone credentials respectively. Ensure the Pinecone index and namespace match what was used for insertion. 14. The 'When chat message received' (Chat Trigger) node provides the interface for the PDF Q&A. Test it or integrate its webhook URL into your applications.

For the AI Smart Appointment Booking Agent: 15. In the 'Anthropic Chat Model' node, select your Anthropic credential. 16. In the 'Get calendar availability' (Tool HTTP Request) node: a. Configure the 'Authentication' and 'Node Credential Type' to use your Google Calendar OAuth2 credentials. b. Update the calendar ID in the items array within the jsonBody (e.g., "id": "your-email@example.com"). 17. In the 'Book appointment' (Tool HTTP Request) node: a. Configure 'Authentication' and 'Node Credential Type' similarly for Google Calendar. b. Update the calendar ID in the URL (e.g., calendars/your-email@example.com/events). c. Review placeholder definitions for userName, startTime, endTime, userEmail and ensure the LLM can provide these. 18. In the 'Appointment booking agent' node, review and customize the systemMessage. Select the LLM (Anthropic), Memory (Window Buffer), and Tools ('Get calendar availability', 'Book appointment'). 19. This agent can be triggered via API calls to the 'Appointment booking agent' node or integrated into a chat interface.

General: 20. Review all credential selections in nodes interacting with external services. 21. Activate the specific parts of the workflow or individual trigger nodes you intend to use.

Tags:

AI AgentAutomationOpenAIAnthropicRAGEmail AutomationPDF ProcessingAppointment SchedulingLangchain

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Schedule a Consultation