Back to list
MattMagg

langchain

by MattMagg

Claude Code plugins for building AI agents across frameworks (Google ADK, OpenAI, and more)

2🍴 0📅 Jan 18, 2026

SKILL.md


name: LangChain description: Workflow patterns and gotchas for LangChain. Directs to RAG for implementation.

LangChain Workflow

When to Choose LangChain

  • Need composable chains with many integrations
  • Building RAG/retrieval applications
  • Want broad LLM provider support
  • Need document processing pipelines

Decision Framework

Component Selection

NeedComponentRAG Query
Basic LLM callChatModel"ChatOpenAI initialization"
Prompt templatingPromptTemplate"prompt template variables"
Composable stepsLCEL chains"LCEL chain composition"
Tool executionTool/StructuredTool"langchain tool definition"
Document retrievalRetriever"retriever vector store"
Conversation memoryMemory classes"conversation buffer memory"

Query RAG: mcp__agentic-rag__query_sdk("component example", sdk="langchain", mode="build")

Critical Gotchas

These trip up everyone:

  1. LCEL is the pattern - Use chain = prompt | llm | parser, not legacy chains
  2. RunnablePassthrough for context - Pass data through the chain explicitly
  3. Output parsers matter - Without one, you get raw text not structured data
  4. Invoke vs stream vs batch - Different methods for different use cases
  5. Async needs ainvoke - Sync methods block; use async for concurrency
  6. Memory isn't automatic - You must explicitly add and manage it
  7. API keys via env vars - Each provider has its own key format

Workflow: Building a LangChain Application

Step 1: Dependencies

RAG Query: mcp__agentic-rag__query_sdk("langchain installation packages", sdk="langchain", mode="explain")

Step 2: LLM Setup

RAG Query: mcp__agentic-rag__query_sdk("ChatOpenAI ChatAnthropic setup", sdk="langchain", mode="build")

Step 3: Prompt Design

RAG Query: mcp__agentic-rag__query_sdk("ChatPromptTemplate messages", sdk="langchain", mode="build")

Step 4: Chain Composition

RAG Query: mcp__agentic-rag__query_sdk("LCEL chain pipe operator", sdk="langchain", mode="build")

Step 5: Tool Integration (if needed)

RAG Query: mcp__agentic-rag__query_sdk("StructuredTool from_function", sdk="langchain", mode="build")

Step 6: Retrieval (if RAG)

RAG Query: mcp__agentic-rag__query_sdk("vector store retriever", sdk="langchain", mode="build")

Common Error Patterns

SymptomLikely CauseRAG Query
Chain doesn't workWrong pipe order"LCEL chain debugging"
Output is raw textMissing parser"output parser structured"
Context lostMissing passthrough"RunnablePassthrough"
Async timeoutUsing sync method"langchain async ainvoke"
Memory not workingNot connected"memory chain integration"

LangChain vs LangGraph

Use CaseChoose
Linear pipelinesLangChain LCEL
Conditional branchingLangGraph
Cycles/loopsLangGraph
Simple retrievalLangChain
Complex agent workflowsLangGraph

Advanced Features

Query RAG when you need:

  • Streaming: "langchain streaming callback"
  • Callbacks/tracing: "langchain callbacks tracing"
  • Custom chains: "custom runnable class"
  • Caching: "langchain caching responses"
  • Fallbacks: "chain fallback retry"

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon