langchain-ai/langchain
Glossary
Vocabulary used throughout the codebase, with pointers to the source.
| Term | Meaning |
|---|---|
| Runnable | The universal invocation protocol for everything that takes an input and returns an output: models, parsers, prompts, retrievers, agents, even functions wrapped in RunnableLambda. Defined in libs/core/langchain_core/runnables/base.py. |
| LCEL | LangChain Expression Language — the | operator and helpers that compose Runnable objects into pipelines. prompt | model | parser produces a RunnableSequence. |
| BaseChatModel | The interface every chat-style model implements. The legacy class is BaseChatModel in libs/core/langchain_core/language_models/chat_models.py; the new streaming-first contract is BaseChatModelV1 in chat_model_stream.py. Partners typically subclass one of these via the _compat_bridge.py shim. |
| BaseLLM | The older completion-style model interface, in libs/core/langchain_core/language_models/llms.py. New integrations prefer BaseChatModel. |
| Message | A turn in a conversation: HumanMessage, AIMessage, SystemMessage, ToolMessage, FunctionMessage, ChatMessage, plus their *Chunk streaming counterparts. See libs/core/langchain_core/messages/. |
| Content block | A typed piece of message content introduced in v1: TextContentBlock, ImageContentBlock, AudioContentBlock, VideoContentBlock, ReasoningContentBlock, ToolCall, ServerToolCall, Citation, Annotation. The taxonomy lives in libs/core/langchain_core/messages/content.py. |
| Tool | A callable wrapped with input/output schemas the model can invoke. BaseTool and the @tool decorator are in libs/core/langchain_core/tools/. |
| Tool call | The model's request to execute a tool. Represented as ToolCall in libs/core/langchain_core/messages/tool.py; appears as part of an AIMessage's content. |
| ToolNode | The langgraph node that actually runs tools. langchain.agents constructs a ToolNode from the tools passed to create_agent. |
| Prompt template | A parameterized prompt: PromptTemplate (string), ChatPromptTemplate (messages), few-shot variants. See libs/core/langchain_core/prompts/. |
| Output parser | A Runnable that turns model output into a typed value. Includes JsonOutputParser, PydanticOutputParser, StrOutputParser, OutputFixingParser. See libs/core/langchain_core/output_parsers/. |
| Callback | The observability protocol — CallbackHandler methods receive events for every LLM/tool/chain start, end, and error. Manager classes (CallbackManager) propagate config through nested runs. See libs/core/langchain_core/callbacks/. |
| Tracer | A specialized callback handler that builds a tree of runs for LangSmith. See libs/core/langchain_core/tracers/. |
| LangSmith | The hosted observability/eval platform. langchain-core depends on the langsmith SDK directly so that traces flow without extra setup. |
| LangGraph | A separate library for low-level agent orchestration via StateGraph. langchain.agents.create_agent builds on top of it. |
| Agent | In v1, the result of langchain.agents.create_agent(...) — a compiled langgraph graph that wraps a model + tools + middleware loop. In langchain-classic, Agent referred to legacy MRKL/ReAct/OpenAI-functions agents. |
| Middleware | A v1 concept implementing AgentMiddleware. Hooks include before_agent, before_model, wrap_model_call, wrap_tool_call, after_model, after_agent. Built-ins live in libs/langchain_v1/langchain/agents/middleware/. |
| Structured output | Constraining a model's reply to a schema. ToolStrategy, ProviderStrategy, AutoStrategy in libs/langchain_v1/langchain/agents/structured_output.py implement different strategies. |
| Provider | A model vendor (OpenAI, Anthropic, …). The _BUILTIN_PROVIDERS registry in libs/langchain_v1/langchain/chat_models/base.py maps a provider key to a (module, class, ctor) tuple used by init_chat_model. |
| Partner package | A LangChain-maintained integration package, e.g. langchain-openai, langchain-anthropic. Source under libs/partners/<provider>/. |
| Community | The langchain-community package (separate repository) collecting third-party-contributed integrations. langchain-classic re-exports many of them. |
| Model profile | A capability descriptor (context window, supports vision, supports tools, pricing) shipped as JSON in each partner's data/ directory and refreshed by the langchain-profiles CLI. Accessed at runtime via BaseChatModel.profile. |
| Standard tests | The shared test base classes in libs/standard-tests/langchain_tests/. Every partner package inherits from them. |
| Indexing API | The deduplicating vector-store loader in libs/langchain/langchain_classic/indexes/ (legacy) and libs/core/langchain_core/indexing/ (new). |
| Self-query retriever | A retriever that uses an LLM to translate natural language into a structured filter against a vector store. See libs/langchain/langchain_classic/retrievers/self_query/. |
| Hub | The LangSmith Hub of shared prompts. Loaded via langchain_classic.hub.pull (libs/langchain/langchain_classic/hub.py). |
| Serializable | A subclass of langchain_core.load.serializable.Serializable whose instances can be JSON-encoded and re-hydrated. Used for chains, prompts, and many runnables. |
| VCR test | A test that records and replays HTTP interactions via vcrpy. The _test_vcr.yml workflow runs them. |
| Snapshot test | A test using syrupy that asserts an output matches a pre-recorded snapshot. |
| Conventional commits | The PR/commit title format the repo enforces (feat(scope): ..., fix(scope): ...). See .github/workflows/pr_lint.yml for allowed types and scopes. |
Acronyms
| Acronym | Expansion |
|---|---|
| LLM | Large language model |
| LCEL | LangChain Expression Language |
| RAG | Retrieval-augmented generation |
| HITL | Human-in-the-loop |
| PII | Personally identifiable information |
| MRKL | Modular Reasoning, Knowledge and Language (the original LangChain agent pattern) |
| ReAct | Reason + Act prompting pattern |
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.