AI CHATBOT ASSISTANT
Project Report 2024-25
SUBMITTED IN PARTIAL FULFILLMENT OF CLASS IX COMPUTER SCIENCE
AUTH: PRATIK & RITURAJ
AI
[Link]
MEMBER 1 MEMBER 2
Name: Pratik Raj Name: RituRaj
Class: IX B Class: IX B
Roll No: 13 Roll No: 17
1
Certificate
This is to certify that Pratik Raj (Roll No. 13) and RituRaj (Roll No. 17),
students of Class IX B, have successfully completed their project titled:
“AI CHATBOT ASSISTANT”
during the academic year 2024-2025 in partial fulfillment of the Com-
puter Science curriculum.
The project is a genuine work of their own efforts and has been com-
pleted under my supervision.
AUTH: PRATIK & RITURAJ
[Link]
Internal Examiner External Examiner
Principal
1
Acknowledgment
We would like to express our special thanks of gratitude to our Computer
Science teacher as well as our Principal, who gave us the golden oppor-
tunity to do this wonderful project on the topic AI Chatbot Assistant.
This project helped us in doing a lot of Research and we came to know
about so many new things about Python, Java, and Web Development.
We are really thankful to them.
Secondly, we would also like to thank our parents and friends who
helped us a lot in finishing this project within the limited time frame.
Special Thanks to IT Dept
The brutal honesty and rigorous code reviews from the IT Depart-
ment helped us fix critical bugs in the logic engine. Their guidance
AUTH: PRATIK & RITURAJ
on ”Modular Programming” was invaluable.
[Link]
2
Table of Contents
Acknowledgment 2
1 Introduction 4
1.1 Project Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 System Requirements 5
2.1 Hardware Requirements . . . . . . . . . . . . . . . . . . . . . 5
2.2 Software Requirements . . . . . . . . . . . . . . . . . . . . . . 5
3 System Design: Data Flow 6
4 Source Code 7
4.1 Module 1: Logic Engine (Python) . . . . . . . . . . . . . . . . . 7
AUTH: PRATIK & RITURAJ
4.2 Module 2: Data Logger (Java) . . . . . . . . . . . . . . . . . . . 8
[Link]
4.3 Module 3: Interface (HTML5) . . . . . . . . . . . . . . . . . . . 9
4.4 Module 4: Styling (CSS3) . . . . . . . . . . . . . . . . . . . . . . 9
5 Testing and Output 10
6 Conclusion 11
7 Future Scope 11
8 Bibliography 12
3
3
1 Introduction
1.1 Project Overview
The AI Chatbot Assistant is a software application capable of conduct-
ing an on-line chat conversation via text. It simulates the way a human
would behave as a conversational partner.
1.2 Problem Statement
In today’s digital world, users often need quick answers to common queries
(like time, simple calculations, or general info). Searching through menus
is slow. A conversational interface provides immediate results.
1.3 Objectives
1. To create a user-friendly interface using HTML/CSS.
AUTH: PRATIK & RITURAJ
2. To implement natural language logic using Python.
[Link]
3. To maintain a history of chats using Java file handling.
4. To learn the integration of multiple programming languages.
Technical Scope
This project is a Rule-Based Chatbot. It does not use Neural Net-
works (yet), but relies on pattern matching algorithms to identify
keywords in the user’s input.
4
2 System Requirements
To ensure the smooth functioning of the AI Chatbot, the following hard-
ware and software specifications are required.
2.1 Hardware Requirements
• Processor: Intel Core i3 or higher (Recommended i5).
• RAM: Minimum 4GB (8GB recommended for smooth compilation).
• Storage: 500MB free disk space.
• Input Device: Standard Keyboard.
2.2 Software Requirements
• Operating System: Windows 10/11 or Linux.
AUTH: PRATIK & RITURAJ
• Languages: Python 3.x, Java JDK 17+.
[Link]
• Web Technologies: HTML5, CSS3.
• IDE: VS Code or PyCharm.
• Browser: Google Chrome or Edge.
5
3 System Design: Data Flow
The following flowchart illustrates how data moves from the User Inter-
face to the Logic Engine and Storage.
Start System
User Input (HTML)
Python Logic Processing
AUTH: PRATIK & RITURAJ
[Link]
Yes No
Generate Answer Match Found? Default Response
Java Logger (Save)
Display Output
Stop
6
4 Source Code
4.1 Module 1: Logic Engine (Python)
Filename: [Link]
1 import datetime
2 import random
3
4 # Knowledge Base Dictionary
5 responses = {
6 "hello": ["Hello! System Online.", "Greetings user.", "Hi there!"],
7 "who are you": ["I am an AI Assistant created by Pratik and RituRaj."],
8 "time": ["fetching system time..."],
9 "bye": ["Shutting down...", "Goodbye user!", "Session terminated."],
10 "default": ["I do not understand that command.", "Processing failed."]
11 }
12
13 def get_system_time():
14 """Returns the current system time."""
15 now = [Link]()
16 return [Link]("%H:%M:%S")
AUTH: PRATIK & RITURAJ
17
[Link]
18 def process_input(user_input):
19 """Analyzes user input and returns response."""
20 user_input = user_input.lower().strip()
21
22 if "time" in user_input:
23 return f"Current System Time: {get_system_time()}"
24
25 for key in responses:
26 if key in user_input:
27 return [Link](responses[key])
28
29 return [Link](responses["default"])
30
31 # Simulation Loop
32 if __name__ == "__main__":
33 print("--- AI CORE ONLINE ---")
34 while True:
35 command = input("USER >> ")
36 if [Link]() == "exit":
37 break
38 print(f"AI >> {process_input(command)}")
7
4.2 Module 2: Data Logger (Java)
Filename: [Link]
1 import [Link];
2 import [Link];
3 import [Link];
4 import [Link];
5
6 public class ChatLogger {
7 private static final String LOG_FILE = "chat_history.txt";
8
9 public static void logConversation(String userMsg, String aiMsg) {
10 try {
11 FileWriter writer = new FileWriter(LOG_FILE, true);
12 LocalDateTime now = [Link]();
13 DateTimeFormatter dtf = [Link]("yyyy/MM/dd HH:
mm:ss");
14
15 String logEntry = [Link]("[%s] USER: %s | AI: %s%n",
16 [Link](now), userMsg, aiMsg);
17
18 [Link](logEntry);
[Link]();
AUTH: PRATIK & RITURAJ
19
} catch (IOException e) {
[Link]
20
21 [Link]();
22 }
23 }
24 }
8
4.3 Module 3: Interface (HTML5)
Filename: [Link]
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>AI Assistant</title>
6 <link rel="stylesheet" href="[Link]">
7 </head>
8 <body>
9 <div class="main-container">
10 <header class="chat-header">
11 <h2>SYSTEM ONLINE</h2>
12 <span class="version">v1.0.4</span>
13 </header>
14
15 <div class="chat-window" id="chat-display">
16 <!-- Messages appear here -->
17 </div>
18
19 <div class="input-area">
<input type="text" id="user-input" placeholder="Enter command...">
AUTH: PRATIK & RITURAJ
20
<button onclick="sendMessage()">SEND</button>
[Link]
21
22 </div>
23 </div>
24 </body>
25 </html>
4.4 Module 4: Styling (CSS3)
Filename: [Link]
1 :root {
2 --bg-color: #050510;
3 --accent-gold: #c9a05a;
4 }
5 body {
6 background-color: var(--bg-color);
7 font-family: 'Courier New', monospace;
8 display: flex;
9 justify-content: center;
10 align-items: center;
11 color: #fff;
12 }
13 .main-container {
14 border: 2px solid var(--accent-gold);
15 border-radius: 15px;
16 box-shadow: 0 0 20px rgba(201, 160, 90, 0.2);
17 }
9
5 Testing and Output
We performed rigorous testing to ensure the bot responds correctly.
Test Case ID Input Description Status
TC-001 User types ”Hello” PASS
TC-002 User asks ”What is the PASS
time?”
TC-003 User types garbage text PASS
”asdfg”
TC-004 User clicks Send button PASS
Table 1: System Test Log
AUTH: PRATIK & RITURAJ
[Link]
[PASTE SCREENSHOT OF CHATBOT HERE]
Figure 1.1: Live execution of the Interface
10
6 Conclusion
The **AI Chatbot Assistant** project successfully demonstrates the inte-
gration of Python’s logic capabilities with a Web Interface and Java-based
file handling. We learned how to structure code into modules and how
to debug real-time errors. The system is stable, responsive, and meets
all initial objectives set by the Computer Science department.
7 Future Scope
While the current version is rule-based, future iterations will include:
1. Voice Recognition: Using Python libraries like speech_recognition
to allow users to talk to the bot.
2. Machine Learning: Implementing TensorFlow or NLTK to make
the bot learn from conversations instead of relying on hard-coded
AUTH: PRATIK & RITURAJ
responses.
[Link]
3. Cloud Database: Connecting the Java logger to Firebase or MySQL
for online storage.
11
8 Bibliography
The following resources were consulted during the development of this
project:
Books
• Computer Science with Python by Sumita Arora.
• Java: The Complete Reference by Herbert Schildt.
Websites
• [Link] - For HTML/CSS reference.
• [Link] - For debugging logic errors.
• [Link] - Official documentation.
AUTH: PRATIK & RITURAJ
[Link]
12