GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • index
  • modules
  • next
  • ChatterBot 1.2.15 documentation
  • Edit on GitHub
  • Quick Start Guide
  • ChatterBot Tutorial
  • Examples
  • Training
  • Preprocessors
  • Security
  • Large Language Models
  • Logic Adapters
  • Storage Adapters

This view

  • Original page
  • New address

GeezerVison is showing docs.chatterbot.us — About ChatterBot — ChatterBot 1.2.15 documentation

ChatterBot Banner

About ChatterBot¶

ChatterBot is a Python library that makes it easy to generate automated responses to a user’s input. ChatterBot uses a selection of machine learning algorithms to produce different types of responses. This makes it easy for developers to create chat bots and automate conversations with users.

Modern AI Capabilities (2025):

  • Semantic Vector Search: Advanced context understanding using vector embeddings and Redis vector database

  • Large Language Model (LLM) Integration: Experimental support for Ollama and OpenAI models

  • Storage-Aware Architecture: Automatic optimization based on storage backend capabilities

  • Multi-Language Support: Language-independent design with spaCy integration

For more details about the ideas and concepts behind ChatterBot see the process flow diagram.

An example of typical input would be something like this:

user: Good morning! How are you doing?
bot:  I am doing very well, thank you for asking.
user: You're welcome.
bot:  Do you like hats?

Originally, ChatterBot was created as a part of the codebase for the humanoid robot Salvius. As the project grew, the chatterbot library was released as a separate open-source project.

Language Independence¶

The language independent design of ChatterBot allows it to be trained to speak any language. Additionally, the machine-learning nature of ChatterBot allows an agent instance to improve it’s own knowledge of possible responses as it interacts with humans and other sources of informative data.

Note

Starting in version 1.2.0 ChatterBot has started to implement some features that are language specific. This change is being made to improve the quality of responses that ChatterBot can generate.

How ChatterBot Works¶

ChatterBot is a Python library designed to make it easy to create software that can engage in conversation.

An untrained instance of ChatterBot starts off with no knowledge of how to communicate. Each time a user enters a statement, the library saves the text that they entered and the text that the statement was in response to. As ChatterBot receives more input the number of responses that it can reply to, and the accuracy of each response in relation to the input statement increases.

The program selects the closest matching response by searching for the closest matching known statement that matches the input, it then chooses a response from the selection of known responses to that statement.

April 2025

The dialog processing flow will be slightly different when using large language models (LLMs). See the LLM Roadmap for more details.

Process flow diagram¶

ChatterBot process flow diagram

Contents:¶

  • About
  • Installation
    • Installing from PyPi
    • Optional dependencies
    • Installing from GitHub
    • Installing from source
      • Checking the version of ChatterBot that you have installed
      • Upgrading ChatterBot to the latest version
        • Upgrading to Newer Releases
  • Quick Start Guide
    • Create a new chat bot
    • Training your ChatBot
    • Get a response
  • ChatterBot Tutorial
    • Getting help
    • Installing ChatterBot
    • Creating your first chat bot
      • Setting the storage adapter
      • Specifying logic adapters
      • Getting a response from your chat bot
      • Training your chat bot
      • Conclusion and Next Steps
  • Examples
    • Simple Example
    • Terminal Example
    • Using MongoDB
    • Time and Mathematics Example
    • Using SQL Adapter
    • Read only mode
    • Using Large Language Models
    • Django and Flask
  • Training
    • Training classes
      • Training via list data
        • ListTrainer
      • Training with corpus data
        • ChatterBotCorpusTrainer
        • Specifying corpus scope
      • Training with CSV or TSV formatted data
        • CsvFileTrainer
      • Training with JSON formatted data
        • JsonFileTrainer
      • Training with the Ubuntu dialog corpus
        • UbuntuCorpusTrainer
    • Creating a new training class
  • Preprocessors
    • Preprocessor functions
      • clean_whitespace()
      • unescape_html()
      • convert_to_ascii()
    • Creating new preprocessors
  • Security
    • Overview
    • Additional Resources
  • Large Language Models
    • LLM Roadmap
      • Basic LLM Configuration
      • LLM with Tool Support
      • Hybrid Configuration
    • Ollama Support
    • Using the OpenAI client
  • Logic Adapters
    • How logic adapters select a response
      • Response selection methods
        • get_first_response()
        • get_most_frequent_response()
        • get_random_response()
        • Use your own response selection method
      • Setting the response selection method
      • Response selection in logic adapters
      • Selecting a response from multiple logic adapters
        • Response selection
    • Creating a new logic adapter
      • Example logic adapter
      • Directory structure
      • Responding to specific input
      • Interacting with services
      • Providing extra arguments
    • Common logic adapter attributes
      • LogicAdapter
        • LogicAdapter.can_process()
        • LogicAdapter.class_name
        • LogicAdapter.get_default_response()
        • LogicAdapter.process()
    • Best Match Adapter
      • BestMatch()
      • How it works
      • Setting parameters
    • Time Logic Adapter
      • TimeLogicAdapter()
    • Mathematical Evaluation Adapter
      • MathematicalEvaluation()
    • Specific Response Adapter
      • SpecificResponseAdapter()
      • Specific response example
      • Low confidence response example
  • Storage Adapters
    • Built-in Storage Adapters
      • Redis Vector Storage Adapter
        • Redis Setup
        • Redis Configuration
        • Semantic Search vs. Traditional Text Search
        • Class Attributes
        • Performance Considerations
        • Embedding Model Configuration
        • More on Vector Databases & Semantic Search
      • MongoDB Storage Adapter
        • Using MongoDB with SSL/TLS
        • MongoDB Adapter Class Attributes
      • SQL Storage Adapter
        • SQLStorageAdapter
      • Django Integration
        • Install packages
        • Django App Development
        • General Django Tutorials
    • Choosing a Storage Adapter
    • Common storage adapter attributes
      • StorageAdapter
        • StorageAdapter.AdapterMethodNotImplementedError
        • StorageAdapter.EmptyDatabaseException
        • StorageAdapter.close()
        • StorageAdapter.count()
        • StorageAdapter.create()
        • StorageAdapter.create_many()
        • StorageAdapter.drop()
        • StorageAdapter.filter()
        • StorageAdapter.get_model()
        • StorageAdapter.get_object()
        • StorageAdapter.get_preferred_search_algorithm()
        • StorageAdapter.get_preferred_tagger()
        • StorageAdapter.get_random()
        • StorageAdapter.remove()
        • StorageAdapter.update()
    • Database Migrations
    • Further Reading
      • Text Search
        • Text Search Example
        • Bigram Text Index
      • Creating a new storage adapter
  • Filters
    • Setting filters
      • get_recent_repeated_responses()
  • ChatterBot
    • ChatBot
      • ChatBot.ChatBotException
      • ChatBot.generate_response()
      • ChatBot.get_latest_response()
      • ChatBot.get_response()
      • ChatBot.learn_response()
    • Example chat bot parameters
    • Example expanded chat bot parameters
    • Enable logging
    • Using a custom logger
    • Adapters
      • Adapters types
      • Accessing the ChatBot instance
  • Conversations
    • Conversation scope
    • Conversation example
      • Statements
        • Statement
      • Statement-response relationship
  • Comparisons
    • Statement comparison
      • Comparator
        • Comparator.compare()
        • Comparator.compare_text()
      • JaccardSimilarity
        • JaccardSimilarity.compare_text()
      • LevenshteinDistance
        • LevenshteinDistance.compare_text()
      • SpacySimilarity
        • SpacySimilarity.compare_text()
      • Use your own comparison function
        • Setting the comparison method
    • Taggers
      • LowercaseTagger
        • LowercaseTagger.as_nlp_pipeline()
        • LowercaseTagger.get_text_index_string()
        • LowercaseTagger.needs_text_indexing()
      • NoOpTagger
        • NoOpTagger.as_nlp_pipeline()
        • NoOpTagger.get_text_index_string()
        • NoOpTagger.needs_text_indexing()
      • PosLemmaTagger
        • PosLemmaTagger.as_nlp_pipeline()
        • PosLemmaTagger.get_text_index_string()
        • PosLemmaTagger.needs_text_indexing()
    • Languages
      • ENG
      • FRE
      • GER
      • ITA
      • JPN
      • KOR
      • POR
      • RUS
      • SPA
      • SWE
      • TUR
      • ZHT
  • Utility Methods
    • Module imports
      • import_module()
    • Class initialization
      • initialize_class()
    • ChatBot response time
      • get_response_time()
    • Parsing datetime information
      • datetime_parsing()
  • ChatterBot Corpus
    • Corpus language availability
    • Exporting your chat bot’s database as a training corpus
  • Django Integration
    • Install packages
      • Installed Apps
      • Migrations
      • MongoDB and Django
    • Django App Development
      • ChatterBot Django Settings
        • Additional Django settings
        • Swappable Model Settings
        • Using a Secondary Database
      • Custom Statement Models
        • Why Use Custom Models?
        • Creating Custom Models
        • Required Fields and Methods
        • Alternative: Per-Instance Configuration
        • Usage Examples
        • Migrating from Default Models
        • Best Practices
        • Troubleshooting
        • See Also
      • ChatterBot Django Sample Code
        • Example API Views
        • Example Django Management Commands
      • Webservices
        • Environments
        • WSGI
        • Serving static files
    • General Django Tutorials
      • Django Tutorials
        • Django
        • Django REST Framework
        • django-filter
  • Frequently Asked Questions
    • Python String Encoding
      • Does ChatterBot handle non-ascii characters?
      • How do I fix Python encoding errors?
        • Unicode header
        • Unicode escape characters
        • Import unicode literals from future
    • How do I deploy my chat bot to the web?
    • What kinds of machine learning does ChatterBot use?
      • 1. Search algorithms
      • 2. Classification algorithms
  • Command line tools
    • Get the installed ChatterBot version
    • List available commands
  • Development
    • Contributing to ChatterBot
      • Setting Up a Development Environment
      • Reporting a Bug
      • Requesting New Features
      • Contributing Documentation
      • Contributing Code
      • Development pattern for contributors
    • Releasing ChatterBot
      • Versioning
      • Release Process
    • Release Notes
    • Unit Testing
      • Running tests
      • Django integration tests
      • Benchmark tests
      • Testing documentation builds
    • Packaging your code for ChatterBot
      • Package directory structure
        • Register on PyPI
        • Generate packages
        • Upload packages
        • Install your package locally
        • Using your package
        • Testing your code
    • Suggested Development Tools
      • Text Editors
        • Visual Studio Code
      • Database Clients
        • SQLite Viewer
        • pgAdmin
  • Glossary

Report an Issue¶

Please direct all bug reports and feature requests to the project’s issue tracker on GitHub.

Indices and tables¶

  • Index

  • Module Index

  • Search Page

Sponsors¶

ChatterBot is sponsored by:

If you, or your organization is interested in sponsoring the ChatterBot project, you can do so directly via GitHub Sponsors as well as reach out directly via [email protected] for more information and to discuss sponsorship opportunities.

Stack Overflow
Ask a question under the
chatterbot tag
GitHub
Report an issue on
GitHub
Subscribe to updates via
@chatterbot.us on Bluesky
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.