Skip to content

A conversational CLI FAQ bot built with LangGraph and fuzzy matching. Answers common questions based on a JSON dataset.

Notifications You must be signed in to change notification settings

CodeSaadUmair/faq-bot-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝 FAQ Bot (CLI) with LangGraph & Fuzzy Matching

A simple command-line FAQ bot built using LangGraph and fuzzy matching. It allows users to interact with a predefined set of FAQs in a conversational manner. The bot uses fuzzy logic to match user input even with slight spelling variations or case mismatches.


🚀 Features

  • Conversational CLI interaction 🤖
  • Fuzzy matching of questions 🔍
  • Loads questions from an editable JSON file 📁
  • Custom bot name using environment variables 🔐
  • Lightweight, fast, and offline-capable 🏃‍♂️

🛠️ Tech Stack

  • Python
  • LangGraph
  • FuzzyWuzzy
  • python-dotenv
  • json

📁 FAQ Data Format

FAQs are stored in a separate JSON file (faq_data.json) like this:

[
  {
    "question": "What is LangGraph?",
    "answer": "LangGraph is a framework for building stateful AI agents using graphs."
  },
  {
    "question": "How do I run this bot?",
    "answer": "Just activate your virtual environment and run python faq_bot.py."
  }
]

🔐 Environment Setup

Store your database credentials in a .env file:

BOT_NAME=LangFAQBot

Important: The .env file is excluded via .gitignore to keep credentials secure.

📦 Installation

Clone this repository

git clone https://github.com/CodeSaadUmair/faq-bot-cli.git
cd faq-bot-cli

Create virtual environment

python -m venv envo
source envo/bin/activate  
or on Windows
python -m venv envo
envo\Scripts\activate 

Install dependencies

pip install -r requirements.txt

Run the app

python faq_bot.py

📌 Sample Questions

  • how do I update my profile information?
  • update my profil
  • do you ship internationally?
  • how can I reset my password?
  • reset my password

✅ To-Do / Future Improvements

  • Add persistent logging of user queries 📜
  • Integrate OpenAI for fallback answers 🤯
  • Add a web UI using Flask or Streamlit 🌐
  • FAQ categories or topic filters 🗂️

About

A conversational CLI FAQ bot built with LangGraph and fuzzy matching. Answers common questions based on a JSON dataset.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy