magnus919/agent-skills

langchain

- Build LLM applications with LangChain.

Ver código-fonte

Como usar

  1. Copie o comando e verifique o pacote antes de instalar no seu ambiente de agente.
  2. Consulte no original as ferramentas, credenciais e ambientes necessários.
  3. Descreva os dados de entrada e a entrega esperada; confira a saída com as fontes.
npx skills add https://github.com/magnus919/agent-skills --skill langchain

Antes de começar

  • A instalação não inclui assinatura de modelo, franquia API ou acesso aos seus arquivos.
  • Estrelas e instalações indicam atividade, não um teste independente de qualidade ou segurança.
Documento original do Skill

Renderizado do repositório de origem, preservando títulos, exemplos, código, tabelas, links e imagens.

LangChain Expert Skill

LangChain is an MIT-licensed Python framework for building LLM-powered applications. Since v1.0 (October 2025), it provides a layered architecture: high-level chain composition via LCEL (LangChain Expression Language), agent creation via create_agent (running on the LangGraph runtime underneath), and production observability via LangSmith. With 1000+ integrations and 100K+ GitHub stars, it is the most widely adopted LLM orchestration framework.

Key v1.0 change: All new LangChain agents run on the LangGraph runtime. AgentExecutor is in maintenance mode until December 2026. Use create_agent for new agents. Drop to LangGraph directly when you need full state-machine control.

⚠️ CRITICAL: Do NOT use AgentExecutor for new code. It is in maintenance mode until December 2026. Use create_agent(model, tools, prompt) instead — it generates a LangGraph state machine with streaming, persistence, and observability out of the box.

Core Principles

These principles govern every decision when building with LangChain. Read them before proceeding to the reference guides.
  1. LCEL is the composition primitive. The pipe operator (|) chains Runnables. Every component — prompt, model, parser, retriever — implements the Runnable interface. Build everything in LCEL.
  2. Agents run on LangGraph. Since v1.0, create_agent generates a LangGraph state machine underneath. You get streaming, persistence, and observability without writing graph code. Drop to LangGraph when you need branching, cycles, or human-in-the-loop.
  3. RAG is a chain, not a framework. retriever | prompt | model | parser is the canonical RAG pattern. Document loaders, splitters, and vector stores are all interchangeable components.
  4. LangSmith is production observability. Enable tracing at startup. 89% of production teams use observability — without it, debugging agent behavior is guesswork.
  5. The ecosystem is the moat. 1000+ integrations mean model providers, vector stores, and tools are swappable with one line. Build against the interface, not the implementation.

Where to Start

You already have...Start here
Nothing — blank projectInstall LangChain, build a basic LCEL chain
Documents to queryBuild a RAG chain (load, split, embed, retrieve, generate)
A need for agentic behaviorUse create_agent with tools
Existing AgentExecutor codeMigrate to create_agent — see references/agent-patterns.md
A production deploymentAdd LangSmith tracing + LangServe deployment
Comparing frameworksSee the Framework Routing Guide

Pipeline Mode

ModeWhenPhases to runSkip
QuickSingle chain, explorationprompt → model → parserRetrieval, agents, production hardening
RAGDocument Q&Aload → split → embed → retrieve → generateAgent orchestration, deployment
AgentTool-using agentscreate_agent + tools + LangGraph runtimeIf simple chain suffices
ProductionShipping to usersRAG/Agent + LangSmith + LangServeNothing

Quick Reference

TaskApproachReference
Basic chain`prompt \model \parser`references/lcel-reference.md
RAG pipeline`retriever \prompt \model \parser`references/rag-strategies.md
Create agentcreate_agent(model, tools, prompt)references/agent-patterns.md
Tool definition@tool decoratorreferences/agent-patterns.md
Multi-agentLangGraph supervisor patternreferences/agent-patterns.md
ObservabilitySet LANGCHAINTRACINGV2=truereferences/production-deployment.md
DeploymentLangServe or LangSmith Deploymentreferences/production-deployment.md
Vector storeOne-line swap (Chroma, Pinecone, pgvector)references/integration-ecosystem.md

When to Use This Skill

Load this skill any time you are:

  • Building LCEL chains for LLM-powered applications
  • Implementing RAG pipelines over enterprise or personal data
  • Creating agents with tool-calling and multi-step reasoning
  • Deploying LLM applications to production with observability
  • Comparing LangChain with LlamaIndex, Haystack, or raw API calls

Framework Routing Guide

This skill is part of a portfolio of framework skills. When deciding which fits:

ScenarioReach forWhy
I have chains to composeLangChainLCEL is the cleanest pipe-based composition model
I have documents to queryLlamaIndexData ingestion and retrieval are first-class primitives
I have agents to orchestrateLangGraphState-machine semantics, subgraphs, human-in-the-loop
I have a tool to wrap as an agentPydanticAIType-safe agent definitions with dependency injection
I have search pipelinesHaystackPipeline model is more mature for search workloads
Fast prototype of any kindLangChainFastest path from zero to working chain
A typed, bounded decision inside an agent workflowSystem OneSystem One owns question/model behavior and calibration; use LangChain middleware or outer conditional orchestration as the implementation seam, and harness-engineering for placement and whole-task outcomes

