Skip to main content

LangChain

@anima-labs/toolkit-langchain wraps the Anima SDK as LangChain.js tools, so any LangChain agent can send and read real email from its own inbox.

Install

Requires LangChain.js 1.x (@langchain/core >= 1.0) and Node 20+.

Prerequisites

Bind the tools to an agent

Or configure explicitly:

Tools

Every tool is backed by a live Anima API route and throws on API errors so your agent executor can react.

Runnable example: send a real email and read it back

The tools work standalone too — no model key needed. This is the full examples/quickstart.ts flow, which also runs against a mock API in the toolkit repo’s CI on every release:
Anima blocks sending to the agent’s own addresses server-side (anti-loop guard), so point ANIMA_TO at an external inbox — for example your personal one, and watch the email land there.

Reading received mail

Incoming email to the agent’s address is ingested automatically. List it with direction: "INBOUND":

Next steps