Skip to content

Releases: athem135-source/PCBot

v4.0.2 - Truncation / Currency fix

Choose a tag to compare

@athem135-source athem135-source released this 05 Aug 13:47

RELEASE NOTES — v4.0.2

Summary

This patch fixes a truncation/regression introduced in the v4.x line where answers could be cut off mid-currency (e.g., "Rs. 10,000" became "Rs.") and restores the stricter answer length target that was used previously.

What changed

  • Restored the stricter length cutoff for generated answers (45–70 words target; truncation cutoff set to 70 words).
  • Added logic to detect currency markers (e.g., "Rs.", "₹", "PKR", "Rupees") and append subsequent token(s) when truncation would split a currency+number pair so numeric amounts are not lost.
  • Preserved the prior behavior of preferring sentence-boundary truncation and ensuring proper sentence termination.
  • Added unit-safe protections to avoid over-appending (limits appended words to 5 and only until a numeric token is included).

Why this fixes the problem

Users reported repeated cases where currency mentions were truncated, causing misleading and incomplete answers. Restoring the original length policy while protecting currency/number token pairs preserves concise answers while preventing the bad cutoff.

Testing notes

  • Manual tests: queries that end with currency mentions such as "What is the limit?" with answers like "The fee is Rs. 10,000 per application" should now return the full amount.
  • Smoke test: run the Flask backend and issue a /chat request with a prompt designed to elicit a currency-ended sentence; verify the returned answer is not truncated.

Deployment

This release is a small backend-only fix. Deploy by updating the server with the latest code and restarting the API process (or redeploy container if used).

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

PCBot v4.0.1

Choose a tag to compare

@athem135-source athem135-source released this 04 Aug 08:33

PCBot v4.0.1 - Release Notes

Release date: 2026-08-04

Highlights

  • Added setup_docker_engine.bat for Windows Server environments using Docker Engine.
  • Kept the native setup.bat path separate for non-Docker installs.
  • Clarified support policy in README and SECURITY docs.
  • Marked v3.x and earlier as unsupported.

Setup details

  • Qdrant is now supported via Docker Engine on Windows Server.
  • Ollama can optionally run in Docker, but host-based Ollama remains supported.
  • The server setup is intended for clean installs on new PCs/servers.

Notes

  • This release does not re-index or re-chunk data by itself.
  • Vector indexing and chunking still happen in the backend when it initializes against an empty Qdrant store.
  • Existing Qdrant data persists unless you remove the Docker volume.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

PCBot v4.0.0

Choose a tag to compare

@athem135-source athem135-source released this 30 Jul 00:37

PCBot v4.0.0 — Release Notes

Release date: 2026-07-30

Overview

This release (4.0.0) collects a set of bug fixes, stability hardenings, and small feature updates that were necessary after model and dependency changes following the 3.x line. The focus was on making the Windows launcher and standalone widget reliable, improving tunnel detection, fixing backend crashes, hardening service startup (Qdrant/Ollama), and consolidating admin and feedback UX.

Key fixes & changes

  • Launcher & startup

    • Fixed Windows batch quoting/encoding issues that caused "... was unexpected at this time." Errors caused by stray non-ASCII characters, stray CRs, and fragile parenthesized IF blocks were removed.
    • Reworked the standalone launcher (run_widget_standalone.bat) to:
      • Wait for backend /health before opening a tunnel or browser (prevents Cloudflare routing to an unavailable backend).
      • Start cloudflared in an isolated PowerShell window and use robust UTF-8/UTF-16-safe detection for the trycloudflare quick-tunnel URL (replaces fragile FINDSTR logic).
      • Capture tunnel output in a safe temporary file and fall back to local host if the URL is not detected.
    • Added SHOW_CONSOLE mode to backend runner so developers can run the backend visibly for live logs.
  • Backend (Flask)

    • Removed duplicate route registration that could cause the Flask app to crash on startup (AssertionError: view function mapping overwriting existing endpoint).
    • Added /feedback/submit endpoint and file-based feedback/feedback.jsonl storage (JSON Lines) for simple audit and admin review.
    • Added more robust /admin/status and /admin/statistics payloads to support multiple UI shapes (backwards-compatible changes).
    • Hardened health checks and added additional error messages to make troubleshooting easier when Qdrant or Ollama are unavailable.
  • Qdrant & Ollama

    • Improved Qdrant auto-start logic on Windows: attempts local binary, then docker run fallback for container name pcbot-qdrant (requires Docker installed and sufficient permissions).
    • Clearer error messages when Qdrant is unreachable (WinError 10061) and guidance in README for starting container manually.
    • Dashboard now reads qdrant_status, ollama_status, model_loaded, and embedding_ready from multiple response shapes.
  • Cloudflare / Tunnel

    • Replaced FINDSTR-based Unicode parsing with PowerShell Get-Content -Raw (handles BOM/Unicode formats).
    • cloudflared is still used in quick-tunnel (trycloudflare) mode by default — these tunnels are ephemeral and account-less. For production stability, create a named tunnel with a Cloudflare account and origin cert.
  • Admin UI & UX

    • Consolidated admin tools into a single Admin Console entry and unified Admin Dashboard showing Version, Sessions, Qdrant, Ollama, Model, Embedding, and Feedback counts.
    • Feedback button matches option-card styling and is displayed in User mode only (admin controls hidden), per the requested UX.
    • Centered and enlarged widget and mobile cards on the landing page (non-mobile) and enlarged chat icon per request.
  • Misc & documentation

    • Added RELEASE_NOTES_4.0.0.md to the repo with these details.
    • Updated README.md with v4.0.0 notes and guidance for tunnel usage and Qdrant Docker start instructions.
    • Added security recommendations and persistence notes (feedback and sessions currently file-based; consider SQLite for persistence and easier admin queries).

