← All sessionsHomeSearch
C7 EST | 14 Day AI Sprint·Day 4 | Agentic AI: Build Your First AI Employee·5:01:00

Day 4: Your First AI Employee — Brain/Memory/Tools/Prompt, a Pinecone RAG Support Agent in n8n, and When NOT to Use an Agent

Harshad Tyagi Day mentor - runs AI automation agency 'Agentwise' (as-heard; started Feb 2025, ~$500K ARR, team of 4-5, two SaaS products); earlier algorithm engineer for research groups at Yale/UCLA/MIT (2017-19), then course design for Udacity, LinkedIn Learning, O'Reilly, Coursera; co-hosts the office hour with Cameron · Cameron Office-hours co-mentor - agency owner; answers the video/image and cold-outreach questions · Uthappa Host - agenda, roadmap for the weekend, breakout and reflection logistics

The short version

  1. An agent is four things, taught as hiring an executive: BRAIN (the LLM), MEMORY (prior interactions - a contextual choice, not a default), TOOLS/skills (what it can do - keep the set narrow), and the SYSTEM PROMPT - 'probably the most important element', the one you keep polishing for months.
  2. Why this agent: ecommerce runs on marketing and customer experience; '90-95%' of support emails are repetitive and answerable from policy docs. Map the human SOP on paper first - 'if your manual SOP is bad, automation will be bad.'
  3. Architecture: Gmail trigger -> extract body/sender/thread ID/subject -> cheap classifier returns {customer_support: true/false} as JSON -> Switch (no = stop, saves tokens) -> AI Agent with a RAG tool over the policy doc and a Gmail 'create draft' tool that replies IN THREAD -> Slack summary for a human to approve. Live test: a defective-product email produced a correct 30-day-policy draft signed 'Kelly from Sleepy Owl'.
  4. RAG made concrete: chunk -> embed (numbers, because 'machines understand... numbers') -> store chunk+vector in Pinecone -> embed the question -> nearest chunks. Dimensionality via a 2-D fruit analogy scaled to 1024. Ingestion is a one-time job separate from the runtime query path; chunk size 500 with 100 overlap so no answer is split across a boundary.
  5. Two settings that make LLM steps usable in automation: Output Format = JSON Object (otherwise a JSON-looking string is not a draggable variable; JSON Schema for multi-field extraction) and pinning the trigger's test data so new inbox mail does not replace your fixture.
  6. Closing rule: 'AI agent is not required everywhere.' Reserve agent nodes for dynamic, tool-choosing steps; fixed input/output logic belongs in plain LLM, filter, and switch nodes.

The concepts

01

Brain, memory, tools, system prompt: the four components of an agent

You are hiring an executive: a mind, a memory of past meetings, a set of skills, and a job description. The job description is where all the time goes.

Brain = the LLM doing the reasoning. Memory = a store of previous interactions so the agent has continuity - and it is a judgment call: a website chatbot needs it because users expect the session to remember; an email agent does not, because 'the full thread is already retrievable' and conversations resume weeks later. Tools (skills in the hiring analogy) are what let the agent act - read a doc, query a database, create a draft; give a narrow, high-quality set, 'specialists not generalists', and split into sub-agents when the list grows. The system prompt encodes guardrails, how to interpret queries, and when to call which tool; it is 'probably the most important element' and is refined for months against varied real queries.

The explicit design decision to leave memory out of the support agent while insisting the same brand's website bot would need it is the lesson: components are choices, not a checklist.

Why it matters

Every agent debate later in the sprint - and in Paul's Catalyst sessions on sub-agents and harnesses - is an argument about one of these four boxes.

