0% found this document useful (0 votes)
27 views27 pages

Introduction To Vedic AI

Vedic AI is a project that merges ancient Indian scriptures with modern AI technologies to create an interactive platform for answering spiritual and philosophical questions. The system utilizes Natural Language Processing and Machine Learning to analyze texts from the Bhagavad Gita and other Vedic texts, aiming to make this knowledge accessible and relevant today. The project includes developing a chatbot interface, a knowledge base, and various functionalities to support users in exploring Vedic concepts.

Uploaded by

patelanushree864
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views27 pages

Introduction To Vedic AI

Vedic AI is a project that merges ancient Indian scriptures with modern AI technologies to create an interactive platform for answering spiritual and philosophical questions. The system utilizes Natural Language Processing and Machine Learning to analyze texts from the Bhagavad Gita and other Vedic texts, aiming to make this knowledge accessible and relevant today. The project includes developing a chatbot interface, a knowledge base, and various functionalities to support users in exploring Vedic concepts.

Uploaded by

patelanushree864
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

CHAPTER: 1 Introduction

 Introduction to Vedic AI:


Vedic AI is an innovative project that integrates the timeless wisdom of ancient Indian
scriptures such as the Vedas, Upanishads, and Bhagavad Gita with modern Artificial
Intelligence (AI) technologies. The aim of this system is to make Vedic knowledge more
accessible, interactive, and relevant for today’s generation by creating an AI-driven platform
capable of answering spiritual, ethical, and philosophical questions.

The project applies Natural Language Processing (NLP), Machine Learning (ML), and
Knowledge Representation techniques to analyze scripture-based texts and deliver
meaningful responses in natural language. By doing so, Vedic AI seeks to provide users with
personalized guidance, contextual explanations, and thematic exploration of concepts such
as dharma, karma, meditation, and leadership.

 Final Purpose:
The purpose of the internship project “Vedic AI” is to combine the timeless wisdom of
ancient Indian scriptures such as the Bhagavad Gita, Vedas, and Upanishads with modern
artificial intelligence (AI) technologies. The project seeks to develop an intelligent system
capable of answering philosophical, ethical, and spiritual questions in a way that is
accessible to people worldwide. The final aim is to preserve and promote Vedic knowledge
through digital transformation, making it available for educational, research, and personal
guidance purposes.

 Objectives of Vedic AI:


1. To study and digitize important teachings from the Bhagavad Gita and other Vedic
texts.
2. To design an AI-based chatbot or knowledge assistant capable of responding to user
queries in natural language.
3. To apply Natural Language Processing (NLP) and Machine Learning (ML) techniques
for text analysis, context understanding, and semantic search.
4. To build an accessible platform that can support interactive learning of spiritual and
philosophical concepts.

5. To bridge the gap between ancient wisdom and modern technology, making Vedic
knowledge relevant in today’s world.

 Scope:
 The system will primarily focus on the Bhagavad Gita, later extending to other
Vedic texts.
 It will support question-answering, thematic exploration (e.g., karma, dharma,
meditation, leadership), and personalized recommendations.
 The AI system will serve multiple user groups: students, researchers, spiritual
seekers, and general learners.
 The scope also includes multilingual support, enabling answers in English, Hindi,
and Sanskrit (expansion possible).
 Future expansion may involve integration with mobile apps, voice assistants, and
educational platforms.

 Technologies used :
1. Programming Language:

 Python → the main language used for development.

2. Frameworks / Libraries:

 Streamlit → for building the interactive web app (UI, chat interface, sidebar,
history).
 Cohere API → for text generation (LLM model command-r-plus-08-2024).
 pandas → for handling and querying the knowledge base (verses as a DataFrame).
 pdfplumber → for extracting text content from the Bhagavad Gita PDF file.
 time → for conversation IDs and session handling.

3. Knowledge Base:
 PDF File ("Bhagavad-gita-As-It-Is.pdf") → used as the scripture source, parsed
into a structured dataset.

