← ClaudeAtlas

langchainlisted

Build LLM applications with LangChain and LangGraph. Use when creating RAG pipelines, agent workflows, chains, or complex LLM orchestration. Triggers on LangChain, LangGraph, LCEL, RAG, retrieval, agent chain.
Makiya1202/ai-agents-skills · ★ 2 · AI & Automation · score 65
Install: claude install-skill Makiya1202/ai-agents-skills
# LangChain & LangGraph Build sophisticated LLM applications with composable chains and agent graphs. ## Quick Start ```bash pip install langchain langchain-openai langchain-anthropic langgraph ``` ```python from langchain_anthropic import ChatAnthropic from langchain_core.prompts import ChatPromptTemplate # Simple chain llm = ChatAnthropic(model="claude-3-sonnet-20240229") prompt = ChatPromptTemplate.from_template("Explain {topic} in simple terms.") chain = prompt | llm response = chain.invoke({"topic": "quantum computing"}) ``` ## LCEL (LangChain Expression Language) Compose chains with the pipe operator: ```python from langchain_core.output_parsers import StrOutputParser from langchain_core.runnables import RunnablePassthrough # Chain with parsing chain = ( {"topic": RunnablePassthrough()} | prompt | llm | StrOutputParser() ) result = chain.invoke("machine learning") ``` ## RAG Pipeline ```python from langchain_openai import OpenAIEmbeddings from langchain_community.vectorstores import Chroma from langchain_core.prompts import ChatPromptTemplate from langchain_core.runnables import RunnablePassthrough # Create vector store embeddings = OpenAIEmbeddings() vectorstore = Chroma.from_documents(documents, embeddings) retriever = vectorstore.as_retriever(search_kwargs={"k": 4}) # RAG prompt prompt = ChatPromptTemplate.from_template(""" Answer based on the following context: {context} Question: {question} """) # RAG chain rag_chain = ( {"conte