The four components of an AI agent (Day 4) - and the choices made for the support agent BRAIN the LLM GPT-4.1 mini MEMORY prior turns OMITTED - email threads persist TOOLS / SKILLS what it can DO RAG lookup Gmail Create Draft SYSTEM PROMPT behaviour, guardrails, when to call which tool "most important" Keep the tool set NARROW - specialists, not generalists; split into sub-agents when tools multiply Memory is a modality choice: a live website chatbot needs it, a threaded email agent does not The prompt is where the months go: refine it against varied real queries
The four components as taught on Day 4, with the design decision made for the email support agent: memory omitted, tools narrowed to RAG + draft.
Go deeper

In one line: Agent = LLM brain + optional memory + narrow tool set + a system prompt that governs behaviour and tool use; choose memory by interaction modality.

Four components: brain (LLM), memory, tools/skills, system prompt (l3186022 0:30)

System prompt is the quality-determining component; expect months of iteration (l3186022 0:34, 1:02)

Memory omitted for email (thread persists externally); required for a live website chatbot (l3186022 1:20-1:24)

Narrow tool sets; specialists over generalists; sub-agents when tools multiply (l3186022 0:33)

▶ Watch this taught:

02

RAG mechanics: chunks, vectors, 1024 dimensions, and the one-time ingestion job

Apple, orange and grapes sit together on the graph; the MacBook sits far away. Now imagine that graph has a thousand axes.

The problem: pasting a whole policy document into a prompt overflows context and invites hallucination. So: (1) chunk the document, (2) embed each chunk into a numeric vector with an embedding model - 'machines understand binary language. Numbers', (3) store chunk text + vector in a vector database, (4) at query time embed the question into the same space and retrieve the closest chunks. Dimensionality is explained with a 2-D fruit plot, then 'these balls are operating at 1024 dimensions', which the human brain 'cannot even comprehend.'

Ingestion is a separate, one-time workflow re-run only when the policy changes: Chat Trigger (file upload on) -> Extract from File (PDF, binary field data0) -> Pinecone Vector Store 'Insert Documents' with OpenAI text-embedding-3-small at 1024 dims, Recursive Character Text Splitter, chunk 500 / overlap 100 / batch 100 - 13 chunks into namespace 'ecom policy' in index 'customer support policy doc' (Pinecone free tier, 5 indexes). Chunk-size rule: ~500 characters when paragraphs answer discrete questions; larger when a whole page is needed. Overlap exists so an answer is never split across two chunks. The embedding model and dimension at query time MUST match ingestion.

Why it matters

Paul already runs RAG in Dify and n8n; this is the clearest statement in the KB of why chunk size, overlap and matching embedding dims matter.

Go deeper

In one line: RAG = chunk -> embed -> store (chunk+vector) -> embed query -> nearest-neighbour retrieve; ingestion is batch and separate from runtime; embedding model/dims must match on both sides.

Chunk -> embed -> vector store -> embed query -> similarity retrieve (l3186022 1:31-1:42)

2-D fruit analogy scaled to real models at ~1024 dimensions (l3186022 1:35-1:38)

Ingestion workflow: Chat Trigger (upload) -> Extract from File -> Pinecone Insert Documents (l3186022 1:52-1:58)

text-embedding-3-small, 1024 dims; Recursive Character splitter 500/100; batch 100; 13 chunks (l3186022 1:59-2:07)

Overlap prevents an answer straddling a chunk boundary; size by how self-contained paragraphs are (l3186022 2:02-2:05)

Pinecone free tier: 5 indexes, 1024-dim default (l3186022 1:53-1:54)

▶ Watch this taught:

03

The customer-support agent, node by node

how-to

The agent never sends anything. It drafts in the thread and pings Slack - a human presses send. That is the whole trust model.

