!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}(),document.documentElement.setAttribute("data-announcement-bar-initially-dismissed",function(){try{return"true"===localStorage.getItem("docusaurus.announcement.dismiss")}catch(t){}return!1}())

[Skip to main content](#__docusaurus_skipToContent_fallback)

LangChain v0.2 is coming soon! Preview the new docs [here](/v0.2/docs/introduction/).

[

![🦜️🔗 Langchain](/v0.1/img/brand/wordmark.png)![🦜️🔗 Langchain](/v0.1/img/brand/wordmark-dark.png)

](/v0.1/)[Docs](/v0.1/docs/get_started/introduction/)[Use cases](/v0.1/docs/use_cases/)[Integrations](/v0.1/docs/integrations/platforms/)[API Reference](https://api.js.langchain.com)

[More](#)

*   [People](/v0.1/docs/people/)
*   [Community](/v0.1/docs/community/)
*   [Tutorials](/v0.1/docs/additional_resources/tutorials/)
*   [Contributing](/v0.1/docs/contributing/)

[v0.1](#)

*   [v0.2](https://js.langchain.com/v0.2/docs/introduction)
*   [v0.1](/v0.1/docs/get_started/introduction/)

[🦜🔗](#)

*   [LangSmith](https://smith.langchain.com)
*   [LangSmith Docs](https://docs.smith.langchain.com)
*   [LangChain Hub](https://smith.langchain.com/hub)
*   [LangServe](https://github.com/langchain-ai/langserve)
*   [Python Docs](https://python.langchain.com/)

[Chat](https://chatjs.langchain.com)[](https://github.com/langchain-ai/langchainjs)

Search

*   [Use cases](/v0.1/docs/use_cases/)
    
    *   [SQL](/v0.1/docs/use_cases/sql/)
        
    *   [Chatbots](/v0.1/docs/use_cases/chatbots/)
        
        *   [Quickstart](/v0.1/docs/use_cases/chatbots/quickstart/)
        *   [Memory management](/v0.1/docs/use_cases/chatbots/memory_management/)
        *   [Retrieval](/v0.1/docs/use_cases/chatbots/retrieval/)
        *   [Tool usage](/v0.1/docs/use_cases/chatbots/tool_usage/)
    *   [Extraction](/v0.1/docs/use_cases/extraction/)
        
    *   [Query Analysis](/v0.1/docs/use_cases/query_analysis/)
        
    *   [Q&A with RAG](/v0.1/docs/use_cases/question_answering/)
        
    *   [Tool use](/v0.1/docs/use_cases/tool_use/)
        
    *   [Interacting with APIs](/v0.1/docs/use_cases/api/)
    *   [Tabular Question Answering](/v0.1/docs/use_cases/tabular/)
    *   [Graphs](/v0.1/docs/use_cases/graph/)
        
    *   [Summarization](/v0.1/docs/use_cases/summarization/)
    *   [Agent Simulations](/v0.1/docs/use_cases/agent_simulations/)
        
    *   [Autonomous Agents](/v0.1/docs/use_cases/autonomous_agents/)
        
    *   [Code Understanding](/v0.1/docs/use_cases/code_understanding/)
    *   [Audio/Video Structured Extraction](/v0.1/docs/use_cases/media/)

*   [](/v0.1/)
*   [Use cases](/v0.1/docs/use_cases/)
*   Chatbots

On this page

Chatbots
========

Overview[​](#overview "Direct link to Overview")
------------------------------------------------

Chatbots are one of the most popular use-cases for LLMs. The core features of chatbots are that they can have long-running, stateful conversations and can answer user questions using relevant information.

Architectures[​](#architectures "Direct link to Architectures")
---------------------------------------------------------------

Designing a chatbot involves considering various techniques with different benefits and tradeoffs depending on what sorts of questions you expect it to handle.

For example, chatbots commonly use [retrieval-augmented generation](/v0.1/docs/use_cases/question_answering/), or RAG, over private data to better answer domain-specific questions. You also might choose to route between multiple data sources to ensure it only uses the most topical context for final question answering, or choose to use a more specialized type of chat history or memory than just passing messages back and forth.

![Image description](/v0.1/assets/images/chat_use_case-eb8a4883931d726e9f23628a0d22e315.png)

Optimizations like this can make your chatbot more powerful, but add latency and complexity. The aim of this guide is to give you an overview of how to implement various features and help you tailor your chatbot to your particular use-case.

Table of contents[​](#table-of-contents "Direct link to Table of contents")
---------------------------------------------------------------------------

*   [Quickstart](/v0.1/docs/use_cases/chatbots/quickstart/): We recommend starting here. Many of the following guides assume you fully understand the architecture shown in the Quickstart.
*   [Memory management](/v0.1/docs/use_cases/chatbots/memory_management/): This section covers various strategies your chatbot can use to handle information from previous conversation turns.
*   [Retrieval](/v0.1/docs/use_cases/chatbots/retrieval/): This section covers how to enable your chatbot to use outside data sources as context.
*   [Tool usage](/v0.1/docs/use_cases/chatbots/tool_usage/): This section covers how to turn your chatbot into a conversational agent by adding the ability to interact with other systems and APIs using tools.

* * *

#### Help us out by providing feedback on this documentation page:

[

Previous

Large databases

](/v0.1/docs/use_cases/sql/large_db/)[

Next

Quickstart

](/v0.1/docs/use_cases/chatbots/quickstart/)

*   [Overview](#overview)
*   [Architectures](#architectures)
*   [Table of contents](#table-of-contents)

Community

*   [Discord](https://discord.gg/cU2adEyC7w)
*   [Twitter](https://twitter.com/LangChainAI)

GitHub

*   [Python](https://github.com/langchain-ai/langchain)
*   [JS/TS](https://github.com/langchain-ai/langchainjs)

More

*   [Homepage](https://langchain.com)
*   [Blog](https://blog.langchain.dev)

Copyright © 2024 LangChain, Inc.