langchain
/langchain
Pomaga budować aplikacje LLM we frameworku LangChain: łańcuchy, agenci, narzędzia, potoki RAG, bazy wektorowe, pamięć i LCEL w Pythonie oraz TypeScript.
- Autor
- claude-dev-suite ↗
- Repozytorium
- claude-dev-suite ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 21.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 21.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Pomaga budować aplikacje LLM we frameworku LangChain: łańcuchy, agenci, narzędzia, potoki RAG, bazy wektorowe, pamięć i LCEL w Pythonie oraz TypeScript.
Wyzwalacze z opisu
Oryginalny opis (EN)
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`
Jak działa
- LCEL (LangChain Expression Language — recommended)
- RAG Chain
- Tools and Agents
- Structured Output
- Document Loading and Splitting
- Anti-Patterns
- Production Checklist
Podgląd SKILL.md
---
name: langchain
description: |
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`
allowed-tools: Read, Grep, Glob, Write, Edit
---
# 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 import ChatPromptTemplate
from langchain_core.runnables import RunnablePassthrough
# Setup
embeddings = OpenAIEmbeddings()
vectorstore = Chroma(persist_directory="./chroma_db", embedding_function=embeddings)
retriever = vectorstore.as_retriever(search_kwargs={"k": 4})
prompt = ChatPromptTemplate.from_template("""
Answer based on the context. If unsure, say so.
Context: {context}
Question: {question}
""")
chain = (
{"context": retriever | format_docs, "question": RunnablePassthrough()}
| prompt
| ChatAnthropic(model="claude-sonnet-4-20250514")
| StrOutputParser()
)
answer = chain.invoke("How does authentication work?")
```
## Tools and Agents
```python
from langchain_core.tools import tool
from langchain_anthropic import ChatAnthropic
from langgraph.prebuilt import create_react_agent
@tool
def search_database(query: str) -> str:
"""Search the product database by query."""
results = db.search(query)
return json.dumps(results)
@tool
def calculate_price(product_id: str, quantity: int) -> float:
"""Calculate total price for a product and quantity."""
product = db.get_product(product_id)
return product.price * quantity
model = ChatAnthropic(model="claude-sonnet-4-20250514")
agent = create_react_agent(model, [search_database, calculate_price])
result = agent.invoke({"messages": [("human", "Find laptop prices and calculate cost for 5 units")]})
```
## Structured Output
```python
from pydantic import BaseModel, Field
class ExtractedInfo(BaseModel):
name: str = Field(description="Person's name")
email: str = Field(description="Email address")
sentiment: str = Field(description="positive, negative, or neutral")
structured_model = model.with_structured_output(ExtractedInfo)
result = structured_model.invoke("John (john@example.com) loves the product!")
# ExtractedInfo(name='John', email='john@example.com', sentiment='positive')
```
## Document Loading and Splitting
```python
from langchain_community.document_loaders import PyPDFLoader, WebBaseLoader
from langchain_text_splitters import RecursiveCharacterTextSplitter
# Load
docs = PyPDFLoader("document.pdf").load()
# Split
splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
chunks = splitter.split_documents(docs)
# Store in vectorstore
vectorstore = Chroma.from_documents(chunks, embeddings, persist_directory="./db")
```
## Anti-Patterns
| Anti-Pattern | Fix |
|--------------|-----|
| Legacy `LLMChain` API | Use LCEL pipe syntax |
| No streaming for user-facing | Always stream with `astream` |
| Huge chunks in RAG | Use 500-1000 char chunks with 200 overlap |
| No retrieval evaluation | Track retrieval quality with LangSmith |
| Agent without tool descriptions | Write clear docstrings — LLM uses them |
| Embedding model mismatch | Same embedding model for indexing and querying |
## Production Checklist
- [ ] LCEL syntax (not legacy chains)
- [ ] Streaming enabled for user-facing responses
- [ ] LangSmith tracing for debugging/evaluation
- [ ] Structured output with Pydantic models
- [ ] Proper chunk size and overlap for RAG
- [ ] Error handling and fallbacks in chains
- [ ] Rate limiting on external tool calls
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · claude-dev-suite/claude-dev-suite | 100 | MIT |
| znlgis/opengis-skills | 100 | MIT |
| langchain-ai/docs | 100 | MIT |
| svngoku/coding-agents-skills | 100 | MIT |
| synthetic-sciences/openscience | 100 | Apache-2.0 |
| dhar174/langgraph_system_generator | 100 | MIT |
| G1Joshi/Agent-Skills | 100 | MIT |
| TerminalSkills/skills | 98 | Apache-2.0 |
| magnus919/agent-skills | 90 | MIT |
Migawka bazy z 28.10.2026 · wersja paczki 813764802599 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100langchain-development
Pomaga w pracy z frameworkiem LangChain dla JS i TS: modele czatu, szablony promptów, łańcuchy LCEL, wiązanie narzędzi i potoki RAG. - 100langchain-core-workflow-a
Buduje łańcuchy i prompty LangChain dla ustrukturyzowanych przepływów LLM: szablony promptów, łańcuchy LCEL i sekwencyjne potoki przetwarzania. - 100rag-patterns
Opisuje wzorce architektury RAG: strategie chunkingu, pipeline'y wyszukiwania, reranking, wyszukiwanie hybrydowe, ewaluację i projekt systemu produkcyjnego. - 98langchain-architecture
Pomaga projektować aplikacje LLM we frameworku LangChain z agentami, pamięcią i integracją narzędzi. - 98langchain-architecture
Pomaga projektować aplikacje LLM we frameworku LangChain z agentami, pamięcią i integracją narzędzi. - 98langchain-architecture
Pomaga projektować aplikacje LLM we frameworku LangChain z agentami, pamięcią i integracją narzędzi.