← ClaudeAtlas

langchainlisted

LangChain framework for LLM application development. Covers chains, agents, tools, RAG pipelines, vector stores, memory, and LangChain Expression Language (LCEL). Python and TypeScript/JavaScript. USE WHEN: user mentions "langchain", "LLM chain", "AI agent", "LCEL", "retrieval chain", "LangChain tools", "LangSmith", "LangGraph" DO NOT USE FOR: direct API calls without framework - use Claude/OpenAI SDK; vector database specifics - use `vector-databases`; RAG architecture patterns - use `rag-patterns`
claude-dev-suite/claude-dev-suite · ★ 33 · AI & Automation · score 80
Install: claude install-skill claude-dev-suite/claude-dev-suite
# LangChain ## LCEL (LangChain Expression Language — recommended) ```python from langchain_anthropic import ChatAnthropic from langchain_core.prompts import ChatPromptTemplate from langchain_core.output_parsers import StrOutputParser model = ChatAnthropic(model="claude-sonnet-4-20250514") prompt = ChatPromptTemplate.from_messages([ ("system", "You are a helpful assistant specialized in {topic}."), ("human", "{question}"), ]) # Pipe syntax chain = prompt | model | StrOutputParser() result = chain.invoke({"topic": "Python", "question": "Explain decorators"}) # Streaming async for chunk in chain.astream({"topic": "Python", "question": "Explain decorators"}): print(chunk, end="") ``` ### TypeScript ```typescript import { ChatAnthropic } from '@langchain/anthropic'; import { ChatPromptTemplate } from '@langchain/core/prompts'; import { StringOutputParser } from '@langchain/core/output_parsers'; const model = new ChatAnthropic({ model: 'claude-sonnet-4-20250514' }); const prompt = ChatPromptTemplate.fromMessages([ ['system', 'You are a helpful assistant specialized in {topic}.'], ['human', '{question}'], ]); const chain = prompt.pipe(model).pipe(new StringOutputParser()); const result = await chain.invoke({ topic: 'TypeScript', question: 'Explain generics' }); ``` ## RAG Chain ```python from langchain_community.vectorstores import Chroma from langchain_anthropic import ChatAnthropic from langchain_openai import OpenAIEmbeddings from langchain_core.prompts