langchain

langchain is a skill for Claude Code, Codex from Bilal140202/the-lord-of-the-skills. It costs 28 tokens per session (1,159 once invoked), scanned A, original, MIT.

A set of project-specific guidelines for building LangChain applications in Python. LangChain is a toolkit for connecting language models with prompts, tools, retrieval, memory, and deployment code.

In plain words
What is it for?
Use it when changing LangChain agents, tools, retrieval-augmented generation (RAG) pipelines, memory, chains, vector-store integrations, or deployable endpoints.
Why use it?
It gives consistent patterns for agent workflows and helps keep external input, conversation state, and pipeline code organized and testable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when changing LangChain agents, tools, retrieval-augmented generation (RAG) pipelines, memory, chains, vector-store integrations, or deployable endpoints.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bilal140202/the-lord-of-the-skills/sameeh07__agent-skills
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 Bilal140202/the-lord-of-the-skills --skill sameeh07__agent-skills
Clone the repo
git clone --depth 1 https://github.com/Bilal140202/the-lord-of-the-skills

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/bilal140202/the-lord-of-the-skills/sameeh07__agent-skills/github.svg)](https://agentmods.dev/skills/bilal140202/the-lord-of-the-skills/sameeh07__agent-skills)
Your own site
<a href="https://agentmods.dev/skills/bilal140202/the-lord-of-the-skills/sameeh07__agent-skills"><img src="https://agentmods.dev/badge/skills/bilal140202/the-lord-of-the-skills/sameeh07__agent-skills/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/bilal140202/the-lord-of-the-skills/sameeh07__agent-skills"><img src="https://agentmods.dev/badge/skills/bilal140202/the-lord-of-the-skills/sameeh07__agent-skills.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,159 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.
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.00028 $0.01159
Opus 5 $0.00014 $0.00580
Sonnet 5 $0.00006 $0.00232
Haiku 4.5 $0.00003 $0.00116

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

Security

Grade A, and why

langchain 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 12d 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.

skills/fangorn/claude-code/Sameeh07__AGENT-SKILLS/SKILL.md · 164 lines

How it starts

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

LangChain - Skill

Purpose

This skill teaches the agent project specific conventions and concise patterns for building AI agent workflows with LangChain in Python. Use this when implementing chatbots, RAG pipelines, tool-enabled agents, multi-agent flows, or deploying runnables.

When an AI assistant should apply this skill

  • Editing Python code that imports langchain or langchain_core
  • Adding or changing agents, tools, retrievers, memory, or chains
  • Writing pipeline glue code for RAG and vector stores
  • Creating deployable runnables or LangServe endpoints

Quick start

  1. Keep imports explicit and small. Prefer the Runnable interfaces for consistency. 2. Use typed small functions for tools. 3. Attach memory to chains or agents when conversation state is required. 4. Wrap external I/O behind tools to make tests deterministic.

Core concepts and cheat sheet

  • LLMs and Runnables

    • Treat LLMs, chains, and tools as Runnable objects with invoke, batch, and stream methods.
    • Prefer explicit invocation: result = llm.invoke("prompt").
  • Prompts

    • Use ChatPromptTemplate for chat style flows and Template for single prompt flows.
  • Tools

    • Define minimal pure functions and annotate with @tool where useful.
    • Keep tool side effects explicit and isolated.
  • Agents

    • Create agents with the agent factory. Give the agent a short system style prompt and a curated tool list.
  • Memory

    • Use ConversationBufferMemory for simple chat history. Use summarized or vectorized memory for long lived contexts.
  • Retrievers and RAG

    • Index documents offline. At query time, call retriever.as_retriever or use RetrievalQA chain.
  • Callbacks and middleware

    • Use callbacks for logging, telemetry, and custom token handling. Use middleware to enforce policies or rate limits.
  • Deployment

    • Export runnables with LangServe or wrap them with FastAPI for custom routing.

Examples

  1. Minimal chat chain with memory
from langchain_openai import ChatOpenAI
from langchain.chains import LLMChain
from langchain.prompts import ChatPromptTemplate
from langchain.memory import ConversationBufferMemory

prompt = ChatPromptTemplate.from_messages([
    {"role": "system", "content": "You are a concise helpful assistant."},
    {"role": "user", "content": "{question}"},
])

llm = ChatOpenAI(model="gpt-4o", temperature=0)
chain = LLMChain(llm=llm, prompt=prompt)
chain.memory = ConversationBufferMemory()

resp = chain.invoke({"question": "Explain RLHF in one paragraph."})
print(resp)
  1. Define a deterministic tool and register it with an agent
from langchain.tools import tool
from langchain.agents import create_agent
from langchain_openai import ChatOpenAI

@tool
def calc(expression: str) -> str:
    """Evaluate a math expression safely."""
    # implement a safe eval or call a math microservice
    return str(eval(expression))

llm = ChatOpenAI(model="gpt-4o", temperature=0)
agent = create_agent(llm, tools=[calc])

result = agent.invoke({"input": "What is 12 * 7?"})
print(result)
  1. RAG pipeline pattern
from langchain.embeddings import OpenAIEmbeddings
from langchain.vectorstores import Chroma
from langchain.chains import RetrievalQA
from langchain_openai import ChatOpenAI

# indexing (offline)
emb = OpenAIEmbeddings()
vect = Chroma.from_documents(docs, embedding=emb)
retriever = vect.as_retriever(search_kwargs={"k": 4})

qa = RetrievalQA.from_chain_type(
    llm=ChatOpenAI(model="gpt-4o"),
    retriever=retriever,
    chain_type="stuff",
)
answer = qa.invoke({"query": "How does caching in our app work?"})
print(answer)
  1. Runnable batch and streaming
# invoke in batch
questions = ["A?", "B?", "C?"]
for out in llm.batch_as_completed(questions):
    print(out)

# streaming
for token in llm.stream("Explain X step by step"):
    print(token, end="")

Middleware and callbacks pattern

  • Implement a BaseCallbackHandler for custom logging or metrics.
  • Create middleware to run before agent decision, for example to check quotas or to insert a human approval step.

Read the full file on GitHub · 164 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. 12d ago First seen · 164 lines · 28 tokens per session scan A 3f450c902571

Subscribe to this mod's changes

langchain is a skill published in the GitHub repository Bilal140202/the-lord-of-the-skills (4 stars, last pushed 6d ago), licensed MIT. It adds 28 tokens to every session and 1,159 once invoked, about $0.0001 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-08-31.