Guide · Agent skill
How to use the LangChain Agents and RAG agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The LangChain skill is a set of instructions and code examples that teaches your AI assistant how to build applications on LangChain, a popular open-source Python framework for apps powered by large language models. It covers agents that call tools, chains, conversation memory, and retrieval-augmented generation (RAG) over your own documents. This guide explains what the skill does, how to install it, how to ask for help with natural requests, and what you need before running any code it produces.
Quick start
- 1Download the ZIP. Download the skill ZIP from this page.
- 2Unzip the skill. Unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder for one project. Alternatively, upload the ZIP under Settings → Capabilities → Skills in the Claude apps.
- 3Install Python packages. Make sure you have Python 3.10 or newer, then install langchain and the provider packages you need, such as langchain-openai or langchain-anthropic.
- 4Add your API keys. Obtain API keys for the model providers you plan to use, such as OpenAI, Anthropic or Google.
- 5Make a natural request. Describe the application you want, such as a chatbot, a question-answering tool over documents, or an agent with tools.
- 6Review and run the code. Read the generated code, check it against current LangChain docs if it uses older classes, then run it in your own environment.
What does the LangChain skill make the agent do?
Once installed, the agent knows how to help you build applications with LangChain. It can write code that connects models from OpenAI, Anthropic or Google, so you can swap providers through one interface. It can also set up agents that follow the ReAct pattern, meaning the model reasons about a task, calls a tool, reads the result, and repeats until the task is done.
The skill can add conversation memory, and it can build RAG pipelines that answer questions from your documents by loading them, splitting them into chunks, storing them in a vector store, and retrieving relevant chunks for the model to use.
- Connect OpenAI, Anthropic or Google models
- Build agents that call tools such as search or a calculator
- Add conversation memory to chatbots
- Build RAG pipelines over web pages, PDFs, text, CSV and Markdown files
How do you install the LangChain skill?
You can install the skill in either of two ways. The first is to download the ZIP file from this page and unzip it into your personal skills folder, ~/.claude/skills/, so it is available in all your projects. The second is to unzip it into a project's .claude/skills/ folder, so it applies only to that project.
If you use the Claude apps, you can instead upload the ZIP under Settings → Capabilities → Skills.
- Personal install: unzip into ~/.claude/skills/
- Project install: unzip into the project's .claude/skills/ folder
- Claude apps: upload the ZIP under Settings → Capabilities → Skills
What do you need before using the skill?
The skill itself only provides instructions and examples. The code it writes needs Python 3.10 or newer and several LangChain packages. You also need API keys for each model provider you use, such as OpenAI, Anthropic or Google. A LangSmith account is optional and is used for observability.
Install the core library and the provider packages you plan to use. The source lists these commands:
- Python 3.10+
- langchain, langchain-core, langchain-openai and langchain-anthropic (required)
- Optional: langchain-community, langchain-chroma and langchain-google-genai
- API keys for the providers you use
- Optional: a LangSmith account
pip install -U langchain
pip install langchain-openai
pip install langchain-anthropic
pip install langchain-community
pip install langchain-chromaHow do you trigger the skill with a natural request?
You do not need special commands. Describe what you want to build in plain language and mention the kind of application. The skill's description covers chatbots, question-answering systems, autonomous agents and RAG applications, so requests that name one of these are the most likely to use it.
Be specific about the model provider, the tools the agent needs, and the documents it should search. The more concrete the request, the more directly the generated code will match your project.
- Build a chatbot that remembers the user's name across turns using LangChain.
- Create a LangChain agent with a calculator tool and a search tool, using Anthropic.
- Make a RAG app that answers questions from the PDFs in my ./papers folder.
- Compare OpenAI and Google models in one LangChain interface for my prototype.
What does a basic agent look like?
The skill's examples define ordinary Python functions as tools, then pass them to create_agent along with a model and a system prompt. The docstring of each function describes what the tool does. Running the agent sends a user message and returns the list of messages, where the last one holds the answer.
This is a starting template. Replace the example tools with functions that do real work for your project.
from langchain.agents import create_agent
from langchain_anthropic import ChatAnthropic
def get_weather(city: str) -> str:
"""Get current weather for a city."""
return f"It's sunny in {city}, 72°F"
agent = create_agent(
model=ChatAnthropic(model="claude-sonnet-4-5-20250929"),
tools=[get_weather],
system_prompt="You are a helpful assistant. Use tools when needed."
)
result = agent.invoke({"messages": [{"role": "user", "content": "What's the weather in Paris?"}]})
print(result["messages"][-1].content)How does the skill build a RAG pipeline?
The skill's RAG guide follows a standard sequence: load documents, split them into chunks, create embeddings and store them in a vector store, create a retriever, and then query a QA chain. The example uses Chroma as a local vector store and asks for the source documents to be returned with each answer, so you can check where it came from.
The RAG reference also lists loaders for web pages, PDFs, text files, directories, CSV files and Markdown. The integration reference covers saving a Chroma store to disk and adding or deleting documents.
- Loaders: WebBaseLoader, PyPDFLoader, TextLoader, DirectoryLoader, CSVLoader, UnstructuredMarkdownLoader
- Chunking: RecursiveCharacterTextSplitter with a chunk size and overlap you set
- Vector store: Chroma, persisted to a local directory if you choose
- Retrieval: a retriever that returns the top matching chunks
What should you check before running generated code?
The skill does not run scripts, but the code it writes does call model APIs and can load web pages, and agents can call tools that take actions. Read the generated code before running it, especially tools that touch files, the web or other systems.
The examples use older LangChain classes, including LLMChain, ConversationBufferMemory and RetrievalQA, which may be deprecated. Check the current LangChain documentation before building anything for production. Do not send sensitive data through an agent or RAG pipeline without review.
- The skill runs no scripts, but the generated code uses the network to call model providers and load web pages
- Agents calling tools or loading pages can take unintended actions or leak content
- Some examples use classes that may be deprecated
- Keep API keys out of shared code
What people use it for
- A chatbot that keeps conversation history so it can recall details from earlier messages.
- A question-answering tool that searches a folder of PDFs and cites its sources.
- A tool-using agent that combines a search function and a calculator to answer multi-step questions.
- A prototype that compares OpenAI, Anthropic and Google models behind one interface before choosing one.
Frequently asked questions
Is the LangChain skill free?
The skill is published under the MIT licence, as listed on this page. LangChain itself is an open-source Python framework, but model providers such as OpenAI, Anthropic and Google charge for API usage with your own keys, and LangSmith is optional.
What do I need to use the LangChain skill?
You need Python 3.10 or newer, the langchain, langchain-core, langchain-openai and langchain-anthropic packages, and API keys for the providers you use. The optional packages are langchain-community, langchain-chroma and langchain-google-genai. A LangSmith account is optional.
Where do I put the skill folder?
Unzip it into ~/.claude/skills/ to use it in all your projects, or into a project's .claude/skills/ folder to use it in one project. In the Claude apps, you can upload the ZIP under Settings → Capabilities → Skills.
Does the skill run LangChain for me?
No. The skill is a set of instructions and code examples. It helps you write LangChain code, but you must install the packages and run the code yourself.
Can I use the skill with Google or Anthropic models instead of OpenAI?
Yes. The skill's examples show ChatOpenAI, ChatAnthropic and ChatGoogleGenerativeAI, and state that you can swap providers easily. You will need the matching package and API key for each provider.
Why does the generated code fail or show warnings?
The examples use older classes such as LLMChain, ConversationBufferMemory and RetrievalQA, which may be deprecated in current LangChain releases. Check the current LangChain documentation and update the class names or imports to match.
How does the skill compare with LlamaIndex or LangGraph?
The skill's source suggests LlamaIndex for RAG-focused document Q&A, and LangGraph for complex stateful workflows that need more control. Choose LangChain for broad provider support, agents and quick prototyping; choose the alternative if its focus matches your project better.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use the LangChain skill if you are a Python developer who wants a starting template for chatbots, document question-answering or tool-using agents, and you are comfortable reading and running the code. Pick something else if you want a finished app without coding, or if you need the newest LangChain API without checking current docs.
Download the skill