Known limitations & recommendations

  • Qdrant docker auto-start requires Docker CLI on PATH and appropriate permissions. If Docker is not usable, start Qdrant manually:
    docker run -d --name pcbot-qdrant -p 6338:6338 qdrant/qdrant

  • cloudflared quick tunnels (trycloudflare) are ephemeral. For production, create a named Cloudflare Tunnel with an origin cert. See: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps

  • Feedback and sessions are stored in JSONL or in-memory respectively. For production auditing, migrate to SQLite or another persistent store and add admin viewer + CSV export.

  • Model loading: local Ollama model auto-warmup remains required. If large model changes occur (Mistral/LLaMA updates), you may need to re-download or reconfigure model paths.

Contact & support

Given on my account :)

PCBot v3.4.0 - Platform Modernization & Deployment Excellence

Choose a tag to compare

@athem135-source athem135-source released this 08 Jan 14:46

PCBot v3.4.0 - Major Release 🚀

Platform Modernization & Deployment Excellence

This major release transforms PCBot into a production-ready, multi-platform application with professional deployment options, automated setup, and enhanced user experience.


🎯 Major Features

🎨 Enhanced User Interface

Mode Selector Landing Page

  • User Mode: Clean interface showing only public features
    • Shareable Widget Interface
    • Mobile Site Access
  • Admin Mode: Password-protected administrative tools
    • Statistics Dashboard
    • 300-Question Calibration Test
    • Development Widget
    • Admin Panel Access
  • Server-Side Authentication: Password validation via /admin/authenticate API
  • Session Management: Secure Flask sessions with no client-side password exposure
  • Visual Indicators: Mode badge and easy mode switching

Animated Widget Interface

  • Smooth Animations:
    • slideUp (0.3s) - Widget container opening
    • fadeIn (0.3s) - Message appearance
    • bounce (1.4s) - Typing indicator dots
    • buttonPulse - Chat button effects
    • scaleIn - Modal transitions
  • Backend Health Check: Automatic server availability verification with retry overlay
  • Enhanced UX: Improved loading states and error handling

🚀 Multi-Platform Deployment

GitHub Pages Integration ✨ NEW

  • Auto-Deployment: GitHub Actions workflow for automatic builds
  • Live Site: https://athem135-source.github.io/PCBot/
  • Features:
    • Deploys on every push to main
    • Free HTTPS and custom domain support
    • Global CDN distribution
    • DDoS protection
  • Documentation: Complete setup guide in deployment/GITHUB_PAGES.md

Netlify Deployment 📦

  • Pre-Configured: Ready-to-deploy with netlify.toml
  • Deployment Options:
    • GitHub integration (auto-deploy)
    • Netlify CLI
    • Drag-and-drop deployment
  • Features:
    • Security headers (CSP, X-Frame-Options, HSTS)
    • Asset caching (1-year immutable)
    • SPA redirects
    • Form handling ready
  • Documentation: Full guide in deployment/NETLIFY.md

Cloudflare Tunnel Enhancements 🌐

  • Warning System: 5-tip user guide for tunnel connection issues
  • Auto-Retry Instructions: Clear guidance when tunnel fails
  • Quick Recovery: Copy-paste URL reminder
  • Alternative Options: ngrok and cloud deployment suggestions

