LangChain
Definición
LangChain es un framework for building LLM applications: chains, agents, tools, and RAG pipelines. It abstracts providers, prompts, and recuperación for quick prototyping and production.
Complementa LlamaIndex (que enfatiza datos e indexación); LangChain enfatiza cadenas componibles y bucles de agentes. Úselo cuando you need RAG, agents with tools, or multi-step prompt workflows with minimal glue code.
Cómo funciona
Se componen componentes: LLM (OpenAI, Anthropic, local, etc.), prompts, recuperadores (vector stores, embeddings), and tools (APIs, search, code). Chains wire them in sequence (por ej. prompt → LLM → parser). Agents add a loop: LLM decides which tool to call, you execute it and append the result, repeat until the LLM returns a final answer. LangSmith provides tracing and evaluation. Integrations cover many vector databases, document loaders, and tool APIs. Start with a template (por ej. RAG, agent) and swap or add components as needed.
Casos de uso
LangChain is used to assemble LLM apps quickly: RAG, agents, and workflows with minimal boilerplate.
- Building RAG pipelines and document Q&A applications
- Implementing agents with tools (search, APIs, code)
- Rapid prototyping of LLM workflows with minimal boilerplate