Gmail Trigger 'On message received' (OAuth; poll every minute in production; Simplify ON to strip payload noise; PIN the test email so a security alert arriving mid-build does not replace your fixture). Edit Fields extracts email body (from snippet), sender email, thread ID, subject. OpenAI Message a Model (GPT-4.1 mini) classifies against a topic list (tracking, refunds/returns, subscription, technical, billing) and returns {"customer_support": true/false} with Output Format = JSON Object. Switch on that boolean: 'no' terminates - no tokens spent on irrelevant mail. AI Agent node (GPT-4.1 mini brain, no memory, trigger source 'defined below', input = subject + body) with two tools: Vector Store Question Answer (Pinecone index/namespace, same embedding model, synthesis model GPT-4.1 mini) and Gmail Create Draft (subject/message 'let AI define', threadId = extracted thread ID so the draft lands IN the thread, to = sender). System prompt: role, read the email, use the knowledge-base tool, use the draft tool, then produce a concise summary; sign as 'Kelly from Sleepy Owl'. Slack Send Message posts that summary as the human-in-the-loop notification.

Live test: 'I've received a defective product. Can you explain what your return policy is?' -> the agent retrieved the 30-day return/refund policy and drafted a threaded reply. The team then assigns a simpler expense-tracker agent for the breakout and promises the CS agent JSON, prompt and policy PDF with the recording (import via the three-dot menu -> Import from file).

Do it in this order
Why it matters

This is the reference implementation for 'triage inbound, answer from policy, keep a human on send' - directly reusable for Paul's client support inboxes.

Go deeper

In one line: Gmail Trigger -> Edit Fields -> JSON classifier -> Switch -> AI Agent (RAG tool + threaded Gmail draft tool) -> Slack summary; human sends.

Pin trigger test data or new inbox mail replaces your fixture (l3186022 0:52-0:53)

Thread ID is extracted so the draft replies in-thread, not standalone (l3186022 0:56-0:57, 2:12-2:14)

'no' branch ends the flow - no agent tokens on non-support mail (l3186022 1:15)

Agent tools: Vector Store Question Answer (RAG) + Gmail Create Draft (l3186022 1:27, 2:08-2:14)

Slack summary = human-in-the-loop approval step (l3186022 2:18-2:25)

Live test: defective-product email -> correct 30-day policy draft signed 'Kelly from Sleepy Owl' (l3186022 2:20-2:21)

CS agent JSON + prompt + policy PDF distributed with the recording; import via three-dot menu (l3186022 2:26-2:32)

▶ Watch this taught:

04

JSON Object vs JSON Schema: making an LLM answer into a variable

The model wrote perfect JSON in its reply. n8n still saw a paragraph. One dropdown fixes it.

Whenever an LLM's answer feeds program logic (If, Switch) rather than a human, it must be structured. A chatty 'I have checked your email and this definitely looks like...' cannot be routed on; nor can JSON-shaped text inside a plain string. Setting Output Format = JSON Object on the OpenAI node makes the field a real, draggable variable. JSON Object suits a single pre-known field (the boolean here); JSON Schema is the right mode when you extract several fields with a structure defined up front. Verbosity was left at 'medium'.

The companion fundamental, re-taught mid-build: system prompt vs user prompt. The system prompt is the invisible behaviour/guardrail layer (why ChatGPT refuses certain requests on the same GPT model you can call via API); the user prompt is the content. A supplement brand's bot should refuse a ramen recipe not because it cannot answer but because the system prompt scopes it.

Why it matters

Day 3's one-word trick works; JSON output is the robust version and the reason later n8n workflows can branch on multiple extracted fields.

Go deeper

In one line: Output Format = JSON Object turns an LLM reply into a typed variable (single field); JSON Schema for multi-field extraction; system prompt = behaviour layer, user prompt = content.

LLM output feeding If/Switch must be structured, not prose (l3186022 1:07-1:08)

JSON Object for a single known field; JSON Schema for multi-field pre-defined extraction (l3186022 1:10-1:11)

Without the setting, JSON-looking text is still an unparseable string (l3186022 1:09-1:13, 1:43-1:44)

System prompt = invisible guardrails; ChatGPT is the API model plus OpenAI's system prompt (l3186022 1:00-1:04)

Business scoping (refuse off-topic) is a system-prompt job, not a model limit (l3186022 1:03)

