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.
npx agentmods add agents/langchain-ai/langgraphjs/run_agentsgit clone --depth 1 https://github.com/langchain-ai/langgraphjsWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01312 |
| Opus 5 | $0.00000 | $0.00656 |
| Sonnet 5 | $0.00000 | $0.00262 |
| Haiku 4.5 | $0.00000 | $0.00131 |
Grade A, and why
run_agents 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.
How it starts
The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Running agents
Agents support execution using either .invoke() for full responses, or .stream() for incremental streaming of the output. This section explains how to provide input, interpret output, enable streaming, and control execution limits.
Basic usage
Agents can be executed using .invoke():
import { createReactAgent } from "@langchain/langgraph/prebuilt";
const agent = createReactAgent(...);
// highlight-next-line
const response = await agent.invoke(
{ messages: [ { role: "user", content: "what is the weather in sf" } ] }
);
Inputs and outputs
Agents use a language model that expects a list of messages as an input. Therefore, agent inputs and outputs are stored as a list of messages under the messages key in the agent state.
Input format
Agent input must be an object with a messages key. Supported formats are:
| Format | Example |
|---|---|
| String | { messages: "Hello" } — Interpreted as a HumanMessage |
| Message object | { messages: { "role": "user", "content": "Hello" } } |
| List of messages | { messages: [ {"role": "user", "content": "Hello" } ] } |
| With custom state | { messages: [ {"role": "user", "content": "Hello"} ], "user_name": "Alice" } — If using a custom stateSchema |
Messages are automatically converted into LangChain's internal message format. You can read more about LangChain messages in the LangChain documentation.
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.
- 3d ago First seen · 150 lines · 0 tokens per session scan A 60d60c4be6cc
run_agents is an agent published in the GitHub repository langchain-ai/langgraphjs (3,242 stars, last pushed 7d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,312 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
experiment
The experiment agent of /auto. Wraps the /auto-experiment skill, which folds mechanism-family routing inline before implementing, code-reviewing, and deploying the experiment suite. Supports two-step invocation — first call returns candidate families for the orchestrator's mini-prompt, second call (with chosenfamily)…
iteration
The iteration agent of /auto. Runs the /auto-iteration-loop skill — an autonomous review loop that consumes /auto-verify's four-state output (PASS / FAIL / INCONCLUSIVE / ZEROELIGIBLEVARIANTS) plus the orthogonal deferred bucket and routes each claim to the right back-edge (① variant-only fix / ② baseline-script fix /…
huyen-agents
Updated 2025: This is a summary of Chip Huyen's blog and book chapter on agents, with some added context to provide a comprehensive overview of their design, capabilities, and practical applications.
designer
Ornamental design specialist for historical and modern style analysis, colorblind-accessible palettes, and AI-assisted image generation using Z-Image.
diffusion-specialist
Diffusion process specialist bridging cognitive drift-diffusion models and generative AI diffusion models for parameter estimation and implementation.
api-reviewer
Review Hono API routes for consistency, security, and best practices.