Source: LangChain models, tools and retrieval docs
Official LangChain v1 docs for the chat model interface (init_chat_model, bind_tools, with_structured_output), tool definition with ToolRuntime, and retrieval building blocks.
Contents
- What: official open-source documentation (Python)
- Publisher: LangChain
- Date: accessed 2026-11-14
- Original: Models, Tools, Retrieval
Summary
Covers the provider-neutral chat model abstraction, how Python functions become model-callable tools, and the loader / splitter / embedding / vector store / retriever pipeline, with three RAG architectures compared.
Key claims
init_chat_model("provider:model", ...)builds any supported model; standard kwargs aretemperature,max_tokens,timeout,max_retries(default 6, exponential backoff, 4xx such as 401/404 not retried).configurable_fieldsmakes model and params switchable at runtime.invokereturns anAIMessage;streamyieldsAIMessageChunks that sum into one message;batch/batch_as_completedare client-side parallelism, distinct from provider batch APIs.bind_toolssupportstool_choiceandparallel_tool_calls=False;with_structured_outputaccepts Pydantic, TypedDict or JSON Schema withmethod=json_schema,function_callingorjson_mode, andinclude_raw=Truereturns raw message plusparsing_error.usage_metadatareports tokens including cache and reasoning;content_blocksnormalises text, reasoning, tool calls and server-tool results; modelprofile(beta) describes capabilities such asmax_input_tokens;reasoning_effortis a standard parameter.InMemoryRateLimiterlimits request count only, not request size.- Tools:
@tooluses the docstring as description and type hints as schema;configandruntimeare reserved argument names; aruntime: ToolRuntimeparameter injects state, context, store, stream writer and tool call ID and is hidden from the model. Returning aCommandupdates graph state and must include a matching tool message.return_direct=Trueonly applies if every tool in a parallel batch sets it. MCP tools convert via an adapter (beta). - Retrieval: 2-step RAG (fixed calls, predictable latency), agentic RAG (agent decides when to retrieve; variable latency), hybrid RAG (query enhancement and validation loops).