Prompts Forms Resume Reports ★ Saved ★ Saved★ + Submit a tool
Tools and frameworks

LangChain

About 2316 characters Updated Nov 30, 2026 23 views AI wiki

LangChain is a framework for developing large-model applications that appeared in 2022, turning "calling an LLM" into "orchestrating a workflow". It provides prompt templates, memory management, tool calling, RAG retrieval, agents, and other modules, and is one of the earliest and most popular large-model application frameworks.

Core abstractions

Model: uniformly wraps the LLM interfaces of different vendors, so switching models is a one-line configuration change. Prompt: manages prompts with template variables and supports few-shot example injection. Chain: strings multiple steps together, such as "retrieve documents -> assemble prompt -> call model -> parse output". Memory: manages multi-turn conversation history, supporting sliding windows, summary compression, and vector retrieval. Tool: wraps functions, APIs, and search engines as tools the model can call. Agent: lets the model decide autonomously which tool to call and in what order.

Typical applications

RAG question answering: split documents -> vectorize -> retrieve -> assemble prompt -> generate answer. LangChain provides complete Document Loaders (supporting PDF, Word, web pages, and databases) and Text Splitters. Chatbots: multi-turn dialogue with memory. Agent automation: let the model call search, calculators, databases, and code executors to complete tasks. Document analysis: batch-process long documents and extract structured information.

LangGraph

A newer framework later released by the LangChain team, it defines agent workflows with a graph structure supporting loops, conditional branches, state management, and human-in-the-loop. Compared with the linear structure of the original Chain, LangGraph suits complex multi-step agent systems better and is the direction the team now promotes.

LangSmith

A companion observability platform that records the prompt, response, latency, and token consumption of each call for debugging and evaluation. In production it is essential for investigating "why the model answered wrongly".

Criticism and controversy

Critics note that LangChain has excessive abstraction - simple tasks are wrapped in multiple nested objects, and when debugging you cannot tell where the error is; versions iterate quickly and APIs are often incompatible; hiding low-level details makes performance problems hard to locate. Many teams eventually choose to write orchestration logic directly with the vendor SDK.

Selection advice

For rapid prototyping, standard RAG pipelines, and when many ready-made connectors are needed, LangChain saves a lot of time. When you want controllable performance, simple logic, and long-term maintenance, using the vendor SDK directly may be clearer.