Skip to main content

A Dynamic-Learning Model (DLM) chatbot with memory and compute reasoning modes.

Project description

Dynamic Learning Model

PyPI version Python Version License: MIT

Overview

The Dynamic Learning Model (DLM) is a hybrid, domain-specific AI system designed to learn, adapt, and respond intelligently to user queries. It combines natural language understanding with structured reasoning, continually improving as it is trained.

Key capabilities include:

  • FAQ Handling - Learns and responds to frequently asked questions based on the knowledge it has been trained on.
  • Chain-of-Thought (CoT) Reasoning - Performs clear, step-by-step logic to solve non-ambiguous arithmetic, geometric, and unit conversion problems.
  • Custom Knowledge Integration - DLM is fully extensible. You can initialize it with an empty SQL database and train it with your domain-specific knowledge.

Whether you're building a student support bot, a domain-specific assistant, or a computation system, DLM offers a flexible foundation to power your intelligent applications.

Table of Contents

Installation

pip install dynamic-learning-model

Requirements: Python 3.12.0 or higher is required to use this bot in your program. All required dependencies are installed automatically with the package.

Required Parameters

The constructor requires passing in two parameters:

  1. Bot Mode
    • "learn" - Enables training using the memory model. The bot can be updated with new information.
    • "apply" - The bot automatically switches between its "compute" and "memory" models depending on the query asked.
  2. Database Path - An empty (or existing) SQLite database file used for training and as the bot's memory model.

The ask() method also requires two parameters:

  1. Query - e.g., "What is the definition of FAFSA?"
  2. Display Thought - True to display the bot's Chain-of-Thought reasoning, or False to suppress it.

Usage

"learn" mode (training queries):

from dlm import DLM

training_bot = DLM("learn", "college_knowledge.db")
training_bot.ask("What is FAFSA in college?", True)

"apply" mode (deployment / production use after training):

from dlm import DLM

commercial_bot = DLM("apply", "college_knowledge.db")
commercial_bot.ask("What is the difference between FAFSA and CADAA in California?", False)

# or

commercial_bot.ask("Tell me the result for the following: 5 * 5 * 5 + 5 / 5", True)

High-Level Pipeline

DLM Pipeline

Important Notices

  1. Training data quality matters. DLM's accuracy in "learn" mode depends entirely on the consistency and clarity of the question/answer pairs it's trained with. Inconsistent category labeling or vague phrasing during training can produce inaccurate or corrupted responses later.
  2. Database files are local and untracked. DLM stores all trained knowledge in the SQLite file you provide. Back up this file regularly - there is no built-in cloud sync, versioning, or recovery mechanism.
  3. Model loading behavior. Underlying NLP and transformer models (spaCy, HuggingFace) are lazy-loaded and shared across instances. The first call in a session may take longer due to model loading; subsequent calls are significantly faster.
  4. Compute mode limitations. Chain-of-Thought computation is designed for clear, non-ambiguous arithmetic, geometric, and unit-conversion problems. Ambiguous or multi-interpretation queries may produce incorrect results - always verify outputs for critical use cases.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

Dynamic Learning Model (DLM) is provided "as-is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the author be liable for any claim, damages, or other liability arising from the use of this software.

DLM may produce inaccurate, incomplete, or unexpected responses, particularly for ambiguous queries or insufficiently trained knowledge bases. Do not rely on DLM's output for decisions involving safety, legal, medical, or financial consequences without independent verification.

All data provided to DLM (training queries, database contents) is processed and stored locally on the host machine. DLM does not transmit user data externally, except for any underlying third-party model downloads (e.g. HuggingFace, spaCy) required on first run, which are subject to those providers' own terms.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynamic_learning_model-4.0.5.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dynamic_learning_model-4.0.5-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

Details for the file dynamic_learning_model-4.0.5.tar.gz.

File metadata

  • Download URL: dynamic_learning_model-4.0.5.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for dynamic_learning_model-4.0.5.tar.gz
Algorithm Hash digest
SHA256 fcb139bf115d79b44b58f6614747926acf506450c35f5dc1d09c9c666feef201
MD5 08d4fafa69f934c5e9eb1a40ef8fba62
BLAKE2b-256 e96ab2682ba6f74aa564223e7b2d908bfd8544d5e93727bf5335d4036f590437

See more details on using hashes here.

File details

Details for the file dynamic_learning_model-4.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for dynamic_learning_model-4.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 15dce416dddd5a55b00b8dc86f682b32c9fb47565e83dcd30047a8ad283f3521
MD5 379fcf409e4bfefbbe4a841d7d98af8b
BLAKE2b-256 66a747d28328b511926aa3636b9847fefda0417e1124515826bfff9e3cf3c876

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page