The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
docs: how to index nits (#21623)
Bagatur506df439eb20
diff --git a/docs/docs/how_to/index.mdx b/docs/docs/how_to/index.mdxindex 6f0c373893..486d483531 100644--- a/docs/docs/how_to/index.mdx+++ b/docs/docs/how_to/index.mdx@@ -5,34 +5,37 @@ sidebar_class_name: hidden# How-to guides-Here you’ll find short answers to “How do I….?” types of questions.-These how-to guides don’t cover topics in depth – you’ll find that material in the [Tutorials](/docs/tutorials) and the [API Reference](https://api.python.langchain.com/en/latest/).-However, these guides will help you quickly accomplish common tasks.+Here you’ll find answers to “How do I….?” types of questions.+These guides are *goal-oriented* and *concrete*; they're meant to help you complete a specific task.+For conceptual explanations see [Conceptual Guides](/docs/concepts/).+For end-to-end walkthroughs see [Tutorials](/docs/tutorials).+For comprehensive descriptions of every class and function see [API Reference](https://api.python.langchain.com/en/latest/).-## Core Functionality+## Key features-This covers functionality that is core to using LangChain+This highlights functionality that is core to using LangChain.-- [How to return structured data from an LLM](/docs/how_to/structured_output/)-- [How to use a chat model to call tools](/docs/how_to/tool_calling/)-- [How to stream](/docs/how_to/streaming)-- [How to debug your LLM apps](/docs/how_to/debugging/)+- [How to: return structured data from an LLM](/docs/how_to/structured_output/)+- [How to: use a chat model to call tools](/docs/how_to/tool_calling/)+- [How to: stream runnables](/docs/how_to/streaming)+- [How to: debug your LLM apps](/docs/how_to/debugging/)## LangChain Expression Language (LCEL)-LangChain Expression Language a way to create arbitrary custom chains.--- [How to combine multiple runnables into a chain](/docs/how_to/sequence)-- [How to invoke runnables in parallel](/docs/how_to/parallel/)-- [How to attach runtime arguments to a runnable](/docs/how_to/binding/)-- [How to run custom functions](/docs/how_to/functions)-- [How to pass through arguments from one step to the next](/docs/how_to/passthrough)-- [How to add values to a chain's state](/docs/how_to/assign)-- [How to configure a chain at runtime](/docs/how_to/configure)-- [How to add message history](/docs/how_to/message_history)-- [How to route execution within a chain](/docs/how_to/routing)-- [How to inspect your runnables](/docs/how_to/inspect)-- [How to add fallbacks](/docs/how_to/fallbacks)+LangChain Expression Language is a way to create arbitrary custom chains. It is built on the Runnable protocol.++- [How to: chain runnables](/docs/how_to/sequence)+- [How to: stream runnables](/docs/how_to/streaming)+- [How to: invoke runnables in parallel](/docs/how_to/parallel/)+- [How to: attach runtime arguments to a runnable](/docs/how_to/binding/)+- [How to: run custom functions](/docs/how_to/functions)+- [How to: pass through arguments from one step to the next](/docs/how_to/passthrough)+- [How to: add values to a chain's state](/docs/how_to/assign)+- [How to: configure a chain at runtime](/docs/how_to/configure)+- [How to: add message history](/docs/how_to/message_history)+- [How to: route execution within a chain](/docs/how_to/routing)+- [How to: inspect runnables](/docs/how_to/inspect)+- [How to: add fallbacks](/docs/how_to/fallbacks)## Components@@ -42,132 +45,132 @@ These are the core building blocks you can use when building applications.Prompt Templates are responsible for formatting user input into a format that can be passed to a language model.-- [How to use few shot examples](/docs/how_to/few_shot_examples)-- [How to use few shot examples in chat models](/docs/how_to/few_shot_examples_chat/)-- [How to partially format prompt templates](/docs/how_to/prompts_partial)-- [How to compose prompts together](/docs/how_to/prompts_composition)+- [How to: use few shot examples](/docs/how_to/few_shot_examples)+- [How to: use few shot examples in chat models](/docs/how_to/few_shot_examples_chat/)+- [How to: partially format prompt templates](/docs/how_to/prompts_partial)+- [How to: compose prompts together](/docs/how_to/prompts_composition)### Example selectorsExample Selectors are responsible for selecting the correct few shot examples to pass to the prompt.-- [How to use example selectors](/docs/how_to/example_selectors)-- [How to select examples by length](/docs/how_to/example_selectors_length_based)-- [How to select examples by semantic similarity](/docs/how_to/example_selectors_similarity)-- [How to select examples by semantic ngram overlap](/docs/how_to/example_selectors_ngram)-- [How to select examples by maximal marginal relevance](/docs/how_to/example_selectors_mmr)+- [How to: use example selectors](/docs/how_to/example_selectors)+- [How to: select examples by length](/docs/how_to/example_selectors_length_based)+- [How to: select examples by semantic similarity](/docs/how_to/example_selectors_similarity)+- [How to: select examples by semantic ngram overlap](/docs/how_to/example_selectors_ngram)+- [How to: select examples by maximal marginal relevance](/docs/how_to/example_selectors_mmr)### Chat modelsChat Models are newer forms of language models that take messages in and output a message.-- [How to do function/tool calling](/docs/how_to/tool_calling)-- [How to get models to return structured output](/docs/how_to/structured_output)-- [How to cache model responses](/docs/how_to/chat_model_caching)-- [How to get log probabilities from model calls](/docs/how_to/logprobs)-- [How to create a custom chat model class](/docs/how_to/custom_chat_model)-- [How to stream a response back](/docs/how_to/chat_streaming)-- [How to track token usage](/docs/how_to/chat_token_usage_tracking)-- [How to track response metadata across providers](/docs/how_to/response_metadata)+- [How to: do function/tool calling](/docs/how_to/tool_calling)+- [How to: get models to return structured output](/docs/how_to/structured_output)+- [How to: cache model responses](/docs/how_to/chat_model_caching)+- [How to: get log probabilities](/docs/how_to/logprobs)+- [How to: create a custom chat model class](/docs/how_to/custom_chat_model)+- [How to: stream a response back](/docs/how_to/chat_streaming)+- [How to: track token usage](/docs/how_to/chat_token_usage_tracking)+- [How to: track response metadata across providers](/docs/how_to/response_metadata)### LLMsWhat LangChain calls LLMs are older forms of language models that take a string in and output a string.-- [How to cache model responses](/docs/how_to/llm_caching)-- [How to create a custom LLM class](/docs/how_to/custom_llm)-- [How to stream a response back](/docs/how_to/streaming_llm)-- [How to track token usage](/docs/how_to/llm_token_usage_tracking)-- [How to work with local LLMs](/docs/how_to/local_llms)+- [How to: cache model responses](/docs/how_to/llm_caching)+- [How to: create a custom LLM class](/docs/how_to/custom_llm)+- [How to: stream a response back](/docs/how_to/streaming_llm)+- [How to: track token usage](/docs/how_to/llm_token_usage_tracking)+- [How to: work with local LLMs](/docs/how_to/local_llms)### Output parsersOutput Parsers are responsible for taking the output of an LLM and parsing into more structured format.-- [How to use output parsers to parse an LLM response into structured format](/docs/how_to/output_parser_structured)-- [How to parse JSON output](/docs/how_to/output_parser_json)-- [How to parse XML output](/docs/how_to/output_parser_xml)-- [How to parse YAML output](/docs/how_to/output_parser_yaml)-- [How to retry when output parsing errors occur](/docs/how_to/output_parser_retry)-- [How to try to fix errors in output parsing](/docs/how_to/output_parser_fixing)-- [How to write a custom output parser class](/docs/how_to/output_parser_custom)+- [How to: use output parsers to parse an LLM response into structured format](/docs/how_to/output_parser_structured)+- [How to: parse JSON output](/docs/how_to/output_parser_json)+- [How to: parse XML output](/docs/how_to/output_parser_xml)+- [How to: parse YAML output](/docs/how_to/output_parser_yaml)+- [How to: retry when output parsing errors occur](/docs/how_to/output_parser_retry)+- [How to: try to fix errors in output parsing](/docs/how_to/output_parser_fixing)+- [How to: write a custom output parser class](/docs/how_to/output_parser_custom)### Document loadersDocument Loaders are responsible for loading documents from a variety of sources.-- [How to load CSV data](/docs/how_to/document_loader_csv)-- [How to load data from a directory](/docs/how_to/document_loader_directory)-- [How to load HTML data](/docs/how_to/document_loader_html)-- [How to load JSON data](/docs/how_to/document_loader_json)-- [How to load Markdown data](/docs/how_to/document_loader_markdown)-- [How to load Microsoft Office data](/docs/how_to/document_loader_office_file)-- [How to load PDF files](/docs/how_to/document_loader_pdf)-- [How to write a custom document loader](/docs/how_to/document_loader_custom)+- [How to: load CSV data](/docs/how_to/document_loader_csv)+- [How to: load data from a directory](/docs/how_to/document_loader_directory)+- [How to: load HTML data](/docs/how_to/document_loader_html)+- [How to: load JSON data](/docs/how_to/document_loader_json)+- [How to: load Markdown data](/docs/how_to/document_loader_markdown)+- [How to: load Microsoft Office data](/docs/how_to/document_loader_office_file)+- [How to: load PDF files](/docs/how_to/document_loader_pdf)+- [How to: write a custom document loader](/docs/how_to/document_loader_custom)### Text splittersText Splitters take a document and split into chunks that can be used for retrieval.-- [How to recursively split text](/docs/how_to/recursive_text_splitter)-- [How to split by HTML headers](/docs/how_to/HTML_header_metadata_splitter)-- [How to split by HTML sections](/docs/how_to/HTML_section_aware_splitter)-- [How to split by character](/docs/how_to/character_text_splitter)-- [How to split code](/docs/how_to/code_splitter)-- [How to split Markdown by headers](/docs/how_to/markdown_header_metadata_splitter)-- [How to recursively split JSON](/docs/how_to/recursive_json_splitter)-- [How to split text into semantic chunks](/docs/how_to/semantic-chunker)-- [How to split by tokens](/docs/how_to/split_by_token)+- [How to: recursively split text](/docs/how_to/recursive_text_splitter)+- [How to: split by HTML headers](/docs/how_to/HTML_header_metadata_splitter)+- [How to: split by HTML sections](/docs/how_to/HTML_section_aware_splitter)+- [How to: split by character](/docs/how_to/character_text_splitter)+- [How to: split code](/docs/how_to/code_splitter)+- [How to: split Markdown by headers](/docs/how_to/markdown_header_metadata_splitter)+- [How to: recursively split JSON](/docs/how_to/recursive_json_splitter)+- [How to: split text into semantic chunks](/docs/how_to/semantic-chunker)+- [How to: split by tokens](/docs/how_to/split_by_token)### Embedding modelsEmbedding Models take a piece of text and create a numerical representation of it.-- [How to embed text data](/docs/how_to/embed_text)-- [How to cache embedding results](/docs/how_to/caching_embeddings)+- [How to: embed text data](/docs/how_to/embed_text)+- [How to: cache embedding results](/docs/how_to/caching_embeddings)### Vector storesVector stores are databases that can efficiently store and retrieve embeddings.-- [How to use a vector store to retrieve data](/docs/how_to/vectorstores)+- [How to: use a vector store to retrieve data](/docs/how_to/vectorstores)### RetrieversRetrievers are responsible for taking a query and returning relevant documents.-- [How use a vector store to retrieve data](/docs/how_to/vectorstore_retriever)-- [How to generate multiple queries to retrieve data for](/docs/how_to/MultiQueryRetriever)-- [How to use contextual compression to compress the data retrieved](/docs/how_to/contextual_compression)-- [How to write a custom retriever class](/docs/how_to/custom_retriever)-- [How to combine the results from multiple retrievers](/docs/how_to/ensemble_retriever)-- [How to reorder retrieved results to put most relevant documents not in the middle](/docs/how_to/long_context_reorder)-- [How to generate multiple embeddings per document](/docs/how_to/multi_vector)-- [How to retrieve the whole document for a chunk](/docs/how_to/parent_document_retriever)-- [How to generate metadata filters](/docs/how_to/self_query)-- [How to create a time-weighted retriever](/docs/how_to/time_weighted_vectorstore)-- [How to use hybrid vector and keyword retrieval](/docs/how_to/hybrid)+- [How to: use a vector store to retrieve data](/docs/how_to/vectorstore_retriever)+- [How to: generate multiple queries to retrieve data for](/docs/how_to/MultiQueryRetriever)+- [How to: use contextual compression to compress the data retrieved](/docs/how_to/contextual_compression)+- [How to: write a custom retriever class](/docs/how_to/custom_retriever)+- [How to: combine the results from multiple retrievers](/docs/how_to/ensemble_retriever)+- [How to: reorder retrieved results to put most relevant documents not in the middle](/docs/how_to/long_context_reorder)+- [How to: generate multiple embeddings per document](/docs/how_to/multi_vector)+- [How to: retrieve the whole document for a chunk](/docs/how_to/parent_document_retriever)+- [How to: generate metadata filters](/docs/how_to/self_query)+- [How to: create a time-weighted retriever](/docs/how_to/time_weighted_vectorstore)+- [How to: use hybrid vector and keyword retrieval](/docs/how_to/hybrid)### IndexingIndexing is the process of keeping your vectorstore in-sync with the underlying data source.-- [How to reindex data to keep your vectorstore in-sync with the underlying data source](/docs/how_to/indexing)+- [How to: reindex data to keep your vectorstore in-sync with the underlying data source](/docs/how_to/indexing)### ToolsLangChain Tools contain a description of the tool (to pass to the language model) as well as the implementation of the function to call).-- [How to use LangChain tools](/docs/how_to/tools)-- [How to use a chat model to call tools](/docs/how_to/tool_calling/)-- [How to use LangChain toolkits](/docs/how_to/toolkits)-- [How to define a custom tool](/docs/how_to/custom_tools)-- [How to convert LangChain tools to OpenAI functions](/docs/how_to/tools_as_openai_functions)-- [How to use tools without function calling](/docs/how_to/tools_prompting)-- [How to let the LLM choose between multiple tools](/docs/how_to/tools_multiple)-- [How to add a human in the loop to tool usage](/docs/how_to/tools_human)-- [How to do parallel tool use](/docs/how_to/tools_parallel)-- [How to handle errors when calling tools](/docs/how_to/tools_error)+- [How to: use LangChain tools](/docs/how_to/tools)+- [How to: use a chat model to call tools](/docs/how_to/tool_calling/)+- [How to: use LangChain toolkits](/docs/how_to/toolkits)+- [How to: define a custom tool](/docs/how_to/custom_tools)+- [How to: convert LangChain tools to OpenAI functions](/docs/how_to/tools_as_openai_functions)+- [How to: use tools without function calling](/docs/how_to/tools_prompting)+- [How to: let the LLM choose between multiple tools](/docs/how_to/tools_multiple)+- [How to: add a human in the loop to tool usage](/docs/how_to/tools_human)+- [How to: do parallel tool use](/docs/how_to/tools_parallel)+- [How to: handle errors when calling tools](/docs/how_to/tools_error)### Agents@@ -177,20 +180,19 @@ For in depth how-to guides for agents, please check out [LangGraph](https://gith:::-- [How to use legacy LangChain Agents (AgentExecutor)](/docs/how_to/agent_executor)-- [How to migrate from legacy LangChain agents to LangGraph](/docs/how_to/migrate_agent)+- [How to: use legacy LangChain Agents (AgentExecutor)](/docs/how_to/agent_executor)+- [How to: migrate from legacy LangChain agents to LangGraph](/docs/how_to/migrate_agent)### CustomAll of LangChain components can easily be extended to support your own versions.-- [How to create a custom chat model class](/docs/how_to/custom_chat_model)-- [How to create a custom LLM class](/docs/how_to/custom_llm)-- [How to write a custom retriever class](/docs/how_to/custom_retriever)-- [How to write a custom document loader](/docs/how_to/document_loader_custom)-- [How to write a custom output parser class](/docs/how_to/output_parser_custom)--- [How to define a custom tool](/docs/how_to/custom_tools)+- [How to: create a custom chat model class](/docs/how_to/custom_chat_model)+- [How to: create a custom LLM class](/docs/how_to/custom_llm)+- [How to: write a custom retriever class](/docs/how_to/custom_retriever)+- [How to: write a custom document loader](/docs/how_to/document_loader_custom)+- [How to: write a custom output parser class](/docs/how_to/output_parser_custom)+- [How to: define a custom tool](/docs/how_to/custom_tools)## Use cases@@ -201,54 +203,54 @@ These guides cover use-case specific details.Retrieval Augmented Generation (RAG) is a way to connect LLMs to external sources of data.-- [How to add chat history](/docs/how_to/qa_chat_history_how_to/)-- [How to stream](/docs/how_to/qa_streaming/)-- [How to return sources](/docs/how_to/qa_sources/)-- [How to return citations](/docs/how_to/qa_citations/)-- [How to do per-user retrieval](/docs/how_to/qa_per_user/)+- [How to: add chat history](/docs/how_to/qa_chat_history_how_to/)+- [How to: stream](/docs/how_to/qa_streaming/)+- [How to: return sources](/docs/how_to/qa_sources/)+- [How to: return citations](/docs/how_to/qa_citations/)+- [How to: do per-user retrieval](/docs/how_to/qa_per_user/)### ExtractionExtraction is when you use LLMs to extract structured information from unstructured text.-- [How to use reference examples](/docs/how_to/extraction_examples/)-- [How to handle long text](/docs/how_to/extraction_long_text/)-- [How to do extraction without using function calling](/docs/how_to/extraction_parse)+- [How to: use reference examples](/docs/how_to/extraction_examples/)+- [How to: handle long text](/docs/how_to/extraction_long_text/)+- [How to: do extraction without using function calling](/docs/how_to/extraction_parse)### ChatbotsChatbots involve using an LLM to have a conversation.-- [How to manage memory](/docs/how_to/chatbots_memory)-- [How to do retrieval](/docs/how_to/chatbots_retrieval)-- [How to use tools](/docs/how_to/chatbots_tools)+- [How to: manage memory](/docs/how_to/chatbots_memory)+- [How to: do retrieval](/docs/how_to/chatbots_retrieval)+- [How to: use tools](/docs/how_to/chatbots_tools)### Query analysisQuery Analysis is the task of using an LLM to generate a query to send to a retriever.-- [How to add examples to the prompt](/docs/how_to/query_few_shot)-- [How to handle cases where no queries are generated](/docs/how_to/query_no_queries)-- [How to handle multiple queries](/docs/how_to/query_multiple_queries)-- [How to handle multiple retrievers](/docs/how_to/query_multiple_retrievers)-- [How to construct filters](/docs/how_to/query_constructing_filters)-- [How to deal with high cardinality categorical variables](/docs/how_to/query_high_cardinality)+- [How to: add examples to the prompt](/docs/how_to/query_few_shot)+- [How to: handle cases where no queries are generated](/docs/how_to/query_no_queries)+- [How to: handle multiple queries](/docs/how_to/query_multiple_queries)+- [How to: handle multiple retrievers](/docs/how_to/query_multiple_retrievers)+- [How to: construct filters](/docs/how_to/query_constructing_filters)+- [How to: deal with high cardinality categorical variables](/docs/how_to/query_high_cardinality)### Q&A over SQL + CSVYou can use LLMs to do question answering over tabular data.-- [How to use prompting to improve results](/docs/how_to/sql_prompting)-- [How to do query validation](/docs/how_to/sql_query_checking)-- [How to deal with large databases](/docs/how_to/sql_large_db)-- [How to deal with CSV files](/docs/how_to/sql_csv)+- [How to: use prompting to improve results](/docs/how_to/sql_prompting)+- [How to: do query validation](/docs/how_to/sql_query_checking)+- [How to: deal with large databases](/docs/how_to/sql_large_db)+- [How to: deal with CSV files](/docs/how_to/sql_csv)### Q&A over graph databasesYou can use an LLM to do question answering over graph databases.-- [How to map values to a database](/docs/how_to/graph_mapping)-- [How to add a semantic layer over the database](/docs/how_to/graph_semantic)-- [How to improve results with prompting](/docs/how_to/graph_prompting)-- [How to construct knowledge graphs](/docs/how_to/graph_constructing)+- [How to: map values to a database](/docs/how_to/graph_mapping)+- [How to: add a semantic layer over the database](/docs/how_to/graph_semantic)+- [How to: improve results with prompting](/docs/how_to/graph_prompting)+- [How to: construct knowledge graphs](/docs/how_to/graph_constructing)diff --git a/docs/docs/how_to/inspect.ipynb b/docs/docs/how_to/inspect.ipynbindex f80e828a5c..41b446f649 100644--- a/docs/docs/how_to/inspect.ipynb+++ b/docs/docs/how_to/inspect.ipynb@@ -5,7 +5,7 @@"id": "8c5eb99a","metadata": {},"source": [- "# How to inspect your runnables\n",+ "# How to inspect runnables\n","\n",":::info Prerequisites\n","\n",diff --git a/docs/docs/how_to/logprobs.ipynb b/docs/docs/how_to/logprobs.ipynbindex 4cf228e44a..a39e190c31 100644--- a/docs/docs/how_to/logprobs.ipynb+++ b/docs/docs/how_to/logprobs.ipynb@@ -5,7 +5,7 @@"id": "78b45321-7740-4399-b2ad-459811131de3","metadata": {},"source": [- "# How to get log probabilities from model calls\n",+ "# How to get log probabilities\n","\n",":::info Prerequisites\n","\n",diff --git a/docs/docs/how_to/streaming.ipynb b/docs/docs/how_to/streaming.ipynbindex 1011792203..93c1ec8da3 100644--- a/docs/docs/how_to/streaming.ipynb+++ b/docs/docs/how_to/streaming.ipynb@@ -15,7 +15,7 @@"id": "bb7d49db-04d3-4399-bfe1-09f82bbe6015","metadata": {},"source": [- "# How to stream\n",+ "# How to stream runnables\n","\n",":::info Prerequisites\n","\n",