Zubnet AIApprendreWiki › LangChain
Outils

LangChain

Un framework open-source populaire pour construire des applications avec des modèles de langage. LangChain fournit des abstractions pour des patterns communs : connecter les LLM à des sources de données (RAG), construire des chaînes multi-étapes d'appels LLM, gérer la mémoire de conversation, utiliser des outils, et orchestrer des agents. Il supporte multiples fournisseurs (Anthropic, OpenAI, modèles locaux) à travers une interface unifiée.

Pourquoi c'est important

LangChain est le framework d'application LLM le plus largement utilisé, ce qui veut dire que tu le rencontreras dans des tutoriels, des descriptions de poste et des codebases existants. Il est aussi controversé — les critiques argumentent qu'il ajoute de l'abstraction inutile par-dessus des simples appels API. Comprendre ce que LangChain fait (et quand l'utiliser vs. des appels API directs) t'aide à prendre des décisions architecturales informées.

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.

Concepts liés

← Tous les termes
← KV Cache Large Language Model →