LangChain Email Assistant (Hosted Version)

LangChain · Intermediate ·🤖 AI Agents & Automation ·1y ago

Key Takeaways

The LangChain Email Assistant is a prototype that utilizes LangChain and arcade AI to create an AI agent for managing emails, emphasizing human-in-the-loop interaction patterns. It can triage and respond to emails, draft emails, and schedule calendar events, with the ability to be trained and edited directly or through responses.

Full Transcript

for the past 6 months I haven't been checking email myself rather I've been relying on an AI agent to do it for me it's been checking my email triaging it into ones that I should see versus ones that I should ignore and when it thinks I should respond to something it tries to draft an email for me or schedule an event for me or it asks me a question if it's not sure what to do or how to respond so here you can see the agent inbox which is what I call where this AI agent communicates to me and this is primarily how I've been using and interacting with email for the past 6 months in this video I'm going to show how you can set it up no code needed um and then how you can use it to respond and communicate with this AI email assistant let's dive in the first thing we need to do is log in to the agent inbox note that this is not actually setting up the agent for us it is just logging in to this agent inbox where we can communicate with it so I'm going to go ahead and do that after I log in I'll notice that it's pretty empty that's because I haven't created the email agent yet so in order to do that I'm going to go over to settings here I'm going to click on it and I'm going to click create assistant it's then going to bring me to this page where I can configure the email assistant that I'm going to use there's a few different parameters that we need to configure for this email assistant to be able to do its job well first we need to tell it who we are so I'm going to type in my email here then I'm going to type in my full name here my first name or what I like to commonly use here I'm going to add some background about myself so they know who I am and now I'm going to tell it how I want it to behave and what I want it to do so so first I'm going to tell it my preferences for scheduling meetings so I'm just going to use the default ones here background preferences are general information that it might find useful like important people places or things so I'm going to say something like my co-founder is anos next are response preferences so when this is responding to users what type of content should it include so note that this is not the tone that we want the email to respond to that'll come later this is the content that we want to include and so not a ton here but I'll use the default I'll set my time zone and here is where I set how I want the tone to be so I'm going to add some basic instructions don't sound like an AI and then some cases you want to sound more formal some cases you want to sound less formal finally I'm going to tell it how to triage emails so instructions for for which emails should be ignored and so I'm going to use the defaults instructions for which emails should notify me but not try to draft a response just notify me that they exist so things like docy sign where I need to sign it this can't do it yet it's just going to notify me that I have something that I need to sign and then finally uh which emails it should try to respond to and so this is this is going to be everything that I want it to take a stab at responding to after that I have an option to turn on memory M so memory is still experimental um it's not fully fleshed out but the basic idea is that when you interact with it and we'll cover how you interact with it later on but when you interact with it it will learn from those interactions and start to improve in sense is how many days worth of emails you want to backfill this is a one-time job it just runs at the start and it will basically run over all emails in the past however long you choose and try to triage and optionally respond to them so I'm going to choose I'm going to choose two days now I'm going to authorize it this is going to bring us to a separate page the authorization will be using arcade AI behind the scenes this is a separate startup that handles off for agents you'll notice that at this point Google hasn't verified this app this is something arcade still needs to do I trust them you don't have to if you don't want to do this there will be a separate video that shows how you can set up and run this open source uh you will need to code and you will have to have open AI keys and anthropic keys and all of that I trust arcade AI so I'm going to do this great I've authorized my app I can now close this and I'm going to back to my inbox so it's kicked off a job that's in the background is going to look at all emails in the past two days and try to respond to them so it'll take a little bit to run and so I'll wait and then I'm going to come back here all right we can see that we're back and we've got a lot of emails that require my attention now you might be thinking hey didn't I just hire an agent to do this why do I still need to interact with it so much this agent has a very high emphasis on keeping the human you in the loop and I think that's really important imagine if you just hired a human EA to look after your emails when they get started you would want to be in the loop you would want them to ask you questions as they're doing their job they're not going to know how to respond to the things right off the bat they're going to need some guidance when they're writing an email you might want to make sure that it's in your tone if they're drafting it for you and you're going to want to look at that and so just like a human EA will require interactions with you so will this AI agent the expectation is not that this is fully autonomous it's doing its job but it's reaching out to you when it needs help or when we've programmed it to which is when it tries to send something we still still want to keep the human in the loop and the reason for that is the second thing memory so as I mentioned I turned on memory for this memory will only work if I interact with it imagine a human EA that's doing their job if they don't ask me how I like to respond to certain emails and if I don't tell them you know always respond to enr my co-founder or something like that they might not recognize my preferences they might recognize basic things right like oh this is Spam I shouldn't do anything there but not going to know who my friends are who I want to respond to who I want to ignore when I want to schedule meetings whether I like the morning or afternoon better and so I need to communicate all of that to human EA and so I also need to communicate all of that to my AI agent so I'm going to go over some of the common patterns of communication that I do for this email assistant and why they're so important I can look at a specific item by clicking into it here I can see that Rocky is asking me if I want to participate in an agent's hackathon my email agent doesn't know if I want to do this I do want to do this but I actually have friends that are in town that's not on my calendar my calendar is my work calendar I don't have friends in town on my calendar so there's no way that this agent or a human EA would know that and so I'm going to say something like I would love to but sadly I have friends in town and here I'm responding to the AI agent and you can see this because this is type question it's asking me a question so I'm going to send this response to the AI agent and I can see it start to work here it's doing more things this is giving me some indication of what's happening and then here now it's drafted an email and I can see this because this has changed to response email draft so I can see here that is drafted an email to Rocky hi Rocky I appreciate the invitation blah blah blah but I have prior commitments so there's a few things I can do here the most common things are edit or accept this so I can accept this directly as is or I can edit it directly so I could say something like uh I would love to instead of whatever it had before a second thing I could do if I wanted to is I could respond to my EA so rather than modifying it directly I could tell the EA day to respond in a more quoi term or something like that so let's do be more casual in your response here we can see that it drafted a new email it wasn't actually that colloquial we'll work on that but that you get the idea you can communicate either by editing it directly or by responding to the agent so I like this so I'm going to accept this it's going to run it's going to actually send that email for me and then when it's done it's going to bring me back here let's see another email you can see here that I have a bill for meter which we use for internet now there's a few things I can do here notice that this is notify so it's not actually asking me any questions so there's nothing for me to directly respond to it's just notifying me of this I could respond to it I could say draft an email or something like that if I wanted it to take actions usually what I do for these types of things is do one of these two things up here Markus resolved or ignore Mark is resolved is intended to communicate that I have done this off line ignore ignores this email and if I'm using memory it'll update memory to use this type of email as an example of what to ignore in the future so it doesn't even get shown to me so that's the key difference both of them will remove this from the agent inbox entirely Marcus resolved is basically saying hey this is actually a good email keep it up I should I want to see things like this in the future ignore is saying this is a bad email I do not want to see this so for things like like this I don't actually need to see this so I'm going to click ignore and it's going to bring me back to the agent inbox I want to show one more thing which is scheduling emails so here I'll click into this this is an email from myself that I just sent as a test dummy one or from one of my other accounts so I'm going to ask my email assistant set up a meeting next Thursday whenever and I'm going to send that and so here I can see what's going on under the hood and I can see that it's actually doing a bunch of things and one of the things it's doing is checking my calendar and seeing when I'm free so it drafted an email saying when I'm free next Thursday I actually wanted to schedule a calendar invite directly so I'm just going to say just schedule it directly it's done some work and I can see now that it's drafted a calendar invite that I could send just like the email I can modify these directly or I can accept it down below so that's how you communicate with this AI agent if it shows you something you can remove it from the agent inbox by saying either mark is resolved or ignore ignore will communicate to the agent that you don't want to see things like this in the future where Mark is resolved basically communicates hey I did this offline but this is a good thing it can ask you questions if it doesn't know how to deal with something just like a human EA would and you can respond to it based on that it may try to draft an email or schedule a calendar event when it does that you can approve it directly you can edit it directly in this agent inbox or you can respond to the agent and tell it to modify it in some way I've been using this for the past 6 months it's definitely not perfect there's sometimes I have to go in and manually type out emails sometimes it messes up the calendar and I have to check it but by and large it saved me a lot of time it's always on it's always running in the background and it highlights things when it's most important for me to see it if you're interested in trying it out you can check the link below thanks for watching