▶ Watch this taught:

05

'AI agent is not required everywhere'

Beginners reach for the Agent node the way new cooks reach for the blowtorch.

Agent nodes earn their cost when the step is genuinely dynamic - interpreting free text and deciding which tool to call, in what order. When input and output are already known (classify this, format that, append a row), a plain LLM call, filter or switch is cheaper, faster and more predictable. Harshad names this as the most common mistake of less experienced builders, and the office hour reinforces it: use 'OpenAI send message' for fixed tasks, the agent node only when tool choice is real.

Related office-hour rulings: n8n vs Make.com (Make bills per module execution, expensive at scale); save workflows with Cmd/Ctrl+S, export JSON via the three-dot menu, push to GitHub; never share API keys - the shared test key is a liability, get your own at platform.openai.com (developer API, per-request billing) as distinct from chat.com (consumer subscription).

Why it matters

Cost and reliability both fall when you demote agent nodes to plain LLM calls wherever the logic is fixed.

Go deeper

In one line: Use AI Agent nodes only for non-deterministic, tool-choosing steps; use Message a Model / Filter / Switch for known input-output logic.

Agent nodes for dynamic multi-step logic only; simpler nodes for fixed I/O (l3186022 2:21-2:22)

Make.com bills per module execution - pricier at scale than n8n (l3302268 0:41)

Save (Ctrl+S), export JSON (three-dot menu), push to GitHub (l3302268 0:33-0:41)

platform.openai.com = developer API billing; chat.com = consumer subscription (l3302268 0:27-0:29)

Never share API keys - billing liability (l3302268 0:16-0:17, 0:39)

▶ Watch this taught:

06

Office Hour 2 distilled: likeness filters, upscalers, custom forms via webhook, offline RAG

Sora and Veo will not animate your uploaded face; HeyGen will. Knowing which tool has which policy saves an afternoon.