4. Application Layer:

 Chatbot Logic → question handling, knowledge base search, API integration.


 History Management → saving, restoring, and browsing past conversations via
session state.

 Literature review:
 Research on scripture digitization shows that texts like the Bible and Quran
have been converted into searchable datasets for education and guidance. Similar
to these works, this project uses pdfplumber and pandas to extract and organize
the Bhagavad Gita verses.
 Studies in information retrieval highlight the limitations of simple keyword
search, suggesting that semantic search with embeddings provides more
accurate results. Currently, the system applies keyword matching but can be
extended with embeddings.
 Literature on AI chatbots for sacred texts demonstrates the effectiveness of
combining a knowledge base with large language models (LLMs) for context-
aware responses. This aligns with the use of Cohere’s API in the chatbot.
 Finally, works on AI ethics in religion stress neutrality and accuracy in
interpretation. By grounding answers in the Bhagavad Gita verses, the chatbot
supports ethical and reliable responses.
CHAPTER: 2 Training Activities
The internships panned 6weeks(42days), from27thMay2025to7thJuly2025,andprovided hands-on
experience in Data science with Python, , and frontend technologies like libraries, API integration,
PDFPlumber etc.

The learning was divided into weeks, with daily task tracking based on the oretical concepts,
practical coding, and project development. Below is the structured log of the training activities:

Week1:PythonFundamentals&ProgrammingLogic

Day1–Day2(27–28May)

Topic: Python Setup& Basic Syntax

Activities:
 Installed Python and VSCode
 Understood printstatements, variables, and comments
 Wrote basic Python programs like"HelloWorld"

Day3–Day4(29–30May)

Topic:DataTypes,Casting,andStrings
Activities:
 Practiced int, float, string, and boolean datatypes
 Applied casting functions : int(),str(),float()
 Explored string methods: .upper(),.lower(),.replace(),.strip()
 Learned string slicing and formatting

Day5–Day6(31May–1 June)

Topic: Lists, Tuples, Sets, and Dictionaries


Activities:
 Implemented list functions: .append(),.remove(),.sort()
 Used dictionary methods: .keys(),.values(),.items()
Week2:ControlFlow,Functions&Object-OrientedProgramming

Day7–Day8(2–3June)

Topic: Conditional Statements and Loops


Activities:
 Implemented decision making using if, elif, and else
 Used for and while loops
 Created programs for even-odd, number patterns, and prime checking

Day9–Day10(4–5June)

Topic: Functions and Scope

Activities:
 Defined user functions with parameters
 Practiced default arguments, return values
 Nested functions and global/local scope

Day11–Day12(6–7June)

Topic: Object-Oriented Concepts

Activities:
 Defined Python classes and created objects
 Learned about constructors, attributes ,and methods
 Used self, init ,and encapsulated data
 Applied inheritance in simple class hierarchies

Week3: Pandas and numpy:

Day 13-Day16(9-12 June)

Topic: Introduction to Library


Activities:
 Introduction to pandas
 Introduction to Numpy
 Did some Examples of pandas and Numpy
Day17–Day21(13–16June)

Topic :Introduction to Matplotlib

Activities:
 Matplotlib intro, get started, pyplot.
 Matplotlib plotting, markers, lines, labels.
 Matplotlib grid, subplot, scatters.
 Matplotlib bar, piechart, histrogram.

Day22–Day24(17–19June)

Topic: python Routing and Templates

Activities:
 Handled GET and POST requests
 Created chatbot interface.
 Displayed user input and display output.

Week4: Frontend Development & Project Integration

Day25–Day30(20–22June)

Topic: fronted and Integration

Activities:

 Frontend: Streamlit-based chat interface with sidebar, input box, and history viewer
 .Integration: PDF knowledge base → search layer → Cohere API → session management →
frontend display.

Week5: cohere API


Day31–Day32(23–25 june)

Topic: introduction to cohere API


