How shonegk/chatterpy works
ChatterBot is a conversational engine that learns from stored conversation pairs and returns likely replies. The documented workflow accepts a user statement, searches known statements for a close match, selects a response, and saves the exchange for future learning; corpus trainers can seed that knowledge. Its logic adapters also provide specialized responses such as math, time, and unit conversion, while pluggable storage includes SQL, MongoDB, and Django backends. The map follows documented and excerpted relationships; unsampled modules are represented only where the tree and README establish their role.
Main entry points: storage_adapter.py Storage Interface · chatterbot.py ChatBot · search.py Text Search · logic_adapter.py Logic Adapter
Components 18
Conversation Runtime
- ChatBot
chatterbot/chatterbot.py - Statement Model
chatterbot/conversation.py - Text Search
chatterbot/search.py
Response Logic
- Logic Adapter
chatterbot/logic/logic_adapter.py - Best Match
chatterbot/logic/best_match.py - Specialized Logic
chatterbot/logic - Response Selection
chatterbot/response_selection.py
Training and Language
- Corpus Loader
chatterbot/corpus.py - Corpus Trainers
chatterbot/trainers.py - Statement Tagger
chatterbot/tagging.py - Language Registry
chatterbot/languages.py
Storage Backends
- Storage Interface
chatterbot/storage/storage_adapter.py - SQL Storage
chatterbot/storage/sql_storage.py - MongoDB Storage
chatterbot/storage/mongodb.py - Django Storage
chatterbot/storage/django_storage.py
Framework Integrations
- SQL Models
chatterbot/ext/sqlalchemy_app/models.py - Django Models
chatterbot/ext/django_chatterbot/abstract_models.py
Other components
- User
Connections 22
- User → ChatBot: submits statement
README.md - ChatBot → Statement Model: creates
chatterbot/chatterbot.py - ChatBot → Logic Adapter: dispatches to
chatterbot/chatterbot.py - ChatBot → Storage Interface: persists through
chatterbot/chatterbot.py - ChatBot → Text Search: configures
chatterbot/chatterbot.py - Logic Adapter → Text Search: searches with
chatterbot/logic/logic_adapter.py - Logic Adapter → Response Selection: selects response
chatterbot/logic/logic_adapter.py - Best Match → Logic Adapter: extends
chatterbot/logic/best_match.py - ChatBot → Best Match: defaults to
chatterbot/chatterbot.py - ChatBot → Specialized Logic: supports
chatterbot/logic/__init__.py - Text Search → Storage Interface: filters statements
chatterbot/search.py - Text Search → Statement Model: compares
chatterbot/search.py - Corpus Trainers → Corpus Loader: loads data
chatterbot/trainers.py - Corpus Trainers → Storage Interface: adds statements
- Corpus Trainers → Statement Tagger: uses tags
chatterbot/trainers.py - Storage Interface → Statement Tagger: initializes
chatterbot/storage/storage_adapter.py - Storage Interface → Language Registry: uses language
chatterbot/storage/storage_adapter.py - SQL Storage → Storage Interface: implements
chatterbot/storage/sql_storage.py - MongoDB Storage → Storage Interface: implements
chatterbot/storage/mongodb.py - Django Storage → Storage Interface: implements
chatterbot/storage/django_storage.py - SQL Storage → SQL Models: creates tables
chatterbot/storage/sql_storage.py - Django Storage → Django Models: loads models