Zubnet AIAprenderWiki › LangChain
Ferramentas

LangChain

Um framework open-source popular para construir aplicações com modelos de linguagem. LangChain provê abstrações para padrões comuns: conectar LLMs a fontes de dados (RAG), construir chains multi-passo de chamadas LLM, gerenciar memória de conversa, usar ferramentas e orquestrar agentes. Suporta múltiplos provedores (Anthropic, OpenAI, modelos locais) através de uma interface unificada.

Por que importa

LangChain é o framework de aplicação LLM mais amplamente usado, o que significa que você vai encontrá-lo em tutoriais, descrições de trabalho e codebases existentes. Também é controverso — críticos argumentam que adiciona abstração desnecessária sobre chamadas API simples. Entender o que LangChain faz (e quando usá-lo vs. chamadas API diretas) te ajuda a tomar decisões arquiteturais informadas.

Deep Dive

LangChain's core abstractions: Models (unified interface to LLM providers), Prompts (templates with variables), Chains (sequences of LLM calls and processing steps), Agents (LLMs that decide which tools to use), Memory (conversation state management), and Retrievers (connections to vector databases and other data sources). These compose: a RAG chain connects a retriever to a model via a prompt template.

The Controversy

LangChain is divisive in the developer community. Proponents value the unified abstractions, the breadth of integrations, and the speed of prototyping. Critics argue that the abstractions are leaky (you need to understand the underlying APIs anyway), the code is hard to debug (too many layers between you and the API call), and that simple applications are better served by direct API calls. The consensus seems to be: LangChain is good for prototyping and complex multi-step workflows, but simple applications often don't need it.

LangGraph and LangSmith

The LangChain ecosystem expanded beyond the core library. LangGraph handles complex agent workflows as state machines (better for multi-step agents than linear chains). LangSmith provides observability — tracing, evaluation, and monitoring for LLM applications. The ecosystem addresses real needs, but the complexity of the full stack is a valid concern for teams that need to maintain and debug these systems in production.

Conceitos relacionados

← Todos os termos
← KV Cache Large Language Model →