Reference Files

ReferenceLoad whenFile
LCEL ReferenceBuilding chains with the pipe operatorreferences/lcel-reference.md
ArchitectureUnderstanding package structure, Runnable, v1.0references/architecture.md
RAG StrategiesBuilding RAG pipelinesreferences/rag-strategies.md
Agent PatternsCreating agents with tools and multi-agentreferences/agent-patterns.md
Typed System One decision in an agentRoute the adapter seam, unknown lane, and handoff between model semantics and harness outcomesreferences/agent-patterns.md — see “Keep typed decisions outside the chat model”; continue to harness-engineering for placement and whole-task evidence
Production & DeploymentLangServe, LangSmith, deploymentreferences/production-deployment.md
Integration EcosystemModel providers, vector stores, toolsreferences/integration-ecosystem.md
FAQ & TroubleshootingCommon errors and fixesreferences/faq-and-troubleshooting.md
Callbacks SystemCustom logging, monitoring, agent auditingreferences/callbacks.md
Validation AuditResearch validation of all API claimsreferences/validation-audit.md

Template Files

TemplateWhen to useFile
Basic ChainSingle prompt→model→parser chaintemplates/basic-chain.py
RAG PipelineDocument Q&A with retrievaltemplates/rag-pipeline.py
Agent with ToolsTool-using agent with LangGraph runtimetemplates/agent-with-tools.py
Production DeployLangServe deployment with LangSmithtemplates/production-deploy.py

Scripts

ScriptPurposeFile
check-setupVerify LangChain installationscripts/check-setup.py

Troubleshooting Guide

SymptomLikely causeFixReference
Chain returns nothingOutput parser not connectedAdd .pipe(StrOutputParser()) or equivalentreferences/lcel-reference.md
Agent not calling toolsTool schema mismatchCheck tool has docstring and type hintsreferences/agent-patterns.md
LangSmith traces missingLANGCHAINTRACINGV2 not setSet env var before any chain executionreferences/production-deployment.md
Deprecation warningUsing AgentExecutorMigrate to create_agent (LangGraph runtime)references/agent-patterns.md
Model not foundIntegration package missingInstall langchain-openai, langchain-anthropic, etc.references/integration-ecosystem.md
Streaming not workingLCEL chain not streaming-nativeEnsure all components implement stream()references/lcel-reference.md
Vector store connection failsWrong credentials or missing packageInstall langchain-community + provider packagereferences/integration-ecosystem.md

When NOT to Use LangChain

  • Single-model, single-prompt application — raw API calls are simpler and more debuggable
  • Maximum transparency needed — LangGraph (which LangChain uses underneath) provides more visibility
  • Pure multi-agent state machines — LangGraph directly is the correct tool, not the high-level API
  • Stateless microservice with no LLM orchestration — LangChain adds overhead without benefit

Relacionados por tarefa

do mesmo repositório

Mais Skills

Todos os Skills
magnus919
Comunidade

analog-occultism

- Use this skill to create subject-neutral images and videos in an analog occultism / industrial CRT noir aesthetic: near-monochrome archival technical atmosphere, severe low-key lighting, tactile signal degradation, industrial geometry, and quiet unresolved tension. Use for portraits, products, environments, interfaces, diagrams, abstract forms, stills, and motion. Do not use for colorful cyberpunk, vaporwave, glossy advertising, conventional horror, or clean digital renders.

instalações
1
GitHub Stars
127
Atualizado
13 de out.
magnus919
Comunidade

api-design-and-evolution

- Design, govern, document, review, and evolve consumer-facing APIs and event interfaces. Use when choosing REST/HTTP, GraphQL, RPC, events, webhooks, or streaming; writing OpenAPI or AsyncAPI contracts; assessing an API landscape, ownership, duplication, lifecycle, discoverability, retirement, gateways, service meshes, north-south or east-west traffic, routing, policy, observability, or failure boundaries; defining schemas, pagination, mutations, errors, idempotency, or compatibility; or planni

instalações
1
GitHub Stars
127
Atualizado
13 de out.
magnus919
Comunidade

binary-analysis

- Plan static inspection of unknown binary files with a deterministic CLI whose Ghidra operations are currently unimplemented and fail closed. Use when you need to inspect a PE, ELF, or Mach-O file — triage suspicious binaries, map imported APIs, decompile functions, trace call paths, or produce structured evidence reports. Do not use for runtime analysis (debugging, dynamic tracing, sandbox execution), for modifying or patching binaries, or for binaries you already know everything about. The sk

instalações
1
GitHub Stars
127
Atualizado
13 de out.
magnus919
Comunidade

bmad

- Use this skill to run BMad (Breakthrough Method of Agile AI-Driven Development) as a harness-agnostic control-plane protocol that turns human intent into bounded, inspectable, resumable agent work. Compress intent into a five-field contract (Why, Capabilities, Constraints, Non-goals, Success signal); classify work as direct/bounded/initiative and route to the smallest safe path; carry decisions in durable artifacts; review as triage; route failure to the layer where ambiguity entered; and gate

instalações
1
GitHub Stars
127
Atualizado
13 de out.