Activities:
1. Text Generation: Produces meaningful and coherent answers to user questions by analyzing both the
query and relevant verses from the knowledge base.
2. Prompt-based Learning: Allows feeding specific instructions, context, or scripture excerpts to guide
the model’s responses.

3. Integration with Python: Cohere provides a Python SDK that seamlessly connects with the chatbot
backend, enabling real-time AI responses in the Streamlit interface.

Week6: Testing, Debugging, and Finalization

Day 33–Day35(26-27june)

Topic: Manual Testing and Bug Fixing

Activities:
 Testing: unit test, functional test, usability test, edge cases.
 Debugging: Text Extraction Errors, Session Management Bugs, API Errors, Response
Formatting.
 Finalization: functional chatbot interface, Reliable knowledge base search, Proper handling of
session state, input validation, and user interactions.

Day36–Day38(30june–5July)

Topic: UI Finalization and Deployment


Activities:
 The Vedic AI chatbot’s UI was finalized with a clean, intuitive chat interface, sidebar controls
for conversation management, and a responsive layout for ease of use. Visual elements like the
Bhagavad Gita cover and formatted AI responses enhance readability, while input validation and
error handling ensure smooth interaction.

 For deployment, the system was first tested locally and can be hosted on platforms like
Streamlit Cloud, Heroku, or AWS. Cohere API integration provides real-time AI responses,
and session management preserves conversation history, making Vedic AI fully functional and
accessible online.

Day39–Day42(6–7July)

Topic: Documentation & Report Writing


Activities:
 Collected code base and screenshots
 Created final report structure
CHAPTER: 3 SYSTEM PLANNING
 Project title: Vedic AI

 Functional Requirements:
These define the core capabilities of the system:

1. User Query Handling: Accept and process questions from users about the
Bhagavad Gita.
2. Knowledge Base Search: Retrieve relevant verses from the digitized Gita PDF
using keyword or semantic search.
3. AI Response Generation: Generate meaningful and context-aware answers
using Cohere API.
4. Chat Interface: Display conversation between user and AI in a chat-like format.
5. Conversation History: Store and display past conversations for reference.
6. New Conversation Management: Allow users to start fresh sessions while
preserving old histories.
7. Error Handling: Handle empty inputs, invalid queries, and API errors
gracefully.
8. Session Management: Maintain session state to preserve ongoing
conversations.
 Non Functional Requirements:
1. Usability:
o Easy-to-use chat interface with clear message distinction (User vs Bot).
o Sidebar controls for navigation and history viewing.
2. Performance:
o Fast response generation from Cohere API.
o Efficient PDF parsing and verse retrieval.
3. Reliability & Availability:
o Maintain conversation state reliably across sessions.
o Handle API errors or network issues gracefully.
4. Scalability:
o Ability to expand to other Vedic texts or multilingual support.
5. Security:
o Secure storage of API keys.
o Prevent unauthorized access to session data.
6. Portability:
o Deployable on local machines or cloud platforms like Streamlit Cloud.
CHAPTER: 4 TIME OVERVIEW AND ABSTRACT
 Timeline chart:
6-Week Internship Timeline (27 May – 7 July 2025)

1. Week 1 (27 May – 2 June): Project Setup & Requirement Analysis


o Initial phase focused on understanding project objectives, gathering
requirements, and planning the workflow for the Vedic AI chatbot.
2. Week 2 (3 June – 9 June): Streamlit Interface Development
o Development of the frontend using Streamlit, including chat interface, input
forms, sidebar controls, and basic UI elements.
3. Week 3 (10 June – 16 June): Cohere Integration & Prompt Design
o Integration of the Cohere API for AI response generation and designing
prompts to ensure meaningful answers based on Bhagavad Gita verses.
4. Week 4 (17 June – 23 June): Data Extraction & Transaction Parsing
o Parsing the Bhagavad Gita PDF using pdfplumber and structuring the
knowledge base for efficient search and retrieval.
5. Week 5 (24 June – 30 June): Feature Implementation & Testing
o Implementation of additional features such as conversation history, error
handling, and real-time AI responses; followed by thorough testing of all
modules.
6. Week 6 (1 July – 7 July): Final Review & Documentation
o Final review of the system, debugging remaining issues, preparing project
documentation, and compiling the internship report.
 Abstract of project:

