๐Ÿ“– Turn your portfolio into an AI assistant with OpenAI, Claude, Pinecone and Gmail

โšก 28 views ยท ๐Ÿ“– Internal Wiki & Knowledge Base

Description

Deploy a personal AI assistant that answers recruiter questions about your skills and projects, then automatically emails your CV as a PDF attachment when requested. Upload your portfolio documents (resume, project writeups, case studies) to a Google Drive folder โ€” the workflow chunks them into 600-character segments, embeds them with OpenAI, and stores them in Pinecone. A webhook-powered AI Agent (Claude Sonnet 4.5) retrieves the most relevant evidence using Pinecone + Cohere reranking, detects CV requests via structured output parsing, and sends your resume file via Gmail โ€” all without any manual intervention.

How it works

Ingestion pipeline:

  1. Two Google Drive poll triggers fire every minute, detecting newly created or updated files in your monitored portfolio folder
  2. Files are downloaded and enriched with metadata (source filename and upload timestamp)
  3. The Default Data Loader extracts text from the binary file, the Recursive Character Text Splitter chunks it at 600 characters with 100-character overlap, and OpenAI text-embedding-3-small produces 1536-dimension vectors
  4. Vectors are upserted into the portfolio-docs Pinecone index

Chat agent pipeline:

  1. A webhook at POST /webhook/portfolio-query receives { "chatInput": "...", "sessionId": "...", "email": "..." }
  2. Claude Sonnet 4.5 is instructed to call the portfolio_knowledge tool (a Vector Store Tool backed by Pinecone) before answering โ€” every response is grounded in retrieved evidence
  3. Cohere rerank-v3.5 reranks the top-5 Pinecone results to top-3 before they reach the LLM
  4. A Structured Output Parser enforces { "answer": "...", "cvRequested": false } โ€” the cvRequested boolean is set by the LLM when it detects recruiter intent
  5. An IF node branches on cvRequested: true โ†’ download CV PDF from Drive โ†’ Gmail attachment โ†’ respond { answer, cvSent: true }; false โ†’ respond { answer, cvSent: false } immediately
  6. Buffer Window Memory retains the last 10 messages per sessionId for multi-turn conversations

Error handling: An Error Trigger catches any node failure and extracts error_message, failed_node, workflow_name, and execution_url into a clean object โ€” ready to forward to Slack, email, or any alerting webhook.

Use cases

Setup

Prerequisites

Step 1 โ€” Configure credentials

In n8n โ†’ Settings โ†’ Credentials, create one credential for each service:

Credential nameService
Google Drive OAuth2Google Drive OAuth2
OpenAI APIOpenAI
Pinecone APIPinecone
Anthropic APIAnthropic
Cohere APICohere
Gmail OAuth2Gmail OAuth2

Step 2 โ€” Set your Google Drive folder ID

Open File Created Trigger and File Updated Trigger (do both). In the Folder to Watch field, switch to ID mode and paste your folder ID.

> Find your folder ID in the Drive URL: https://drive.google.com/drive/folders/YOUR_FOLDER_ID

Step 3 โ€” Set your CV file ID

Open Download CV PDF. In the File field, switch to ID mode and paste your CV file ID.

> Find the file ID in: https://drive.google.com/file/d/YOUR_FILE_ID/view

Step 4 โ€” Personalize the system prompt

Open Portfolio AI Agent and edit the system message:

Step 5 โ€” Ingest your documents

Move or upload your portfolio files into the monitored Drive folder. The ingestion pipeline will trigger automatically within one minute and populate Pinecone.

To verify ingestion: check your Pinecone index vector count โ€” it should increase after each file is processed.

Step 6 โ€” Test the chat endpoint

Send a POST request to your webhook URL:

curl -X POST https://your-n8n-instance/webhook/portfolio-query \
  -H "Content-Type: application/json" \
  -d '{"chatInput": "What are your main technical skills?", "sessionId": "test-1"}'

Expected response:

{ "answer": "...", "cvSent": false }

To test CV delivery, include "email": "your@email.com" and ask: "Can you send me the CV?".

Workflow details

๐Ÿ”— Nodes Used

Webhook, Google Drive, Gmail, Google Drive Trigger, AI Agent, Embeddings OpenAI

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup