Core ChatBot
Use this sub-skill when a task asks how to instantiate a ChatterBot bot, call get_response, control conversation IDs, understand Statement fields, debug default response behavior, use preprocessors/taggers/search, or run the small python -m chatterbot CLI.
Quick route
- For installation or spaCy model errors, read the root installation notes and cross-cutting troubleshooting.
- For constructor and method signatures, read references/api-reference.md.
- For basic response lifecycle examples, conversation IDs,
read_only, preprocessors, and taggers, read references/workflows.md.
- For missing input, missing language models, repeated responses, bad adapter configs, and confidence surprises, read references/troubleshooting.md.
- Run or adapt scripts/core_chat_smoke.py for a deterministic in-memory ChatBot smoke test.
Core objects
The central object is:
from chatterbot import ChatBot
bot = ChatBot("Example Bot", database_uri=None)
response = bot.get_response("Hello")
get_response accepts a string, a Statement, a dict containing text, or text= as a keyword. It returns a Statement with a text value and a confidence assigned by the selected logic adapter.
Use database_uri=None for in-memory SQL smoke tests and read_only=True when a bot should not learn from user input during inference.
Important behavior
- A
ChatBot has one storage adapter and a list of logic adapters.
- The default storage adapter is
chatterbot.storage.SQLStorageAdapter.
- The default logic adapter list is
['chatterbot.logic.BestMatch'].
ChatBot creates a default conversation ID so repeated calls can track prior responses unless a caller passes conversation=.
- If
read_only is false, get_response saves both the input statement and learned response relationship.
Statement carries text, search fields, conversation label, persona, tags, in_response_to, timestamps, and confidence.
- Default SQL matching uses
PosLemmaTagger, which normally needs a spaCy model such as en_core_web_sm.
CLI
ChatterBot exposes only simple module CLI checks:
python -m chatterbot --version
python -m chatterbot --help
Use these for package identity, not for training or serving.
Boundaries
1---2name: core-chatbot3description: "Use ChatterBot core ChatBot, Statement, preprocessing, tagging,4 search, comparison, response selection, and CLI/version workflows."5disable-model-invocation: true6metadata:7 source: https://skillmd.com/skills/vectorspacelab/core-chatbot8 disco-role: operating9license: BSD 3-Clause10---1112# Core ChatBot1314Use this sub-skill when a task asks how to instantiate a ChatterBot bot, call `get_response`, control conversation IDs, understand `Statement` fields, debug default response behavior, use preprocessors/taggers/search, or run the small `python -m chatterbot` CLI.1516## Quick route17181. For installation or spaCy model errors, read the root [installation notes](../../references/installation-and-extras.md) and [cross-cutting troubleshooting](../../references/troubleshooting.md).192. For constructor and method signatures, read [references/api-reference.md](references/api-reference.md).203. For basic response lifecycle examples, conversation IDs, `read_only`, preprocessors, and taggers, read [references/workflows.md](references/workflows.md).214. For missing input, missing language models, repeated responses, bad adapter configs, and confidence surprises, read [references/troubleshooting.md](references/troubleshooting.md).225. Run or adapt [scripts/core_chat_smoke.py](scripts/core_chat_smoke.py) for a deterministic in-memory ChatBot smoke test.2324## Core objects2526The central object is:2728```python29from chatterbot import ChatBot30bot = ChatBot("Example Bot", database_uri=None)31response = bot.get_response("Hello")32```3334`get_response` accepts a string, a `Statement`, a dict containing `text`, or `text=` as a keyword. It returns a `Statement` with a `text` value and a `confidence` assigned by the selected logic adapter.3536Use `database_uri=None` for in-memory SQL smoke tests and `read_only=True` when a bot should not learn from user input during inference.3738## Important behavior3940- A `ChatBot` has one storage adapter and a list of logic adapters.41- The default storage adapter is `chatterbot.storage.SQLStorageAdapter`.42- The default logic adapter list is `['chatterbot.logic.BestMatch']`.43- `ChatBot` creates a default conversation ID so repeated calls can track prior responses unless a caller passes `conversation=`.44- If `read_only` is false, `get_response` saves both the input statement and learned response relationship.45- `Statement` carries text, search fields, conversation label, persona, tags, `in_response_to`, timestamps, and confidence.46- Default SQL matching uses `PosLemmaTagger`, which normally needs a spaCy model such as `en_core_web_sm`.4748## CLI4950ChatterBot exposes only simple module CLI checks:5152```bash53python -m chatterbot --version54python -m chatterbot --help55```5657Use these for package identity, not for training or serving.5859## Boundaries6061- For trainers and data formats, route to [training](../training/SKILL.md).62- For built-in/custom logic adapter configuration, route to [logic-adapters](../logic-adapters/SKILL.md).63- For SQL/Mongo/Redis storage details, route to [storage-adapters](../storage-adapters/SKILL.md).64- For Django projects, route to [django-integration](../django-integration/SKILL.md).