🔧 Installation & Setup Automation

Virtual Environment Auto-Setup

  • One-Command Installation: setup.bat handles everything
  • Automated Process (8 steps):
    1. ✅ Verify Python 3.10+ installation
    2. ✅ Create virtual environment (.venv)
    3. ✅ Install all Python packages in venv
    4. ✅ Check/install Node.js
    5. ✅ Install React dependencies
    6. ✅ Download and configure Qdrant
    7. ✅ Download Ollama and Mistral-7B model
    8. ✅ Run 30-second warmup (downloads embedding models)

Enhanced Launchers

  • run_widget_standalone.bat:
    • [1/5] Check and start Qdrant service
    • [2/5] Check and start Ollama service
    • [3/5] Activate virtual environment
    • [4/5] Start Flask backend (8-second model warmup)
    • [5/5] Open browser + Create Cloudflare tunnel
  • Root-Level Access: Key files visible in project root for easy discovery
  • Automatic Service Management: No manual service startup needed

Bug Fixes

  • Embedding Model Error: Fixed "pip install sentence-transformers" error
    • Root cause: Packages installed globally but not in venv
    • Solution: Auto-created .venv with all dependencies
    • Result: Zero manual configuration required

📁 Professional Folder Structure

PCBot/
├── public/                    # Static frontend files
│   ├── html/                  # All HTML interfaces
│   │   ├── landing.html       # Mode selector page
│   │   ├── widget-standalone.html
│   │   ├── widget-dev.html
│   │   └── mobile.html
│   └── assets/                # Images, CSS, JS
│       ├── uraan-pak.png
│       ├── 5Vs.png
│       └── favicon.ico
│
├── scripts/setup/             # Installation scripts
│   ├── setup.bat              # Complete environment setup
│   └── run_widget_standalone.bat
│
├── deployment/                # Deployment documentation
│   ├── GITHUB_PAGES.md        # GitHub Pages guide
│   └── NETLIFY.md             # Netlify deployment guide
│
├── src/                       # Python backend
│   ├── app.py                 # Streamlit app
│   ├── rag_langchain.py       # RAG pipeline
│   └── widget_api.py          # Flask REST API
│
├── frontend-widget/           # React widget source
│   ├── src/
│   ├── dist/                  # Built widget
│   └── package.json
│
├── .github/workflows/         # CI/CD pipelines
│   └── deploy-pages.yml       # GitHub Pages deployment
│
├── setup.bat                  # Root-level setup (copy)
├── run_widget_standalone.bat  # Root-level launcher (copy)
├── QUICKSTART.md              # Quick start guide
└── README.md                  # Updated documentation

Benefits:

  • Clear separation of concerns
  • Easy navigation for developers
  • Deployment-ready structure
  • Professional organization

🛡️ Security Enhancements

Authentication & Access Control

  • Server-Side Validation: Admin password verified via Flask backend
  • Session Management: Secure session cookies with httpOnly flag
  • Mode Separation: Different capabilities for User vs Admin modes
  • No Client Secrets: Zero passwords or API keys in JavaScript

Network Security

  • HTTPS Everywhere:
    • GitHub Pages: Built-in HTTPS
    • Netlify: Automatic SSL
    • Cloudflare: Encrypted tunnels
  • CORS Configuration: Whitelist-based origin control
  • Security Headers: CSP, X-Frame-Options, HSTS (Netlify)
  • Input Validation: Enhanced API input sanitization

Deployment Security

Platform Security Features
GitHub Pages HTTPS, DDoS protection, GitHub infrastructure
Netlify CSP headers, X-Frame-Options, HSTS, automatic SSL
Cloudflare Encrypted tunnels, temporary URLs, DDoS mitigation
Local Virtual environment isolation, no external exposure

📚 Documentation Improvements

New Guides

  • QUICKSTART.md:

    • First-time setup (15-20 minutes)
    • Daily use (30 seconds)
    • File organization overview
    • Troubleshooting section
  • GITHUB_PAGES.md:

    • 3-step deployment process
    • Backend hosting options (Railway, Render, Office Server)
    • CORS configuration guide
    • Custom domain setup
    • Comparison: GitHub Pages vs Netlify
  • NETLIFY.md:

    • GitHub integration setup
    • CLI deployment commands
    • Drag-and-drop deployment
    • Backend deployment strategies
    • Security header configuration

Updated README

  • v3.4.0 feature highlights
  • New deployment options section
  • Updated system architecture
  • Enhanced security documentation
  • Revised quick start guide
  • Updated version history

