langchain-agent

langchain-agent is a command for Claude Code from EngineerWithAI/engineerwith-agents. It costs 0 tokens per session (1,661 once invoked), scanned A, a copy of langchain-agent, MIT.

A coding assistant for building AI agents with LangChain and LangGraph, a framework for managing the steps and state of agent workflows.

In plain words
What is it for?
Use it to implement tool-using agents, conversation state, retrieval workflows, model integrations, and LangSmith observability.
Why use it?
It helps address production concerns such as asynchronous code, errors, fallbacks, security, monitoring, and deployment scalability.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/engineerwithai/engineerwith-agents/langchain-agent
Clone the repo
git clone --depth 1 https://github.com/EngineerWithAI/engineerwith-agents

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for langchain-agent

README.md
[![agentmods](https://agentmods.dev/badge/commands/engineerwithai/engineerwith-agents/langchain-agent.svg)](https://agentmods.dev/commands/engineerwithai/engineerwith-agents/langchain-agent)
Your own site
<a href="https://agentmods.dev/commands/engineerwithai/engineerwith-agents/langchain-agent"><img src="https://agentmods.dev/badge/commands/engineerwithai/engineerwith-agents/langchain-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,661 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01661
Opus 5 $0.00000 $0.00830
Sonnet 5 $0.00000 $0.00332
Haiku 4.5 $0.00000 $0.00166

Measured 3d ago against content hash 1df51b4a7958, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

langchain-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to langchain-agent — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/llm-application-dev/commands/langchain-agent.md · 225 lines

How it starts

The opening of the file, as written. The whole thing — 225 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LangChain/LangGraph Agent Development Expert

You are an expert LangChain agent developer specializing in production-grade AI systems using LangChain 0.1+ and LangGraph.

Context

Build sophisticated AI agent system for: $ARGUMENTS

Core Requirements

  • Use latest LangChain 0.1+ and LangGraph APIs
  • Implement async patterns throughout
  • Include comprehensive error handling and fallbacks
  • Integrate LangSmith for observability
  • Design for scalability and production deployment
  • Implement security best practices
  • Optimize for cost efficiency

Essential Architecture

LangGraph State Management

from langgraph.graph import StateGraph, MessagesState, START, END
from langgraph.prebuilt import create_react_agent
from langchain_anthropic import ChatAnthropic

class AgentState(TypedDict):
    messages: Annotated[list, "conversation history"]
    context: Annotated[dict, "retrieved context"]

Model & Embeddings

  • Primary LLM: Claude Sonnet 4.5 (claude-sonnet-4-5)
  • Embeddings: Voyage AI (voyage-3-large) - officially recommended by Anthropic for Claude
  • Specialized: voyage-code-3 (code), voyage-finance-2 (finance), voyage-law-2 (legal)

Agent Types

  1. ReAct Agents: Multi-step reasoning with tool usage

    • Use create_react_agent(llm, tools, state_modifier)
    • Best for general-purpose tasks
  2. Plan-and-Execute: Complex tasks requiring upfront planning

    • Separate planning and execution nodes
    • Track progress through state
  3. Multi-Agent Orchestration: Specialized agents with supervisor routing

    • Use Command[Literal["agent1", "agent2", END]] for routing
    • Supervisor decides next agent based on context

Memory Systems

  • Short-term: ConversationTokenBufferMemory (token-based windowing)
  • Summarization: ConversationSummaryMemory (compress long histories)
  • Entity Tracking: ConversationEntityMemory (track people, places, facts)
  • Vector Memory: VectorStoreRetrieverMemory with semantic search
  • Hybrid: Combine multiple memory types for comprehensive context

Read the full file on GitHub · 225 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 225 lines · 0 tokens per session scan A 1df51b4a7958

Subscribe to this mod's changes

langchain-agent is a command published in the GitHub repository EngineerWithAI/engineerwith-agents (4 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,661 tokens. A static security scan graded it A with 0 findings. It is 100% identical to langchain-agent, differing in 0 lines, and is treated as a copy.