Video: Sora 2 and Google Veo reject real-person uploads (Sora's 'Cameo' is the sanctioned self-avatar route); HeyGen permits real people. Pixel upscalers (free online) preserve consistency better than latent upscalers when you only want resolution. Seamless loops: Sora has a native start/end match; otherwise split at a middle frame. Watermarks: free 'video inpainting' removers. Character consistency: image-to-video with reference images, never text-to-video, and an iterative feedback loop.

n8n: to keep a form on your own domain use a Webhook trigger instead of the n8n form node; Gmail-node failures with Google Sheets are usually a wrong Google account - unlink, relink, grant full access; production vs test URL on the form trigger. RAG: fully offline knowledge base via Msty 'knowledge stacks' (parallel stacks per domain, or Pinecone/Chroma if you want a real DB) paired with a vibe-coded front end later in the week. Ebooks: write and format by hand (Pages), Nano Banana for the cover. Email deliverability: convert video to GIF for HTML emails to avoid spam flags. Closing note from the mentors: no hand-holding - practice the worksheets, do Option 2, screenshot errors into chat.

Why it matters

Several of these (webhook-fronted forms, Sheets account mismatch, GIF-in-email) are the exact snags that eat client hours.

Go deeper

In one line: Likeness policies differ by tool; pixel > latent upscaling for consistency; own-domain forms via Webhook trigger; offline RAG via Msty stacks or Pinecone/Chroma; Sheets auth issues = account mismatch.

Sora 2 / Veo reject real-person uploads; Sora Cameo for self; HeyGen allows real people (l3302268 0:01-0:02)

Pixel upscalers preserve consistency better than latent ones (l3302268 0:05-0:06)

Custom-branded form -> n8n via Webhook trigger, not the form node (l3302268 0:06-0:07)

Offline RAG: Msty knowledge stacks (per-domain) or Pinecone/Chroma (l3302268 0:10-0:13)

Sheets-n8n failures: same Google account, unlink/relink, full access (l3302268 0:31-0:32)

HTML email: convert video to GIF to avoid spam filters (l3302268 0:09-0:10)

Character consistency = image-to-video with references, iterative loop (l3302268 0:13-0:15)

▶ Watch this taught:

Every concept, three clicks deep

The same concepts as a quick reference: the closed row is the glance, open is the study card, and every timestamp jumps into the recording.

01Brain, memory, tools, system prompt: the four components of an agentAgent = LLM brain + optional memory + narrow tool set + a system prompt that governs behaviour and tool use;

Agent = LLM brain + optional memory + narrow tool set + a system prompt that governs behaviour and tool use; choose memory by interaction modality.

Four components: brain (LLM), memory, tools/skills, system prompt (l3186022 0:30)

System prompt is the quality-determining component; expect months of iteration (l3186022 0:34, 1:02)

Memory omitted for email (thread persists externally); required for a live website chatbot (l3186022 1:20-1:24)

Narrow tool sets; specialists over generalists; sub-agents when tools multiply (l3186022 0:33)

02RAG mechanics: chunks, vectors, 1024 dimensions, and the one-time ingestion jobRAG = chunk -> embed -> store (chunk+vector) -> embed query -> nearest-neighbour retrieve;

RAG = chunk -> embed -> store (chunk+vector) -> embed query -> nearest-neighbour retrieve; ingestion is batch and separate from runtime; embedding model/dims must match on both sides.

Chunk -> embed -> vector store -> embed query -> similarity retrieve (l3186022 1:31-1:42)

2-D fruit analogy scaled to real models at ~1024 dimensions (l3186022 1:35-1:38)

Ingestion workflow: Chat Trigger (upload) -> Extract from File -> Pinecone Insert Documents (l3186022 1:52-1:58)

text-embedding-3-small, 1024 dims; Recursive Character splitter 500/100; batch 100; 13 chunks (l3186022 1:59-2:07)

Overlap prevents an answer straddling a chunk boundary; size by how self-contained paragraphs are (l3186022 2:02-2:05)

Pinecone free tier: 5 indexes, 1024-dim default (l3186022 1:53-1:54)

03The customer-support agent, node by nodeGmail Trigger -> Edit Fields -> JSON classifier -> Switch -> AI Agent (RAG tool + threaded Gmail draft tool…

Gmail Trigger -> Edit Fields -> JSON classifier -> Switch -> AI Agent (RAG tool + threaded Gmail draft tool) -> Slack summary; human sends.

Pin trigger test data or new inbox mail replaces your fixture (l3186022 0:52-0:53)

Thread ID is extracted so the draft replies in-thread, not standalone (l3186022 0:56-0:57, 2:12-2:14)

'no' branch ends the flow - no agent tokens on non-support mail (l3186022 1:15)

Agent tools: Vector Store Question Answer (RAG) + Gmail Create Draft (l3186022 1:27, 2:08-2:14)

Slack summary = human-in-the-loop approval step (l3186022 2:18-2:25)

Live test: defective-product email -> correct 30-day policy draft signed 'Kelly from Sleepy Owl' (l3186022 2:20-2:21)

CS agent JSON + prompt + policy PDF distributed with the recording; import via three-dot menu (l3186022 2:26-2:32)

04JSON Object vs JSON Schema: making an LLM answer into a variableOutput Format = JSON Object turns an LLM reply into a typed variable (single field);

Output Format = JSON Object turns an LLM reply into a typed variable (single field); JSON Schema for multi-field extraction; system prompt = behaviour layer, user prompt = content.

LLM output feeding If/Switch must be structured, not prose (l3186022 1:07-1:08)

JSON Object for a single known field; JSON Schema for multi-field pre-defined extraction (l3186022 1:10-1:11)

Without the setting, JSON-looking text is still an unparseable string (l3186022 1:09-1:13, 1:43-1:44)

System prompt = invisible guardrails; ChatGPT is the API model plus OpenAI's system prompt (l3186022 1:00-1:04)

Business scoping (refuse off-topic) is a system-prompt job, not a model limit (l3186022 1:03)

05'AI agent is not required everywhere'Use AI Agent nodes only for non-deterministic, tool-choosing steps;

Use AI Agent nodes only for non-deterministic, tool-choosing steps; use Message a Model / Filter / Switch for known input-output logic.

Agent nodes for dynamic multi-step logic only; simpler nodes for fixed I/O (l3186022 2:21-2:22)

Make.com bills per module execution - pricier at scale than n8n (l3302268 0:41)

Save (Ctrl+S), export JSON (three-dot menu), push to GitHub (l3302268 0:33-0:41)

platform.openai.com = developer API billing; chat.com = consumer subscription (l3302268 0:27-0:29)

Never share API keys - billing liability (l3302268 0:16-0:17, 0:39)

06Office Hour 2 distilled: likeness filters, upscalers, custom forms via webhook, offline RAGLikeness policies differ by tool;

Likeness policies differ by tool; pixel > latent upscaling for consistency; own-domain forms via Webhook trigger; offline RAG via Msty stacks or Pinecone/Chroma; Sheets auth issues = account mismatch.

Sora 2 / Veo reject real-person uploads; Sora Cameo for self; HeyGen allows real people (l3302268 0:01-0:02)

Pixel upscalers preserve consistency better than latent ones (l3302268 0:05-0:06)

Custom-branded form -> n8n via Webhook trigger, not the form node (l3302268 0:06-0:07)

Offline RAG: Msty knowledge stacks (per-domain) or Pinecone/Chroma (l3302268 0:10-0:13)

Sheets-n8n failures: same Google account, unlink/relink, full access (l3302268 0:31-0:32)

HTML email: convert video to GIF to avoid spam filters (l3302268 0:09-0:10)

Character consistency = image-to-video with references, iterative loop (l3302268 0:13-0:15)

Tools referenced

ToolCoverageMomentContext
n8ndemonstratedFull CS agent build; Gmail, Edit Fields, OpenAI, Switch, AI Agent, Slack nodes
PineconedemonstratedVector DB; index + namespace; free tier 5 indexes
OpenAI APIdemonstratedGPT-4.1 mini for classifier and agent brain; text-embedding-3-small
GmaildemonstratedTrigger + Create Draft tool (threaded)
SlackdemonstratedHuman-in-the-loop summary channel
Google SheetsexplainedExpense-tracker workbook tool
MstyexplainedOffline knowledge stacks for private RAG
ZendeskmentionedEcommerce support desk context
GorgiasmentionedD2C support desk context
HeyGenmentionedAllows real-person avatars
SoramentionedRejects real-person uploads; Cameo feature; native loops
Make.commentionedPer-module billing comparison
DifymentionedKnowledge-base API for chatbot + LMS integration
NotebookLMmentionedPrivacy: tied to your Google account
ComfyUImentioned'n8n for images/videos' analogy

Action items

    Resources mentioned

    Resources
    • docCustomer-support agent package (JSON workflow + system prompt + 'Sleepy Owl' policy PDF)
    • docDay 4 workbook - Expense Tracker agent
    • docOffice Hour 2 question log

    Extraction notes

    This page was built from an auto-generated transcript, which garbles product and people's names. Those were corrected silently in everything above and logged here for transparency. The warnings flag claims that were true on the recording day but change fast.

    Transcript corrections applied

    The transcript saysThe trainer actually means
    Ruthaba / Uthappa / Topathe host (see ais-day00)
    AgentEwise / AgentwiseHarshad's agency name - spelling unverified
    AshishHarshad (host addressing the same mentor)
    DiffieDify
    Misty StudioMsty
    white porting / white coded / wide codedvibe coding / vibe-coded
    Free PickFreepik
    Convo Coreunresolved multi-channel agent tool (ConvoCore?)

    True on recording day — verify before relying