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.3.tar.gz (30.7 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.3-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dynamic_learning_model-4.0.3.tar.gz
  • Upload date:
  • Size: 30.7 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.3.tar.gz
Algorithm Hash digest
SHA256 5cad93bde08ff24462efc505c40cbad59c539a49666f9bc9085d16fc1446c6f8
MD5 b3ab2d95fa7f0b26fa5ff22bfef17ae1
BLAKE2b-256 6a2b66b6f061a9f96c53a1a1338b00fa4ebf038878958b0a4169201d4809186c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dynamic_learning_model-4.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2bec8b8f98017ffb36d8f4683c73aca3852be0dd18559e9c63c41dc73c5fa246
MD5 31f002c0e279c76328fa5cf052d0b4a3
BLAKE2b-256 1462ade21b90bba22eeca62fadced1a29d4422355737eda2a7a86ebb95c0aa18

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