Project Apna
Project Apna
(Signature of student)
Himanshu Sharma
(MAU21UCS039)
(Signature of student)
Timan Samal
(MAU21UCS046)
(Signature of student)
Sandeep
(MAU21UCS040)
Date: 30-11-2024
Certified that the above statement made by the student is correct to the best
of our knowledge and belief.
i
CERTIFICATE
This is to certify that the project “Cypher Chatbot in partial fulfilment of the
(Signature)
Er.RitikaSharma
Faculty Coordinators
Date :
ii
ACKNOWLEDGEMENT
An idea is the first step for generation & development of anything. The initial
idea may have been of any one person, but the development & improvement on
it have always been a result of hard work, help, inspiration and blessings of
thanks of gratitude to my college faculty coordinators Er. Ranjit Kumar for their
constant support and who gave me the golden opportunity to do this wonderful
project on the topic “Cypher Chatbot”, which also helped me in doing a lot of
Research and gaining some precious knowledge. Lastly, I would like to thank
the almighty and our parents for their moral support and friends with whom we
shared our day-to-day experience and received lots of suggestions that improve
iii
Abstract
iv
v
Contents
1 Introduction 1-5
5 20-21
Source Code
6 Results 22-25
7 Output 26
8 27-29
Future Scope
9 30-31
Conclusions
vi
Introduction
Features of Cypher
1. Health-Focused Assistance:
o Cypher is designed to answer questions related to diseases such as
Diabetes, Heart Diseases, Kidney Disorders, and others.
o Responses include well-structured information on symptoms,
causes, precautions, and treatments.
2. Scope Limitation for Accuracy:
o The chatbot strictly focuses on health-related topics and machine
learning queries.
o It avoids answering questions beyond its scope, ensuring
reliability.
3. Real-Time Interactivity:
o Users can experience dynamic interaction through a chat interface
that simulates typing animations for enhanced engagement.
4. Session Continuity:
o The chatbot retains conversation history during a session, offering
seamless interaction.
5. User-Centric Design:
o A visually appealing sidebar provides branding, a description of
Cypher’s capabilities, and a text input for queries.
o Custom styling is implemented for a professional and polished
look.
1. Streamlit:
Streamlit is used to build the web-based interface of the chatbot. Its
simplicity and interactivity allow for creating dynamic applications with
minimal code.
2. GAPI:
The core intelligence behind Cypher is powered by the Google
Generative AI model, which processes user queries and generates
contextually accurate and concise responses.
3. Backend Logic:
o The project includes embedded instructions for the AI, ensuring it
adheres to strict rules for focusing on health-related topics.
o AI responses are streamed dynamically to simulate typing
animation, enhancing the conversational experience.
4. Session Management:
The chatbot uses st.session_state to maintain chat history, ensuring that
users can continue their conversations without losing context.
5. Styling and Branding:
o Custom CSS enhances the visual design, making the application
user-friendly and professional.
o Sidebar branding and an informative section add to the chatbot’s
appeal.
Workflow
Use Cases
AI in Healthcare
Recent studies, such as "AI in Healthcare: Past, Present, and Future" have
demonstrated how AI can be utilized in diagnostics, risk prediction, patient
management, and drug discovery. AI's ability to process and interpret large
datasets is particularly valuable in healthcare, where accurate, timely decision-
making is critical.
Chatbots in Healthcare
Chatbots, powered by AI, have been increasingly used in healthcare for their
ability to automate and streamline communication with users. They offer
immediate and personalized responses to patient inquiries, reducing the load on
healthcare professionals while enhancing accessibility to information.
Studies like "User Experience and Chatbot Acceptance in Health Care" (Shah et
al., 2021) highlight that chatbots designed with engaging user interfaces and
interactive features are more likely to increase user satisfaction. The paper
emphasizes that visual elements, such as avatars, along with dynamic text
responses, can make interactions feel more human-like, fostering a sense of
trust.
For instance, Panch et al. (2019) in their work "The Ethical Implications of AI
in Healthcare" stressed the importance of maintaining privacy and
transparency when deploying AI-based systems, especially when they are used
to interact with vulnerable populations.
Overview:
Google’s Generative AI, particularly the Gemini model, is used for processing
natural language queries and generating responses. The Gemini API is part of
Google Cloud's AI offerings, enabling the chatbot to understand and respond to
user inputs in real-time.
Key Features:
In this project, the Gemini generative model powers the chat system, allowing
the chatbot (Cypher) to answer medical-related queries efficiently and
accurately. It handles both simple and complex requests, delivering responses
with appropriate content formatting (e.g., symptoms, causes, treatment, and
prevention).
2. Streamlit
Overview:
Key Features:
Streamlit is used in this project to build the user interface (UI) for the Cypher
chatbot. The chatbot’s conversation interface, sidebars, and image display are
3. Python
Overview:
Key Features:
Ease of Use: Python's clear syntax makes it accessible for developers and
accelerates the development process.
Python serves as the backbone of the project, integrating all the components,
including the Google Generative AI model and the Streamlit user interface. It
handles tasks such as:
Overview:
The Google Cloud API provides access to Google’s powerful machine learning
services, including Generative AI models like Gemini. This API allows the
chatbot to interact with Google’s models for real-time query processing and
response generation.
Key Features:
The Google Generative AI API is configured with an API key, which enables
the Cypher chatbot to send user queries to the Gemini model. The responses
generated by the model are then displayed back to the user via the Streamlit
interface. The API key ensures secure access to the AI services, making it an
essential part of the chatbot’s functionality.
1. Theoretical Foundation
2. Generative AI Models
2. Methodology
The system is divided into two primary components: the Backend (AI Model)
and the Frontend (User Interface). These components communicate through a
client-server architecture, ensuring smooth interactions between the user and the
AI system.
The backend is the heart of the Cypher Chatbot, where all the AI-related
processing happens.
The frontend is where the user interacts with the system. Streamlit is used to
build the web interface, making it easy to create and deploy the chatbot on the
web.
User Input: Users enter queries into a text box located in the sidebar of
the web application. These inputs are then processed by the backend AI
model.
The methodology revolves around efficient data flow between the user interface
and the backend AI system. The process is broken down into the following
steps:
1. User Input: The user enters a query into the input box in the sidebar. The
query is typically related to diseases, symptoms, treatment, or prevention.
5. Session Update: Both the user’s query and the assistant's response are
stored in session variables to maintain context between multiple queries.
6. User-Centric Design
The Cypher Chatbot is designed with usability in mind, ensuring that the user
can interact with the system intuitively.
One of the core goals of the project was to ensure that the AI provides accurate,
relevant, and well-organized information related to health. The results indicate
that the Google Gemini Generative AI model effectively meets this goal:
User Engagement: The streaming effect ensures that the user remains
engaged throughout the interaction. The response appears word-by-word,
which creates a sense of real-time interaction. The user is more likely to
stay interested, as the experience feels conversational and dynamic.
Output
While the chatbot performs well in structured conversations, there is room for
improvement in handling more complex, free-form interactions. Future versions
could incorporate the following enhancements:
Core Features:
Strengths:
Improvements Recommended: