Skip to content

Palks-Studio/flask_chatbot_advanced_2.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

125 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Chatbot conversation interface β€” example of a local Flask chatbot in use

πŸ‡¬πŸ‡§ English | πŸ‡«πŸ‡· FranΓ§ais

License OpenAI Optional Flask Offline First Flask Chatbot

Advanced Flask Chatbot β€” Version 2.0

This repository is a technical presentation and documentation repository.
It does not contain downloadable source code or production files.

A complete project to build your own Flask-based conversational assistant, ready to run:

  • locally (localhost)
  • on shared hosting such as o2switch (Passenger / cPanel)

No external database, no hidden dependencies. You can use it as-is, modify it, or integrate it into another website or API.

Flask Chatbot


Overview

This project provides a self-hosted conversational assistant built with Flask,
designed for developers and teams who want full control over their chatbot’s behavior and deployment.

The architecture prioritizes:

  • a local knowledge base (JSON) as the primary source
  • predictable behavior in professional environments
  • optional AI integration (OpenAI)
  • simple deployment without dependency on external SaaS platforms

Project Structure

flask_chatbot_advanced_2.0/
β”‚
β”œβ”€β”€ core/                     β†’ Chatbot logic and processing
β”œβ”€β”€ interface/                β†’ Frontend (chat UI and widget)
β”œβ”€β”€ storage/                  β†’ Optional persistence layer
β”œβ”€β”€ config/                   β†’ Environment and dependencies
β”œβ”€β”€ deployment/               β†’ Hosting and container setup
β”œβ”€β”€ data/                     β†’ Example knowledge base
β”œβ”€β”€ logs/                     β†’ Error tracking system
β”‚
└── docs/
    β”œβ”€β”€ README_TECHNIQUE.md   β†’ Technical documentation and internal architecture
    β”œβ”€β”€ README.md             β†’ Main project documentation and guides
    β”œβ”€β”€ CUSTOMISATION.md      β†’ Bot customization (design, responses, OpenAI…)
    └── INSTALL.md            β†’ Complete user guide

Key Features

  • Compatible with o2switch / Passenger (shared hosting)
  • No database required (JSON-based operation)
  • Readable, well-commented and easily customizable code
  • CORS enabled: usable with websites or frontend interfaces
  • Integrated logging system: errors automatically recorded in /logs/

Typical Use Cases

This chatbot is designed for:

  • internal knowledge assistants
  • support or documentation automation
  • self-hosted AI assistants
  • internal tools requiring controlled responses
  • websites embedding a chatbot widget

The system can operate fully offline using a local knowledge base,
or optionally use OpenAI when extended responses are required.


Automatically Generated Files

When the chatbot is launched for the first time, some files are created automatically:

File Purpose
Persistence file May be generated to store conversations if persistence is enabled
logs/errors.log Created only when a server error occurs
Environment file Must be created from the provided template to enable optional features

Operating Modes

Mode Description Requires OpenAI Key
Local JSON (default) Responses generated from the local knowledge base No
OpenAI GPT (optional) Uses OpenAI API when a key is provided Yes

The mode is automatically selected based on the presence of an API configuration in the environment.
No tokens are consumed if no key is provided.


Error Logs

The logs/ directory automatically records Flask server errors:

  • automatic creation of log files when an error occurs
  • automatic creation of the logs/ directory if missing
  • recording of date, error message and full traceback

This system works:

  • in local mode
  • with or without OpenAI
  • in production (Passenger / shared hosting)

Palks Studio β€” Version 2.0 (Advanced Edition)
Compatible with Python 3.12+ and Flask 3.0+

Β© Palks Studio β€” see LICENSE.md

About

πŸ‡¬πŸ‡§ Production-ready Flask chatbot template β€” offline-first, optional OpenAI, clean API & UI πŸ‡«πŸ‡· Template Flask prΓͺt Γ  l’emploi β€” fonctionnement hors ligne, OpenAI optionnel, API et interface propres.

Topics

Resources

License

Stars

Watchers

Forks

Contributors