langchain-patterns

langchain-patterns is a skill for Claude Code from oyi77/1ai-skills. It costs 35 tokens per session (1,758 once invoked), scanned A, original, MIT.

A guide to building applications with LangChain and LangGraph, frameworks for connecting language models to tools, data, memory, and workflows.

In plain words
What is it for?
It helps build chatbots, retrieval-augmented generation systems, tool-using agents, and stateful workflows with multiple steps.
Why use it?
It helps structure applications that require several model steps, document retrieval, tool use, or workflows that keep state and branch between actions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the 1ai-skills plugin — 187 skills, 4 commands shipped together

Good fit It helps build chatbots, retrieval-augmented generation systems, tool-using agents, and stateful workflows with multiple steps.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/oyi77/1ai-skills/langchain-patterns
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.

Any agent
npx skills add oyi77/1ai-skills --skill langchain-patterns
Clone the repo
git clone --depth 1 https://github.com/oyi77/1ai-skills

Made for: Claude Code.

Or install 1ai-skills, the plugin that ships this one along with the rest of its 187 skills, 4 commands.

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-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/oyi77/1ai-skills/langchain-patterns/github.svg)](https://agentmods.dev/skills/oyi77/1ai-skills/langchain-patterns)
Your own site
<a href="https://agentmods.dev/skills/oyi77/1ai-skills/langchain-patterns"><img src="https://agentmods.dev/badge/skills/oyi77/1ai-skills/langchain-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for langchain-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/oyi77/1ai-skills/langchain-patterns"><img src="https://agentmods.dev/badge/skills/oyi77/1ai-skills/langchain-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,758 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found 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.00035 $0.01758
Opus 5 $0.00017 $0.00879
Sonnet 5 $0.00007 $0.00352
Haiku 4.5 $0.00003 $0.00176

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

Security

Grade A, and why

langchain-patterns 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 6d 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.

core/langchain-patterns/SKILL.md · 273 lines

How it starts

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

Overview

LangChain is the most widely used framework for building LLM applications. LangGraph adds stateful, multi-actor workflows with cycles. Together they provide chains, agents, retrieval, memory, and complex workflow orchestration.

Capabilities

  • Build chains with LCEL (LangChain Expression Language)
  • Create agents with tool use and reasoning
  • Implement RAG with vector stores and retrievers
  • Manage conversation memory and context
  • Build graph-based workflows with LangGraph
  • Integrate with 100+ LLM providers and tools

When to Use

Trigger phrases:

  • "langchain patterns"

  • "LangChain/LangGraph patterns — chains, agents, tools, memory, retrieval, graph w"

  • Building LLM-powered applications (chatbots, RAG, agents)

  • Needing structured chains for multi-step LLM workflows

  • Building stateful agent workflows with branching logic

  • Implementing retrieval-augmented generation

  • Wanting a mature ecosystem with many integrations

When NOT to Use

  • Task is outside your authorization scope
  • You need to implement controls (use implementing-* skills)
  • Task is about analysis, not action (use analyzing-* skills)
  • You don't have access to target systems
  • Task requires compliance expertise (consult professionals)
  • Task is about defense, not offense (use defensive skills)

Pseudo Code

# Example workflow for this skill
def execute(input_data):
    # Step 1: Validate input
    if not input_data:
        raise ValueError("Input data is required")

    # Step 2: Process core logic
    result = process(input_data)

    # Step 3: Validate output
    validate_output(result)

    return result

LCEL Chain

from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser

llm = ChatOpenAI(model="gpt-4o")

prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful assistant."),
    ("user", "{input}"),
])

chain = prompt | llm | StrOutputParser()

result = chain.invoke({"input": "Explain quantum computing in simple terms."})

Read the full file on GitHub · 273 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. 6d ago First seen · 273 lines · 35 tokens per session scan A dce4d5390a33

Subscribe to this mod's changes

langchain-patterns is a skill published in the GitHub repository oyi77/1ai-skills (12 stars, last pushed yesterday), licensed MIT. It adds 35 tokens to every session and 1,758 once invoked, about $0.0002 per session on Opus 5. 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-09-03.

Related

Other skills, from other repositories

dify

Use when building LLM applications with visual workflow — RAG knowledge bases, AI agents, chatbots with drag-and-drop orchestration. Dify: open-source LLM app platform supporting 30+ models (OpenAI, Claude, DeepSeek, Ollama, Qwen, GLM) with Docker deployment.

znlgis/opengis-skills · 66 tokens

ai-skills

Use when building LLM applications, RAG knowledge bases, AI agents, terminal coding agents, multi-model orchestration, plugin-based agent harnesses, or file translation. Index of 9 skills: Dify, Hermes Agent, OpenClaw, OpenCode, Pi, DocuTranslate, Oh-My-OpenAgent, Superpowers-zh, DeepSeek Harness.

znlgis/opengis-skills · 79 tokens

graphify

Build, query, or refresh Graphify knowledge graphs for code and documents when graph-based relationship analysis is useful or explicitly requested.

seaworld008/Commonly-used-high-value-skills · 28 tokens

langchain

Framework for building LLM-powered applications with agents, chains, and RAG. Supports multiple providers (OpenAI, Anthropic, Google), 500+ integrations, ReAct agents, tool calling, memory management, and vector store retrieval. Use for building chatbots, question-answering systems, autonomous agents, or RAG…

davila7/claude-code-templates · 79 tokens

vector-and-embedding-weaknesses

Hunt vector / embedding weaknesses (OWASP LLM08:2025) — adversarial inputs against the RAG / similarity layer that cause cross-tenant leak, embedding-inversion privacy loss, semantic confusion, and retriever-driven prompt injection.

PurpleAILAB/Decepticon · 59 tokens

sensitive-information-disclosure

Hunt LLM sensitive-information disclosure (OWASP LLM02:2025) — leakage of PII, secrets, internal source, model details, and other-tenant data through model outputs, training-data extraction, or retrieval-side joins.

PurpleAILAB/Decepticon · 55 tokens