langchain-email-agent

Coding Agents & IDEs
v1.0.0
Benign

The `EmailAgent` class provides an AI-powered email composition and sending capability using LangChain.

730 downloads730 installsby @jawadsadiq01

Setup & Installation

Install command

clawhub install jawadsadiq01/langchain-email-agent

If the CLI is not installed:

Install command

npx clawhub@latest install jawadsadiq01/langchain-email-agent

Or install with OpenClaw CLI:

Install command

openclaw skills install jawadsadiq01/langchain-email-agent

or paste the repo link into your assistant's chat

Install command

https://github.com/openclaw/skills/tree/main/skills/jawadsadiq01/langchain-email-agent

What This Skill Does

An AI agent that composes and sends emails using LangChain with OpenAI's GPT model. Before any email is sent, a human-in-the-loop middleware step requires explicit approval, edit, or rejection.

The built-in approval gate prevents accidental sends, making it safer than fully autonomous email agents.

When to Use It

  • Drafting outreach emails with tone instructions
  • Sending meeting requests with AI-written copy
  • Reviewing AI-composed emails before delivery
  • Composing follow-up emails from minimal input
  • Automating email drafts while keeping human oversight
View original SKILL.md file
# 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

| Variable | Default | Description |
|----------|---------|-------------|
| `OPENAI_MODEL` | `gpt-4o-mini` | OpenAI model to use |

## Usage

```typescript
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

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `email` | string | Yes | Recipient email address |
| `name` | string | Yes | Recipient name |
| `subject` | string | No | Email subject line |
| `body` | string | No | Initial email body content |
| `instructions` | string | No | AI instructions for composing the email |

## Return Value

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

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: Drafting outreach emails with tone instructions

AGENT
  1. 1Drafting outreach emails with tone instructions
  2. 2Sending meeting requests with AI-written copy
  3. 3Reviewing AI-composed emails before delivery
  4. 4Composing follow-up emails from minimal input
  5. 5Automating email drafts while keeping human oversight
OUTPUT
The `EmailAgent` class provides an AI-powered email composition and sending capability using LangChain.

Share this skill

Security Audits

VirusTotalBenign
OpenClawBenign
View full report

These signals reflect official OpenClaw status values. A Suspicious status means the skill should be used with extra caution.

Details

LanguageMarkdown
Last updatedMar 1, 2026