Agents From Scratch Ts banner
langchain-ai langchain-ai

Agents From Scratch Ts

Communication community

Description

LangGraph Typescript Agents Notebooks: email, human in the loop, memory

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Email Assistant Agents with LangGraph.js

This repository contains implementations of AI email assistants built using LangGraph.js, a library for building stateful, multi-actor applications with LLMs. It demonstrates how to create, test, and add features like Human-in-the-Loop (HITL) and persistent memory to an AI agent.

Prerequisites

1. Install Dependencies

Clone the repository and install the necessary packages:

npm install
# or
yarn install
# or
pnpm install

2. Environment Setup

Copy the `.env.example` file to `.env` file in the root of the project and add your OpenAI API key:

OPENAI_API_KEY=your_api_key_here

it is recommended to also add your langsmith api key, and langsmith_project name to be able to analyze your graph traces in Langsmith.

3. Run the Agent

Start the email assistant. This will typically also make it available for interaction and visualization in LangGraph Studio (usually at `http://localhost:PORT/studio` - check your terminal output for the exact port).

npm run agent
# or
yarn agent
# or
pnpm agent

Typescript Notebooks

multiple interactive Typescript Jupyter notebooks to go through the process of creating these agentic features.

  • notebooks/langgraph_101.ipynb
  • notebooks/agent.ipynb
  • notebooks/hitl.ipynb
  • notebooks/memory.ipynb

Email Assistant Scripts

Three versions of the email assistant are available in the `src/` directory:

  1. email_assistant.ts: A basic email assistant for triage and response.
  2. email_assistant_hitl.ts: Extends the basic assistant with Human-in-the-Loop capabilities for reviewing and intervening in the agent's actions.
  3. email_assistant_hitl_memory.ts: Fur