🔄 Breaking Changes

File Locations

  • HTML Files: Moved from root to public/html/
  • Assets: Moved to public/assets/
  • Scripts: Organized in scripts/setup/

Migration Guide

No migration needed for end users. For developers:

  1. Update any hardcoded paths to use new folder structure
  2. Use root-level setup.bat instead of scripts/setup/setup.bat
  3. Update asset references to public/assets/

📊 Technical Specifications

Updated Stack

Component Technology Version/Config
Vector DB Qdrant 360+ chunks, auto-configured
Embeddings sentence-transformers all-MiniLM-L6-v2, auto-downloaded
Reranker Cross-Encoder ms-marco-MiniLM, 0.33 threshold
Primary LLM Ollama (Mistral 7B) Local, auto-warmup
Fallback LLM Groq API (LLaMA 3.1 70B) Cloud backup
Frontend React 18.2 TypeScript, Tailwind, animations
Backend Flask + Waitress WSGI, venv-isolated
Deployment Multi-platform GitHub Pages, Netlify, Cloudflare
Python Env Virtual Environment Auto-created .venv

Performance Metrics (Unchanged)

  • In-Scope Accuracy: 100% (300-question test)
  • Numeric Accuracy: 100% (40 financial questions)
  • Off-Scope Detection: 100% (40 off-topic questions)
  • Source Citation: 94.3% (283/300 responses)
  • Avg Response Time: 5.02s

🎬 Demo & Screenshots

Mode Selector Landing Page

Mode Selector

  • Choose User Mode for public access
  • Choose Admin Mode for administrative tools

Animated Widget

Widget Interface

  • Smooth animations and transitions
  • Real-time typing indicators
  • Backend health monitoring

🚀 Quick Start

First-Time Setup (15-20 minutes)

# Just double-click this file:
setup.bat

# Automated process:
# ✅ Creates virtual environment
# ✅ Installs all dependencies
# ✅ Downloads Ollama + Mistral model
# ✅ Configures Qdrant
# ✅ Downloads embedding models

Daily Use (30 seconds)

# Double-click to start:
run_widget_standalone.bat

# Starts everything automatically:
# [1/5] Qdrant service
# [2/5] Ollama service
# [3/5] Virtual environment
# [4/5] Flask backend
# [5/5] Browser + Cloudflare tunnel

Deploy to GitHub Pages (5 minutes)

# 1. Enable GitHub Pages in repository settings
#    Settings > Pages > Source: GitHub Actions

# 2. Push your code
git push origin main

# 3. Your site goes live at:
#    https://athem135-source.github.io/PCBot/

🐛 Bug Fixes

  • Fixed "Embedding model not available" error via venv isolation
  • Resolved widget-dev.html blank page issue
  • Fixed Cloudflare tunne...
Read more

PCBot v3.3.8 - Branding Update

Choose a tag to compare

@athem135-source athem135-source released this 15 Dec 07:22
ba73dde

What's New in v3.3.8

Branding & UI Enhancements

  • Added Uraan Pakistan and 5Es Framework logos to README
  • Enhanced widget development page with official logos
  • Improved mobile interface logo display (width-based sizing)
  • Optimized logo positioning and spacing

Technical Improvements

  • Enforced manual acronym definitions in system prompt (PAO = Principal Accounting Officer)
  • Fixed acronym expansion to use exact definitions from Manual's abbreviation list
  • Updated logo asset serving for development and production environments

Mobile Enhancements

  • Logos now use width-based sizing (180-200px) for better visibility
  • Optimized responsive layout for smaller screens (140-150px on mobile)

Government of Pakistan
Ministry of Planning, Development & Special Initiatives

PCBot v3.3.7 - Planning Commission Bot Rebrand

Choose a tag to compare

@athem135-source athem135-source released this 14 Dec 18:37

PCBot v3.3.7 - Planning Commission Bot Rebrand

What's Changed

  • Rebranded from PDBOT to PCBot (Planning Commission Bot)
  • Updated all user-facing elements:
    • Mobile interface title and header
    • Widget greeting and header
    • Bot self-identification in responses
    • System prompts for AI models
    • About dialog in settings menu
  • Added mobile tunnel script for external testing
  • Added 200-question comprehensive test suite
  • Minor bug fixes and improvements

Bot Identity

When asked, the bot now identifies as PCBot - the Planning Commission assistant for the Manual for Development Projects 2024.

Full Changelog

v3.3.6...v3.3.7

v3.3.6 - File Organization & Type Safety

Choose a tag to compare