Original Description

This is a prototype from the LangChain team for creating an AI agent to manage your email. You should think of this as an “AI Executive Assistant”. This agent will monitor your emails, triage them, and try to respond to them if possible. It emphasizes human-in-the-loop interaction patterns for more controllability. This is a video focused on how to use the hosted version of this email assistant. Instructions here: https://mirror-feeling-d80.notion.site/AI-Email-Assistant-How-to-hire-and-communicate-with-an-AI-Email-Assistant-17b808527b178019a42af932bb64badd?pvs=4 If you are more interested in how to run this in an open source manner, you can see the video for that here: https://youtu.be/1A79eYjiBvo
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from LangChain · LangChain · 0 of 60

← Previous Next →
1 Chat With Your Documents Using LangChain + JavaScript
Chat With Your Documents Using LangChain + JavaScript
LangChain
2 LangChain SQL Webinar
LangChain SQL Webinar
LangChain
3 LangChain "OpenAI functions" Webinar
LangChain "OpenAI functions" Webinar
LangChain
4 LangSmith Launch
LangSmith Launch
LangChain
5 LangChain x Pinecone: Supercharging Llama-2 with RAG
LangChain x Pinecone: Supercharging Llama-2 with RAG
LangChain
6 LangChain Expression Language
LangChain Expression Language
LangChain
7 Building LLM applications with LangChain with Lance
Building LLM applications with LangChain with Lance
LangChain
8 Benchmarking Question/Answering Over CSV Data
Benchmarking Question/Answering Over CSV Data
LangChain
9 LangChain "RAG Evaluation" Webinar
LangChain "RAG Evaluation" Webinar
LangChain
10 Fine-tuning in Your Voice Webinar
Fine-tuning in Your Voice Webinar
LangChain
11 Tabular Data Retrieval
Tabular Data Retrieval
LangChain
12 Building an LLM Application with Audio by AssemblyAI
Building an LLM Application with Audio by AssemblyAI
LangChain
13 Superagent Deepdive Webinar
Superagent Deepdive Webinar
LangChain
14 Lessons from Deploying LLMs with LangSmith
Lessons from Deploying LLMs with LangSmith
LangChain
15 Shortwave Assistant Deepdive Webinar
Shortwave Assistant Deepdive Webinar
LangChain
16 Cognitive Architectures for Language Agents
Cognitive Architectures for Language Agents
LangChain
17 Effectively Building with LLMs in the Browser with Jacob
Effectively Building with LLMs in the Browser with Jacob
LangChain
18 Data Privacy for LLMs
Data Privacy for LLMs
LangChain
19 "Theory of Mind" Webinar with Plastic Labs
"Theory of Mind" Webinar with Plastic Labs
LangChain
20 LangChain Templates
LangChain Templates
LangChain
21 Using Natural Language to Query Postgres with Jacob
Using Natural Language to Query Postgres with Jacob
LangChain
22 Building a Research Assistant from Scratch
Building a Research Assistant from Scratch
LangChain
23 Benchmarking RAG over LangChain Docs
Benchmarking RAG over LangChain Docs
LangChain
24 Skeleton-of-Thought: Building a New Template from Scratch
Skeleton-of-Thought: Building a New Template from Scratch
LangChain
25 Benchmarking Methods for Semi-Structured RAG
Benchmarking Methods for Semi-Structured RAG
LangChain
26 LangSmith Highlights: Getting Started
LangSmith Highlights: Getting Started
LangChain
27 LangSmith Highlights: Debugging
LangSmith Highlights: Debugging
LangChain
28 LangSmith Highlights: Datasets
LangSmith Highlights: Datasets
LangChain
29 LangSmith Highlights: Evaluation
LangSmith Highlights: Evaluation
LangChain
30 LangSmith Highlights: Human Annotation
LangSmith Highlights: Human Annotation
LangChain
31 LangSmith Highlights: Monitoring
LangSmith Highlights: Monitoring
LangChain
32 LangSmith Highlights: Hub
LangSmith Highlights: Hub
LangChain
33 SQL Research Assistant
SQL Research Assistant
LangChain
34 Getting Started with Multi-Modal LLMs
Getting Started with Multi-Modal LLMs
LangChain
35 Build a Full Stack RAG App With TypeScript
Build a Full Stack RAG App With TypeScript
LangChain
36 Auto-Prompt Builder (with Hosted LangServe)
Auto-Prompt Builder (with Hosted LangServe)
LangChain
37 LangChain v0.1.0 Launch: Introduction
LangChain v0.1.0 Launch: Introduction
LangChain
38 LangChain v0.1.0 Launch: Observability
LangChain v0.1.0 Launch: Observability
LangChain
39 LangChain v0.1.0 Launch: Integrations
LangChain v0.1.0 Launch: Integrations
LangChain
40 LangChain v0.1.0 Launch: Composability
LangChain v0.1.0 Launch: Composability
LangChain
41 LangChain v0.1.0 Launch: Streaming
LangChain v0.1.0 Launch: Streaming
LangChain
42 LangChain v0.1.0 Launch: Output Parsing
LangChain v0.1.0 Launch: Output Parsing
LangChain
43 LangChain v0.1.0 Launch: Retrieval
LangChain v0.1.0 Launch: Retrieval
LangChain
44 LangChain v0.1.0 Launch: Agents
LangChain v0.1.0 Launch: Agents
LangChain
45 Build and Deploy a RAG app with Pinecone Serverless
Build and Deploy a RAG app with Pinecone Serverless
LangChain
46 Hosted LangServe + LangChain Templates
Hosted LangServe + LangChain Templates
LangChain
47 LangGraph: Intro
LangGraph: Intro
LangChain
48 LangGraph: Agent Executor
LangGraph: Agent Executor
LangChain
49 LangGraph: Chat Agent Executor
LangGraph: Chat Agent Executor
LangChain
50 LangGraph: Human-in-the-Loop
LangGraph: Human-in-the-Loop
LangChain
51 LangGraph: Dynamically Returning a Tool Output Directly
LangGraph: Dynamically Returning a Tool Output Directly
LangChain
52 LangGraph: Respond in a Specific Format
LangGraph: Respond in a Specific Format
LangChain
53 LangGraph: Managing Agent Steps
LangGraph: Managing Agent Steps
LangChain
54 LangGraph: Force-Calling a Tool
LangGraph: Force-Calling a Tool
LangChain
55 LangGraph: Multi-Agent Workflows
LangGraph: Multi-Agent Workflows
LangChain
56 Streaming Events: Introducing a new `stream_events` method
Streaming Events: Introducing a new `stream_events` method
LangChain
57 Building a web RAG chatbot: using LangChain, Exa (prev. Metaphor), LangSmith, and Hosted Langserve
Building a web RAG chatbot: using LangChain, Exa (prev. Metaphor), LangSmith, and Hosted Langserve
LangChain
58 OpenGPTs
OpenGPTs
LangChain
59 Open Source RAG with Nomic's New Embedding Model (and ChromaDB and Ollama)
Open Source RAG with Nomic's New Embedding Model (and ChromaDB and Ollama)
LangChain
60 LangGraph: Persistence
LangGraph: Persistence
LangChain

