This one sets you up with LangChain and LangGraph best practices for building LLM apps in Python. It covers the full stack: LCEL chain composition with pipes, agent and tool development with proper schemas, RAG implementations from document splitting through vector stores, and state management with LangGraph's TypedDict patterns. The directory structure guidance alone saves you from the usual project mess. Strong emphasis on async patterns, LangSmith tracing integration, and real production concerns like retry logic and fallback chains. Opinionated about functional style over classes, which matches how most modern LangChain code actually gets written.
npx -y skills add mindrally/skills --skill langchain-development --agent claude-codeInstalls into .claude/skills of the current project.
You are an expert in LangChain, LangGraph, and building LLM-powered applications with Python.
Organize code into logical modules based on functionality:
project/
├── chains/ # LangChain chain definitions
├── agents/ # Agent configurations and tools
├── tools/ # Custom tool implementations
├── memory/ # Memory and state management
├── prompts/ # Prompt templates and management
├── retrievers/ # RAG and retrieval components
├── callbacks/ # Custom callback handlers
├── utils/ # Utility functions
├── tests/ # Test files
└── config/ # Configuration files
create_retrieval_chain, build_agent_executor)|)RunnableSequence and RunnableParallel for complex workflowsRunnableLambdafrom langchain_core.runnables import RunnableParallel, RunnablePassthrough
chain = (
RunnableParallel(
context=retriever,
question=RunnablePassthrough()
)
| prompt
| llm
| output_parser
)
invoke() for single inputs, batch() for multiple inputsstream() for real-time token streamingwith_config() for runtime configurationbind() to attach tools or functions to runnables@tool decorator with clear docstringsfrom langchain_core.tools import tool
from pydantic import BaseModel, Field
class SearchInput(BaseModel):
query: str = Field(description="Search query string")
@tool(args_schema=SearchInput)
def search_database(query: str) -> str:
"""Search the database for relevant information."""
# Implementation
return results
create_react_agent or create_tool_calling_agent based on model capabilitiesConversationBufferMemory for short conversationsConversationSummaryMemory for long conversationsConversationBufferWindowMemory for fixed-length historyfrom typing import TypedDict, Annotated
from langgraph.graph import StateGraph
from operator import add
class AgentState(TypedDict):
messages: Annotated[list, add]
context: str
next_step: str
graph = StateGraph(AgentState)
LANGCHAIN_TRACING_V2=truefrom langchain_core.runnables import RunnableWithFallbacks
chain_with_fallback = primary_chain.with_fallbacks(
[fallback_chain],
exceptions_to_handle=(RateLimitError, TimeoutError)
)
ainvoke, abatch) for I/O-bound operationssickn33/antigravity-awesome-skills
moizibnyousaf/ai-agent-skills
github/awesome-copilot