@athem135-source athem135-source released this 11 Dec 06:26

File Organization & Type Safety

Changes

File Structure Improvements

  • Created \ ests/results/\ folder for JSON test result files
  • Created \ ests/reports/\ folder for Markdown report files
  • Moved all test artifacts to their proper locations
  • Batch files kept in root for easy access

Type Safety Fixes

  • Added proper type annotations to fix Pylance/Pyright warnings
  • Added \ yping\ module imports (\Dict, \List, \Any, \Optional, \Tuple)
  • Replaced \defaultdict\ with explicitly typed dictionaries
  • Fixed return type annotations

New Structure

\
tests/
results/ # JSON test result files
test_results_.json
reports/ # Markdown test reports
TEST_REPORT_
.md
comprehensive_300_test.py
generate_report.py
...other test files
\\

Files Modified

  • \ ests/comprehensive_300_test.py\ - Path updates + type hints
  • \ ests/generate_report.py\ - Path updates + type hints

  • un_calibration_test.bat\ - Updated output paths

v3.3.5 - 300-Question AI Calibration Test Suite

Choose a tag to compare

@athem135-source athem135-source released this 11 Dec 06:17

300-Question AI Calibration Test Suite

Overview

This release introduces a comprehensive automated testing framework with 300 carefully crafted questions across 9 categories to validate accuracy, response quality, and safety boundaries.

Test Results: 92.7% Pass Rate (278/300)

Category Passed Total Accuracy
In-Scope Detailed 50 50 100%
In-Scope Short 50 50 100%
Numeric/Financial 40 40 100%
Trap Questions 30 30 100%
Trick Questions 30 30 100%
Off-Scope 40 40 100%
Greetings 15 15 100%
Manual Sections 20 20 100%
Red-Line Safety 3 25 12%

New Files

  • \\ ests/comprehensive_300_test.py\\ - Full test suite
  • \\ ests/generate_report.py\\ - Markdown report generator
  • \
    un_calibration_test.bat\\ - One-click test execution (Windows)

Improvements

  • 15+ New Red-Line Patterns: Enhanced fraud/corruption detection
  • Full Q&A Transparency: All 300 questions documented in README
  • Collapsible Documentation: Easy navigation of test cases

Quick Start

\\�ash

Run the calibration test

run_calibration_test.bat
\\

Performance Metrics

  • Average Response Time: 5.02 seconds
  • Total Test Duration: ~25 minutes
  • API Endpoint: POST /chat with {query, session_id}

v3.3.4 - Full Chat Image Export & Enhanced Downloads

Choose a tag to compare

@athem135-source athem135-source released this 09 Dec 07:24

What's New in v3.3.4

Enhanced Export Options

  • Full Chat Image Export: Download entire conversation as PNG (captures complete chat history, not just visible area)
  • Styled HTML Export: Professional chat interface design with full styling
  • Text Export: Plain text format for easy sharing

Bug Fixes

  • Fixed image download to capture full scrollable content
  • Temporarily expands container before capture for complete screenshot
  • Added jsconfig.json to fix html2canvas TypeScript/linting warnings

Version Updates

  • All scripts and files updated to v3.3.4
  • README.md updated with new features
  • SECURITY.md version synced

Full Changelog: v3.3.3...v3.3.4

PDBOT v3.3.3 - Enhanced Download Options

Choose a tag to compare

@athem135-source athem135-source released this 09 Dec 06:58

PDBOT v3.3.3

Enhanced Download Options


New Download Features

Three ways to export your chat:

Format Extension Description
** Text** .txt Plain text, simple and lightweight
** HTML** .html Styled chat interface - looks like the widget!
** Image** .png Screenshot of entire chat as PNG

HTML Export

The HTML export now generates a beautiful styled page that mirrors the PDBOT widget design:

  • Gradient green header with logo
  • User messages in green bubbles (right-aligned)
  • Bot messages in white bubbles (left-aligned)
  • Timestamps on each message
  • Session metadata footer
  • Print-friendly CSS
  • Opens in any browser

Image Export

New feature: Download as Image (.png)

  • High quality (2x scale for crisp text)
  • Captures the entire chat conversation
  • Perfect for sharing or documentation
  • Uses html2canvas library

Technical Changes

  • Added \exportChatAsHTML()\ function with full CSS styling
  • Added \downloadAsImage()\ using html2canvas
  • Updated SettingsMenu with 3 download options
  • Added html2canvas as dependency

Quick Start

\\powershell
.\start_pdbot.bat
\\


PDBOT v3.3.3 | Government of Pakistan