The LangChain Email Assistant is a prototype that creates an AI agent to manage emails, with capabilities such as email triage, response, drafting, and calendar scheduling. It emphasizes human-in-the-loop interaction patterns and can be trained and edited directly or through responses. This video demonstrates how to set up and use the LangChain Email Assistant, highlighting its potential for automating email management tasks.

Key Takeaways
  1. Log in to the agent inbox
  2. Create email assistant
  3. Configure email assistant with user information and preferences
  4. Set up email triage and response rules
  5. Turn on memory M
  6. Authorize the app using arcade AI
  7. Set up the AI agent to triage and respond to emails
  8. Interact with the AI agent to provide guidance and feedback
  9. Train the AI agent using common patterns of communication
  10. Accept or edit drafted emails
💡 The LangChain Email Assistant has the potential to significantly automate email management tasks, while still keeping the human in the loop for important decisions and feedback.

Related Reads

📰
The 33,000-token tax, a 30-hour star race, and where agents actually fail
Learn about the 33,000-token tax, a 30-hour star race, and where agents actually fail, and how to apply these insights to improve AI-agent ecosystems
Dev.to AI
📰
How AI Is Transforming Modern Manufacturing
Learn how AI is revolutionizing manufacturing with predictive maintenance and automation, increasing productivity and reducing costs
Dev.to AI
📰
GitHub's AI agent can be tricked into leaking private repos via a public Issue
GitHub's AI agent can be tricked into leaking private repos via a public Issue, highlighting a security vulnerability
Dev.to AI
📰
Enterprise AI Agency integration
Integrate AI-driven solutions with existing enterprise systems for data-driven decision-making and process automation
Dev.to AI
Up next
6 Stages to Perfect Capture
Matt Williams
Watch →