LangChain
Definição
LangChain é um framework for building LLM applications: chains, agents, tools, and RAG pipelines. It abstracts providers, prompts, and recuperação for quick prototyping and production.
Ele complementa o LlamaIndex (que enfatiza dados e indexação); LangChain enfatiza cadeias componívele chains and agent loops. Use quando you need RAG, agents with tools, or multi-step prompt workflows with minimal glue code.
Como funciona
Você compõe componentes: LLM (OpenAI, Anthropic, local, etc.), prompts, recuperadores (vector stores, embeddings), e ferramentas (APIs, busca, código). Chains os conectam em sequência (por ex. 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 ex. 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