This AI-Powered Chatbot project is designed to provide users with intelligent, real-time responses to queries. It features natural language processing (NLP) capabilities, conversation history storage, and integrations with external APIs for weather, news, and more.
-
Natural Language Processing (NLP):
- Uses SpaCy for processing user input.
- Pre-trained TensorFlow/Keras models for generating intelligent responses.
-
Conversation History:
- Stores user-bot interactions in an SQLite database.
- Easily retrievable for future reference or analysis.
-
External API Integration:
- Examples include weather and news retrieval using external APIs.
-
Lightweight and Scalable:
- Built on Flask, making it easy to deploy and scale.
- Programming Language: Python
- Framework: Flask
- Database: SQLite
- NLP Libraries: SpaCy, TensorFlow/Keras
- APIs: Placeholder for weather and news APIs
- Python 3.8+
- Pip (Python package manager)
-
Clone the repository:
git clone https://github.com/stephenombuya/-AI-Powered-Chatbot cd ai-powered-chatbot
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Initialize the SQLite database:
python >>> from app import init_db >>> init_db() >>> exit()
-
Run the application:
python app.py
-
Access the chatbot at
http://127.0.0.1:5000
.
-
Chat Endpoint
- URL:
/chat
- Method:
POST
- Payload Example:
{ "message": "Hello, chatbot!" }
- Response Example:
{ "response": "I'm here to help!" }
- URL:
-
History Endpoint
- URL:
/history
- Method:
GET
- Response Example:
[ { "user_message": "Hello", "bot_response": "Hi there!", "timestamp": "2025-01-08 12:30:45" } ]
- URL:
-
External API Endpoint
- URL:
/api
- Method:
GET
- Query Parameters:
type
:weather
ornews
- Response Example:
{ "weather": "Sunny, 25°C" }
- URL:
app.py
: Main application logicchat_history.db
: SQLite database for storing conversation historyrequirements.txt
: Dependencies for the projectREADME.md
: Project documentationchatbot_model.h5
: Pre-trained model (assumed to be in the root directory)
- Enhance NLP capabilities with advanced models (e.g., GPT, BERT).
- Add more external API integrations (e.g., stock market, sports updates).
- Implement a frontend interface for better user interaction.
- Improve database management and add analytics.
- Fork the repository and create your branch:
git checkout -b feature-name
- Commit your changes and push them:
git commit -m "Add feature-name" git push origin feature-name
- Submit a pull request for review.
This project is licensed under the Apache 2.0 License. See the LICENSE
file for details.
For questions or support, contact Stephen Ombuya.