1. Objective: To create an AI-powered chatbot that provides interactive guidance


based on the Bhagavad Gita.
2. Knowledge Base: Digitized verses of the Bhagavad Gita using pdfplumber and
pandas.
3. AI Integration: Uses Cohere API (LLM) to generate context-aware and
meaningful responses.
4. Frontend: Developed with Streamlit, featuring a chat interface, sidebar controls,
and conversation history.
5. Functionality: Supports question-answering, session management, and retrieval
of relevant scripture references
6. Significance: Bridges ancient wisdom with modern AI technology, making
Vedic teachings accessible and interactive for users worldwide.
CHAPTER : 5 IMPLEMENTATION AND TESTING
 Proposed Module Interaction Diagram (Textual Flow)
Explanation of Flow:

1. User Input → Streamlit UI:


o User types a question and clicks “Ask.”
2. UI → Knowledge Base Search:
o The input is matched against PDF content using Pandas +
pdfplumber.
3. UI → Cohere API:
o A prompt is generated with user question + relevant verses.
o Cohere API generates a spiritual response.
4. Response → Session State:
o Both user input and bot response are stored in st.session_state for
persistence.
5. Session State → UI Display:
o Current response is shown.
o Sidebar can show previous conversations.
Description of the Vedic AI – Bhagavad Gita Chatbot
interface:
 Explanation of interface:

1. Overall Layout:
 The app uses a dark theme (black/dark gray background) for a modern and
minimalistic look.
 The page title at the top is “ Vedic AI – Bhagavad Gita Chatbot”, centered
horizontally.

2. Search / Input Bar:


 A central search bar is placed below the title for user input.
 A search icon button (magnifying glass) is on the right side of the input bar to submit
questions.
 This is the main area where users can ask questions about the Bhagavad Gita.

3. Sidebar:
 Position: Left side of the screen.
 Sections:
1. Gita Conversations
 Contains buttons:
 New Conversation: Likely resets the chat for a fresh conversation.
 Current Conversation: Restores or continues the ongoing chat.
2. History
 Placeholder for showing previous conversation history.
 In this screenshot, no past conversation is shown yet.

4. Design Features:
 Minimalistic design focused on user interaction with clear emphasis on the chatbot
functionality.
 Dark theme is easy on the eyes, suitable for reading textual responses.
 The layout seems responsive and centered, with main interaction area in the center
and sidebar for controls/history.

 Code:
import streamlit as st
import cohere
import pandas as pd
import pdfplumber
import time

# ----------------------------
# Set Page Title and Theme
# ----------------------------
st.set_page_config(page_title="📘 Vedic AI - Bhagavad Gita Chatbot",
layout="centered")
st.title("🕉️Vedic AI - Bhagavad Gita Chatbot")

# ----------------------------
# Cohere API Setup
# ----------------------------
COHERE_API_KEY = "RJ0sqkX4xHHilGex3Jtu2ewvj8sdQAwAUE6FNQ2H" #
Replace with your key
co = cohere.Client(COHERE_API_KEY)

# ----------------------------
# Load PDF Knowledge Base
# ----------------------------
@st.cache_data(ttl=600)
def load_knowledge_base(pdf_path):
content_list = []
with pdfplumber.open(pdf_path) as pdf:
for page in pdf.pages:
text = page.extract_text()
if text:
content_list.extend(text.split('\n'))
df = pd.DataFrame(content_list, columns=["content"])
return df[df['content'].str.strip().astype(bool)]

knowledge_base = load_knowledge_base("Bhagavad-gita-As-It-Is.pdf")

# ----------------------------
# Function to Search Knowledge Base
# ----------------------------
def query_knowledge_base(query, knowledge_base, top_n=3):
matches = knowledge_base[knowledge_base["content"].str.contains(query,
case=False, na=False)]
return matches.head(top_n).to_dict(orient="records")

# ----------------------------
# Generate Response with Cohere
# ----------------------------
def get_cohere_response(prompt):
response = co.generate(
model='command-r-plus-08-2024',
prompt=prompt,
max_tokens=300,
temperature=0.7,
)
return response.generations[0].text.strip()

# ----------------------------
# Session State Initialization
# ----------------------------
if 'messages' not in st.session_state:
st.session_state.messages = []

if 'history' not in st.session_state:


st.session_state.history = {}

if 'selected_history' not in st.session_state:


st.session_state.selected_history = None

if 'conversation_id' not in st.session_state:


st.session_state.conversation_id = f"{time.time():.6f}"

# ----------------------------
# Sidebar for Controls
# ----------------------------
with st.sidebar:

st.image("https://upload.wikimedia.org/wikipedia/commons/8/88/Bhagavad_Gita_Cove
r.jpg", use_column_width=True)
st.markdown("### 🙏 Gita Conversations")
if st.button("🆕 New Conversation"):
st.session_state.messages = []
st.session_state.selected_history = None
st.session_state.conversation_id = f"{time.time():.6f}"
if st.button("📌 Current Conversation"):
st.session_state.selected_history = None
if "messages_backup" in st.session_state:
st.session_state.messages = st.session_state.messages_backup

# ----------------------------
# Sidebar History Viewer
# ----------------------------
st.sidebar.subheader("🕰️History")
displayed_questions = set()
for key in sorted(st.session_state.history.keys(), reverse=True):
user_question = st.session_state.history[key][0][1] if st.session_state.history[key]
else ""
if user_question and user_question not in displayed_questions:
button_key = f"view_{key}"
if st.sidebar.button(f"View: {user_question}", key=button_key):
st.session_state.selected_history = key
displayed_questions.add(user_question)

# ----------------------------
# Handle User Input
# ----------------------------
def handle_input():
user_input = st.session_state.user_input.strip()
if not user_input:
return

kb_results = query_knowledge_base(user_input, knowledge_base)


kb_response = "\n".join([f"- {res['content']}" for res in kb_results]) if kb_results else
"No relevant verse found."

prompt = f"""You are a spiritual assistant knowledgeable in the teachings of the


Bhagavad Gita.

User question: "{user_input}"

Relevant verses from the Gita:


{kb_response}

Provide a clear and thoughtful answer rooted in the Bhagavad Gita's wisdom:
"""

cohere_response = get_cohere_response(prompt)
final_response = cohere_response

st.session_state.messages.append(("User", user_input))
st.session_state.messages.append(("Bot", final_response))
st.session_state.messages_backup = st.session_state.messages[:]
st.session_state.history[f"{time.time():.6f}"] = st.session_state.messages[:]
st.session_state.user_input = ""
# ----------------------------
# Display Chat Interface
# ----------------------------
if st.session_state.selected_history:
st.subheader("📂 Viewing Past Conversation")
selected_messages = st.session_state.history[st.session_state.selected_history]
for i in range(0, len(selected_messages), 2):
st.markdown(f"*You:* {selected_messages[i][1]}")
st.markdown(f"*Bot:* {selected_messages[i + 1][1]}")
st.markdown("---")
else:
def submit():
handle_input()
st.session_state.user_input = ""

col1, col2 = st.columns([9, 1])


with col1:
st.text_input("Ask a question:", key="user_input", label_visibility="collapsed",
on_change=submit)
with col2:
st.button("🔍", key="ask_button", on_click=submit)

if st.session_state.messages:
st.markdown("### 🟢 Current Response")
st.markdown(f"*You:* {st.session_state.messages[-2][1]}")
st.markdown(f"*Bot:* {st.session_state.messages[-1][1]}")

# st.markdown("### 📜 Previous Messages")


# for i in range(0, len(st.session_state.messages) - 2, 2):
# st.markdown("---")
# st.markdown(f"*You:* {st.session_state.messages[i][1]}")
# st.markdown(f"*Bot:* {st.session_state.messages[i + 1][1]}")
Example use case:

 User Input:
• "Who is Krishna?"
This query shows how the chatbot provides spiritual insights.

 Bot Output:
• Explains Krishna as the divine manifestation of the
Supreme Being.

• Shares teachings on dharma (righteous duty), karma (selfless


action), and self-realization.

• Provides guidance for seekers towards truth, liberation, and


moral righteousness.
CHAPTER: 6 CONCLUSION AND LIMITATIONS AND
FUTURE SCOPE

Conclusion:
• Successfully developed a Vedic AI Chatbot using Streamlit, Cohere, and Python.

• The chatbot efficiently interprets user queries and provides


accurate spiritual and vedic queries.

• Enhances user experience through a clean UI, real-time responses, and


spiritual summaries.

• Demonstrated the ability to integrate respond with spiritual,


showcasing the practical use of AI in real-world applications
for personal growth.

Limitations:

• Works mainly on keyword-based search, so may miss deeper meanings.

• Limited to English Bhagavad Gita PDF only.

• Dependent on Cohere API and internet connection.

Future scope:
• Add semantic search using embeddings for better accuracy.

• Support multiple languages (Hindi, Sanskrit, regional).

• Enable voice input/output for more interactive use


 References:

Streamlit Developers Guide – Used to build the web


interface for chatbot deployment.

Cohere AI Documentation – Helped integrate language


understanding through prompt engineering.

Pandas Library Reference (Python) – Provided data structures


and
operations for transaction analysis.

W3Schools Python Tutorials – Strengthened


foundational Python skills for logic building and
integration.

Python.org Documentation – Used for official syntax,


functions, and. Library refrencess.

Sample Bhagavad Gita Data – Used for testing chatbot


features and output formatting.

.
CONTENTS
 Company overview
Chapter:1 INTRODUCTION
 Introduction to Vedic AI
 Final purpose
 Objectives
 Scope
 Technologies used
 Literature review

Chapter:2 TRAINING ACTIVITIES


 Week1: Python Fundamentals & Programming Logic
 Week2: ControlFlow,Functions&Object-OrientedProgramming
 Week3: Pandas and numpy
 Week4: Frontend Development & Project Integratio
 Week5: cohere API
 Week6: Testing, Debugging, and Finalization

Chapter: 3 SYSTEM PLANNING


 Functional Requirements
 Non Functional Requirements

Chapter: 4 TIME OVERVIEW AND ABSTRACT


 Timeline chart
 Abstract of project

Chapter: 5 IMPLEMENTATION AND TESTING


 Proposed Module Interaction Diagram (Textual Flow)
 Description of the Vedic AI – Bhagavad Gita Chatbot interface
 Code
 Example use case

Chapter: 6 CONCLUSION AND LIMITATIONS AND


FUTURE SCOPE

 Conclusion
 Limitations
 Future scope

 References

CompanyProfile
CompanyName:BANANASOFTINFOTECHPvtLtd

ContactNo:+919898257016

EmailId:bananasoftinfotech@g

mail.comWebsite:

https://bananasoftinfotech.in

We Make Creativity Work for Your Brand!

Banana Soft InfoTech provider specializing in cutting-edge software


development and IT services. With a strong focus on innovation,
efficiency, and security, we help businesses navigate the digital
landscape with confidence. Our expertise spans across Web & Mobile
App Development, AI & Machine Learning, Python & API
Development, Data Science, and Digital Marketing—ensuring end-
to-end solutions tailored to our clients' unique needs.

Banana SoftInfoTech has mature and well-defined processes and


methodologies based on the project management, agile software
development and IT infrastructure and security. Our team uses the
latest technologies to create efficient and reliable digital solutions
tailored to each client’s needs. Whether you're a startup or a large
enterprise, we are here to support your digital transformation and
success.

You might also like