Backend Developer

# EmailAgent README

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "Backend Developer" with this command: npx skills add jawadsadiq01/langchain-email-agent

EmailAgent README

Overview

The EmailAgent class provides an AI-powered email composition and sending capability using LangChain with OpenAI's GPT model. It includes human-in-the-loop middleware that requires approval before emails are sent.

Configuration

Environment Variables

VariableDefaultDescription
OPENAI_MODELgpt-4o-miniOpenAI model to use

Usage

import { EmailAgent } from './email.agent';
import { SendEmailDto } from '../dto/send-email.dto';

const agent = new EmailAgent();

const dto: SendEmailDto = {
  email: 'recipient@example.com',
  name: 'John Doe',
  subject: 'Meeting Request',      // optional
  body: 'Initial email content',   // optional
  instructions: 'Keep it formal'   // optional
};

const result = await agent.sendEmail(dto);

Human-in-the-Loop Middleware

The agent uses humanInTheLoopMiddleware which interrupts execution on the EmailTool before sending emails. This allows for:

  • approve - Send the email as composed
  • edit - Modify the email before sending
  • reject - Cancel the email operation

The readEmailTool is excluded from interruption (false), allowing read operations to proceed without approval.

Parameters

ParameterTypeRequiredDescription
emailstringYesRecipient email address
namestringYesRecipient name
subjectstringNoEmail subject line
bodystringNoInitial email body content
instructionsstringNoAI instructions for composing the email

Return Value

Returns the final message content from the agent as a string.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Wangdongjie Cfo Skill

基于王东杰26年实战经验,提供A+H双市场IPO操盘、资本杠杆设计、业财融合和AI数字化风控咨询。

Registry SourceRecently Updated
General

Hk Stock Morning Report

Generate HK stock market morning report (股市晨報) for Chinese bank trading desk. Use when user asks "生成晨报", "股市晨报", "今日股市", "港股晨報", or any similar HK stock mark...

Registry SourceRecently Updated
General

Nansen Mpp Payment

Pay-per-call access to the Nansen API via MPP (Tempo). Use when a user wants anonymous Nansen access without an API key and without managing their own Base/S...

Registry SourceRecently Updated
General

Etsy Autolist

Auto-create and manage digital product listings on Etsy. Creates listings from existing digital product files (PDFs, templates, spreadsheets) using Etsy Open...

Registry SourceRecently Updated