YoonJ-C commited on
Commit
e53009c
·
1 Parent(s): 2a3dc7a

Update spiritual path assessment with improved UI and functionality

Browse files
1d_similarity_visualization.html ADDED
The diff for this file is too large to render. See raw diff
 
app.py CHANGED
@@ -1,6 +1,5 @@
1
  """
2
  Concept: Flask + HTML Integration - Spiritual Path Assessment Tool
3
-
4
  This app helps users discover which religious or spiritual path aligns with their
5
  beliefs, values, lifestyle, and background through an interactive questionnaire.
6
  """
@@ -12,6 +11,7 @@ import json
12
  import os
13
  from dotenv import load_dotenv
14
  from together import Together
 
15
 
16
  load_dotenv()
17
 
@@ -25,6 +25,9 @@ USERS_FILE = os.getenv("USERS_FILE", "users_data.json")
25
  TOGETHER_API_KEY = os.getenv("TOGETHER_API_KEY")
26
  client = Together(api_key=TOGETHER_API_KEY) if TOGETHER_API_KEY else None
27
 
 
 
 
28
  # Assessment Questions
29
  QUESTIONS = [
30
  {
@@ -338,6 +341,10 @@ def reset_assessment():
338
 
339
  @app.route("/chat", methods=["POST"])
340
  def chat():
 
 
 
 
341
  if 'username' not in session:
342
  return jsonify({"success": False, "message": "Not logged in"})
343
 
@@ -352,37 +359,65 @@ def chat():
352
  if not user_message or not religion_name:
353
  return jsonify({"success": False, "message": "Message and religion required"})
354
 
355
- # Find religion details
356
  religion_data = None
 
 
357
  for key, value in RELIGIONS.items():
358
  if value['name'] == religion_name:
359
- religion_data = value
 
 
 
 
 
360
  break
361
 
362
  if not religion_data:
363
  return jsonify({"success": False, "message": "Religion not found"})
364
 
365
- # Create context-aware system prompt
366
- system_prompt = f"""You're a spiritual guide for {religion_data['name']}.
367
- Info: {religion_data['description']} | Practices: {religion_data['practices']} | Beliefs: {religion_data['core_beliefs']}
368
- Rules: Keep 30-50 words, be respectful, use * for bullet points (format: "Text: * item * item"), answer directly."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
 
370
- # Build conversation history
371
  messages = [{"role": "system", "content": system_prompt}]
372
 
373
- # Add chat history (last 5 messages for context)
374
- for msg in chat_history[-5:]:
375
  messages.append({"role": msg["role"], "content": msg["content"]})
376
 
377
- # Add current user message
378
  messages.append({"role": "user", "content": user_message})
379
 
380
  try:
381
- # Call Together API with limited tokens for concise responses
382
  response = client.chat.completions.create(
383
  model="meta-llama/Meta-Llama-3-8B-Instruct-Lite",
384
  messages=messages,
385
- max_tokens=80, # Roughly 50-60 words maximum
386
  temperature=0.7,
387
  )
388
 
@@ -403,4 +438,4 @@ Rules: Keep 30-50 words, be respectful, use * for bullet points (format: "Text:
403
  initialize_default_user()
404
 
405
  if __name__ == "__main__":
406
- app.run(debug=True, port=5001)
 
1
  """
2
  Concept: Flask + HTML Integration - Spiritual Path Assessment Tool
 
3
  This app helps users discover which religious or spiritual path aligns with their
4
  beliefs, values, lifestyle, and background through an interactive questionnaire.
5
  """
 
11
  import os
12
  from dotenv import load_dotenv
13
  from together import Together
14
+ from rag_utils import load_religions_from_csv, prepare_religion_rag_context
15
 
16
  load_dotenv()
17
 
 
25
  TOGETHER_API_KEY = os.getenv("TOGETHER_API_KEY")
26
  client = Together(api_key=TOGETHER_API_KEY) if TOGETHER_API_KEY else None
27
 
28
+ # Load detailed religion data at startup
29
+ RELIGIONS_CSV = load_religions_from_csv('religions.csv')
30
+
31
  # Assessment Questions
32
  QUESTIONS = [
33
  {
 
341
 
342
  @app.route("/chat", methods=["POST"])
343
  def chat():
344
+ """
345
+ RAG-enhanced chat endpoint for spiritual guidance
346
+ Uses retrieval-augmented generation with religion-specific context
347
+ """
348
  if 'username' not in session:
349
  return jsonify({"success": False, "message": "Not logged in"})
350
 
 
359
  if not user_message or not religion_name:
360
  return jsonify({"success": False, "message": "Message and religion required"})
361
 
362
+ # Find religion in CSV data first, fallback to basic RELIGIONS
363
  religion_data = None
364
+ religion_key = None
365
+
366
  for key, value in RELIGIONS.items():
367
  if value['name'] == religion_name:
368
+ religion_key = key
369
+ # Use CSV data if available
370
+ if key in RELIGIONS_CSV:
371
+ religion_data = RELIGIONS_CSV[key]
372
+ else:
373
+ religion_data = value
374
  break
375
 
376
  if not religion_data:
377
  return jsonify({"success": False, "message": "Religion not found"})
378
 
379
+ # Build RAG context using rag_utils
380
+ if religion_key in RELIGIONS_CSV:
381
+ # Rich context from CSV using RAG utilities
382
+ csv_data = RELIGIONS_CSV[religion_key]
383
+ context_chunks = prepare_religion_rag_context(csv_data, use_chunks=False)
384
+ context = f"""REFERENCE DATA FOR {csv_data['name']}:
385
+
386
+ {context_chunks[0]}"""
387
+ else:
388
+ # Fallback to basic data
389
+ basic_context = prepare_religion_rag_context(religion_data, use_chunks=False)
390
+ context = f"""REFERENCE DATA FOR {religion_data['name']}:
391
+
392
+ {basic_context[0]}"""
393
+
394
+ system_prompt = f"""You're a knowledgeable spiritual guide. Use the reference data below to answer questions.
395
+
396
+ {context}
397
+
398
+ INSTRUCTIONS:
399
+ - Keep responses concise, minimal. 30-60 words, depending on the context
400
+ - ALWAYS complete your sentences - never cut off mid-sentence
401
+ - Be respectful and accurate
402
+ - If unsure, say so
403
+ - Use * for bullet points if listing
404
+ - End responses with complete thoughts, not incomplete phrases
405
+ - If you need to cut information, end with "..." but complete the current sentence"""
406
 
407
+ # Build conversation
408
  messages = [{"role": "system", "content": system_prompt}]
409
 
410
+ # Add recent chat history
411
+ for msg in chat_history[-4:]:
412
  messages.append({"role": msg["role"], "content": msg["content"]})
413
 
 
414
  messages.append({"role": "user", "content": user_message})
415
 
416
  try:
 
417
  response = client.chat.completions.create(
418
  model="meta-llama/Meta-Llama-3-8B-Instruct-Lite",
419
  messages=messages,
420
+ max_tokens=200,
421
  temperature=0.7,
422
  )
423
 
 
438
  initialize_default_user()
439
 
440
  if __name__ == "__main__":
441
+ app.run(debug=True, port=5003)
chunks.json ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ "============================================================\nReligion: Christianity\n============================================================\n\nDescription: Christianity is a major monotheistic religion originating from the life, teachings, and death of Jesus of Nazareth in the 1st century CE.",
3
+ "death of Jesus of Nazareth in the 1st century CE. It is the world's largest religion with over two billion adherents, emphasizing faith in Jesus Christ as the Son of God who offers salvation through his death and resurrection.",
4
+ "fers salvation through his death and resurrection. The religion has profoundly influenced global culture, ethics, and institutions, evolving through historical interactions with diverse civilizations and adapting to various contexts while maintaining a focus on redemption and community.",
5
+ "maintaining a focus on redemption and community.\n\nPractices: Key practices include prayer (personal and communal communication with God), Bible study (reading and interpreting sacred scriptures), attending church services (worship, preaching, and fellowship), and sacraments such as communion (commem",
6
+ "lowship), and sacraments such as communion (commemorating Jesus' Last Supper) and baptism (symbolizing spiritual rebirth). Other observances involve fasting, charity, mission work, and celebrating holidays like Christmas (Jesus' birth) and Easter (resurrection).",
7
+ "hristmas (Jesus' birth) and Easter (resurrection). Practices vary by denomination, from liturgical rituals in Catholicism to charismatic worship in Pentecostalism.",
8
+ "licism to charismatic worship in Pentecostalism.\n\nCore Beliefs: Central beliefs include the Trinity (one God in three persons: Father, Son, Holy Spirit), salvation through faith in Jesus Christ (who atoned for humanity's sins), the resurrection and eternal life, original sin (humanity's fallen state",
9
+ "ternal life, original sin (humanity's fallen state), and the authority of the Bible. Additional doctrines encompass grace (God's unmerited favor), the church as the body of believers, eschatology (end times and judgment), and ethical living based on love, forgiveness, and justice.",
10
+ "al living based on love, forgiveness, and justice. Monotheism is foundational, rejecting polytheism and atheism.\n\nCommon Questions: Common questions include: Why does God allow evil and suffering? Is faith irrational or opposed to science? Why is Jesus the only way to heaven? Can one lose salvation?",
11
+ "us the only way to heaven? Can one lose salvation? Why are there hypocrites in Christianity? How to take the Bible literally? How should Christians respond to issues like LGBTQ+ rights, racism, and injustice? Interesting facts: Christianity emerged from Judaism; not all ministers wear special attire",
12
+ "rom Judaism; not all ministers wear special attire; churches are communities, not just buildings; over 2 billion followers worldwide; the Bible has no contradictions claimed by believers but debated by skeptics.\n\n\n\n============================================================\nReligion: Islam",
13
+ "=================================\nReligion: Islam\n============================================================\n\nDescription: Islam is a monotheistic religion founded in 7th-century Arabia by the Prophet Muhammad, emphasizing submission to the will of Allah (God) as revealed in the Quran.",
14
+ "the will of Allah (God) as revealed in the Quran. With over 1.5 billion adherents worldwide, it integrates spiritual devotion with social, legal, and ethical guidelines, fostering a sense of global community (ummah) and influencing diverse cultures through conquests, trade, and mysticism.",
15
+ "cultures through conquests, trade, and mysticism. It promotes justice, compassion, and personal accountability in both individual and communal life.\n\nPractices: Core practices, known as the Five Pillars, include Shahada (profession of faith), Salat (five daily prayers), Zakat (charity to the needy)",
16
+ "(five daily prayers), Zakat (charity to the needy), Sawm (fasting during Ramadan), and Hajj (pilgrimage to Mecca). Additional observances involve Halal dietary laws, ethical business conduct, community service, and Sufi mysticism (meditation, dhikr remembrance of God).",
17
+ "mysticism (meditation, dhikr remembrance of God). Practices emphasize discipline, social equity, and spiritual purification, varying between Sunni and Shia traditions.",
18
+ "tion, varying between Sunni and Shia traditions.\n\nCore Beliefs: Fundamental beliefs are Tawhid (oneness of Allah), prophethood (Muhammad as the final prophet completing revelations from Adam to Jesus), angels, holy books (Quran as ultimate scripture), Day of Judgment (accountability for deeds), and",
19
+ ", Day of Judgment (accountability for deeds), and predestination (Allah's will). Sources include Quran, Sunnah (Prophet's traditions), Ijma (consensus), and Ijtihad (reasoned interpretation).",
20
+ "consensus), and Ijtihad (reasoned interpretation). Ethics stress justice, mercy, and community, with variations in Sunni (Hadith-focused) and Shia (Imam-guided) interpretations.",
21
+ "focused) and Shia (Imam-guided) interpretations.\n\nCommon Questions: Common questions: Why is Islam perceived as violent? What are the Five Pillars? Who was Muhammad? Do Muslims believe in Jesus? What is the difference between Sunni and Shia? Why do Muslims fast during Ramadan? What is Jihad? Interes",
22
+ "uslims fast during Ramadan? What is Jihad? Interesting facts: Islam recognizes previous prophets like Abraham and Jesus; the Quran contains scientific facts ahead of its time; Muslims believe in one God without partners; major festivals include Eid al-Fitr and Eid al-Adha; over 1.",
23
+ "ivals include Eid al-Fitr and Eid al-Adha; over 1.8 billion followers worldwide; emphasizes charity and community.\n\n\n\n============================================================\nReligion: Buddhism\n============================================================",
24
+ "================================================\n\nDescription: Buddhism is a philosophy and religion founded by Siddhartha Gautama (the Buddha) in northeastern India between the 6th and 4th centuries BCE, focusing on overcoming suffering through enlightenment.",
25
+ "ing on overcoming suffering through enlightenment. With global influence in Asia and beyond, it emphasizes ethical living, meditation, and wisdom, adapting to diverse cultures while promoting compassion and mindfulness as paths to nirvana (liberation from rebirth).",
26
+ "s as paths to nirvana (liberation from rebirth).\n\nPractices: Core practices include meditation (vipassana for insight, samatha for calm), mindfulness (awareness in daily life), following the Eightfold Path (right view, intention, speech, action, livelihood, effort, mindfulness, concentration), and o",
27
+ "lihood, effort, mindfulness, concentration), and observing precepts (ethical guidelines like non-violence). Rituals vary: Theravada focuses on monastic discipline, Mahayana on bodhisattva vows and chants, Vajrayana on tantric rituals and mantras.",
28
+ "chants, Vajrayana on tantric rituals and mantras. Lay practices involve offerings, festivals, and pilgrimage.\n\nCore Beliefs: Key beliefs are the Four Noble Truths (suffering, its cause in desire, cessation through detachment, path to end it), Three Jewels (Buddha, Dharma teachings, Sangha community",
29
+ "Jewels (Buddha, Dharma teachings, Sangha community), karma (actions' consequences), samsara (cycle of rebirth), nirvana (enlightenment), and impermanence (anicca).",
30
+ "irvana (enlightenment), and impermanence (anicca). Variations: Theravada emphasizes individual liberation, Mahayana universal salvation via bodhisattvas, Vajrayana rapid enlightenment through esoteric methods. Rejects a creator god, focusing on self-reliance.",
31
+ "ejects a creator god, focusing on self-reliance.\n\nCommon Questions: Common questions: Who was the Buddha? Is Buddhism a religion or philosophy? Do Buddhists believe in God? What is karma and reincarnation? How does one achieve enlightenment? Why is suffering central? Interesting facts: Originated 2,",
32
+ "uffering central? Interesting facts: Originated 2,500 years ago in India; about 535 million followers; no creator god; focuses on ending suffering; diverse schools like Theravada, Mahayana; mindfulness practices influence modern psychology; Buddha means 'awakened one'; no single holy book but many s",
33
+ "ans 'awakened one'; no single holy book but many scriptures.\n\n\n\n============================================================\nReligion: Hinduism\n============================================================",
34
+ "================================================\n\nDescription: Hinduism is an ancient, diverse tradition originating in the Indian subcontinent around the 2nd millennium BCE, encompassing varied philosophies, rituals, and beliefs aimed at spiritual realization.",
35
+ "tuals, and beliefs aimed at spiritual realization. As the world's oldest living religion with nearly one billion adherents, it adapts regionally and emphasizes dharma (duty), karma (actions' effects), and moksha (liberation), influencing art, ethics, and society globally through texts and practices.",
36
+ "and society globally through texts and practices.\n\nPractices: Practices include yoga (physical and meditative disciplines), meditation (for inner peace), puja (worship with offerings), festivals (Diwali, Holi), pilgrimage (to sacred sites like Varanasi), and rites of passage (samskaras like marriag",
37
+ "asi), and rites of passage (samskaras like marriage). Daily routines involve mantra chanting, vegetarianism for some, and community service. Variations span devotional bhakti, philosophical jnana, and action-oriented karma paths.",
38
+ "sophical jnana, and action-oriented karma paths.\n\nCore Beliefs: Core beliefs include dharma (cosmic order and duty), karma (cause and effect across lives), samsara (rebirth cycle), moksha (liberation), and Brahman (ultimate reality). Deities represent aspects of the divine (e.g.",
39
+ "ty). Deities represent aspects of the divine (e.g., Vishnu, Shiva, Devi), with paths like bhakti (devotion), jnana (knowledge), and yoga. Scriptures: Vedas, Upanishads, epics like Ramayana. Emphasizes pluralism, with regional variations in worship and philosophy.",
40
+ "h regional variations in worship and philosophy.\n\nCommon Questions: Common questions: Why so many gods? Do Hindus believe in reincarnation? What is karma? Why worship cows? Is Hinduism a religion or way of life? Interesting facts: Oldest religion, over 1.",
41
+ "life? Interesting facts: Oldest religion, over 1.1 billion followers mostly in India; no single founder; diverse schools of philosophy; Vedas are ancient scriptures; emphasizes ahimsa (non-violence); multiple paths to truth; polytheistic yet monistic; festivals like Diwali celebrate light over dark",
42
+ "c; festivals like Diwali celebrate light over darkness.\n\n\n\n============================================================\nReligion: Judaism\n============================================================",
43
+ "================================================\n\nDescription: Judaism is a monotheistic religion developed among ancient Hebrews, centered on a covenant with God revealed through prophets like Abraham and Moses.",
44
+ "revealed through prophets like Abraham and Moses. With about 14 million adherents, it integrates theology, law, and culture, emphasizing ethical living and community while adapting through history, influencing Western civilization profoundly.",
45
+ "ry, influencing Western civilization profoundly.\n\nPractices: Practices include Shabbat observance (weekly rest and prayer), Torah study (scriptural learning), daily prayer (three times), kosher dietary laws, and life-cycle events (bar/bat mitzvah, circumcision).",
46
+ "life-cycle events (bar/bat mitzvah, circumcision). Holidays: Passover, Rosh Hashanah, Yom Kippur. Community involvement via synagogue services and charity (tzedakah). Variations in Orthodox (strict), Conservative (balanced), Reform (modern).",
47
+ "rict), Conservative (balanced), Reform (modern).\n\nCore Beliefs: Beliefs include one transcendent God, Torah as divine law, covenant with Israel, ethical monotheism, messianic hope, resurrection, and free will. Prophets guide moral response; history reveals God's purpose.",
48
+ "ide moral response; history reveals God's purpose. Emphasizes justice, peace, and human responsibility. Denominations differ in interpretation but share core ethical-historical monotheism.",
49
+ "on but share core ethical-historical monotheism.\n\nCommon Questions: Common questions: Why write G-d? What is the Wailing Wall? Is Judaism a religion or ethnicity? Why kosher laws? What are the branches (Orthodox, Reform)? Interesting facts: Based on Torah; one God; 613 mitzvot; emerged 4,000 years a",
50
+ "Torah; one God; 613 mitzvot; emerged 4,000 years ago; Jews, Israelites, Hebrews same; no proselytizing; emphasis on deeds over beliefs; guardian angels in tradition; diverse customs like not climbing trees on Shabbat.\n\n\n\n============================================================\nReligion: Taoism",
51
+ "================================\nReligion: Taoism\n============================================================\n\nDescription: Taoism (Daoism) is an indigenous Chinese tradition over 2,000 years old, emphasizing harmony with the Tao (the Way), a fundamental force underlying reality.",
52
+ "(the Way), a fundamental force underlying reality. It balances yielding, joyful attitudes with metaphysical exploration, influencing Asian cultures through philosophy, religion, and folk practices.",
53
+ "hrough philosophy, religion, and folk practices.\n\nPractices: Practices include meditation (for inner harmony), tai chi (movement for energy flow), wu wei (effortless action), simplicity in living, and rituals like Tao worship or alchemy.",
54
+ "n living, and rituals like Tao worship or alchemy. Religious aspects involve priestly ceremonies; philosophical focus on contemplation. Blends with Confucianism and Buddhism in folk traditions.",
55
+ "th Confucianism and Buddhism in folk traditions.\n\nCore Beliefs: Core beliefs: Tao as the natural order, yin-yang balance (complementary forces), harmony with nature, metaphysical engagement. Texts: Tao Te Ching, Zhuangzi. Variations: philosophical (mystical ideas) vs. religious (ritual worship).",
56
+ "l (mystical ideas) vs. religious (ritual worship). Rejects ego-dissolution, affirms reality's nature.\n\nCommon Questions: Common questions: What is the Tao? Who was Lao Tzu? Is Taoism a religion or philosophy? What is wu wei? How to apply Taoism daily? Interesting facts: Over 2,000 years old; influen",
57
+ "? Interesting facts: Over 2,000 years old; influences Chinese medicine; yin-yang symbol; no absolutes; monasteries called Gong and Guan; ethics based on charity, thrift; Tao indefinable; self-cultivation goal.\n\n\n\n============================================================\nReligion: Modern Paganism",
58
+ "=======================\nReligion: Modern Paganism\n============================================================\n\nDescription: Modern Paganism (Neopaganism) is a contemporary revival of pre-Christian, nature-based spiritualities, emerging in the 20th century amid environmental and feminist movements.",
59
+ "century amid environmental and feminist movements. It honors ancient traditions while adapting to modern contexts, emphasizing sacredness in nature and personal empowerment, with diverse, decentralized communities worldwide.",
60
+ "th diverse, decentralized communities worldwide.\n\nPractices: Practices include seasonal celebrations (solstices, equinoxes), rituals (circle casting, offerings), nature work (environmental activism, herbalism), divination (tarot, runes), and meditation.",
61
+ "alism), divination (tarot, runes), and meditation. Group covens or solitary paths; festivals like Beltane. Eclectic, drawing from Celtic, Norse, or Wiccan traditions.",
62
+ "rawing from Celtic, Norse, or Wiccan traditions.\n\nCore Beliefs: Beliefs: Nature as sacred, polytheism or pantheism (multiple deities or divine in all), cycles of life/death/rebirth, personal responsibility, magic as natural force. Rejects dogma; emphasizes harmony, diversity, and ethical living.",
63
+ "emphasizes harmony, diversity, and ethical living. Variations: Wicca (witchcraft-focused), Druidry (Celtic-inspired), Heathenry (Norse).\n\nCommon Questions: Common questions: What is Paganism? Is it witchcraft? Do Pagans worship Satan? How does it differ from ancient paganism? Interesting facts: Umbr",
64
+ "fer from ancient paganism? Interesting facts: Umbrella term for non-mainstream religions; revival, not continuous; includes Wicca, Druidry; nature-centric; no central authority; eclectic practices; influenced by 19th-20th century movements; celebrates Wheel of the Year; rejects dogma; modern inventi",
65
+ "s Wheel of the Year; rejects dogma; modern invention with ancient inspirations.\n\n\n\n============================================================\nReligion: Secular Humanism\n============================================================",
66
+ "================================================\n\nDescription: Secular Humanism is a modern ethical philosophy emphasizing human reason, values, and dignity without supernatural beliefs, rooted in Renaissance humanism but distinct in its non-theistic focus.",
67
+ "e humanism but distinct in its non-theistic focus. It promotes rational inquiry, science, and social justice as paths to fulfillment and societal improvement.",
68
+ "s paths to fulfillment and societal improvement.\n\nPractices: Practices include critical thinking (evidence-based decision-making), ethical living (compassion, justice), community service (volunteering, activism), and secular ceremonies (humanist weddings, namings).",
69
+ "d secular ceremonies (humanist weddings, namings). Education and dialogue foster personal growth; no rituals, but celebrations of life milestones.\n\nCore Beliefs: Beliefs: Human dignity and potential, reason and science as guides, secular ethics (morality from empathy, not divine command), rejection",
70
+ "lity from empathy, not divine command), rejection of supernaturalism. Anthropocentric focus on this life; variations like pragmatic or Christian humanism, but secular emphasizes autonomy and progress.",
71
+ "m, but secular emphasizes autonomy and progress.\n\nCommon Questions: Common questions: Is humanism a religion? What is secularism? Why focus on reason? Can humanists have morals without God? Interesting facts: Man-centered ethics; no supernatural; based on naturalism; promotes science; history from R",
72
+ "ed on naturalism; promotes science; history from Renaissance; emphasizes human agency; not anti-religion but non-theistic; goal is self-remediation; positive worldview.\n\n\n\n============================================================\nReligion: Atheism",
73
+ "===============================\nReligion: Atheism\n============================================================\n\nDescription: Atheism is the absence of belief in gods or spiritual beings, emphasizing empirical evidence and rational critique of metaphysical claims.",
74
+ "ence and rational critique of metaphysical claims. It promotes a naturalistic worldview focused on human experience and ethics, often in opposition to religious doctrines, with historical roots in philosophy and science.",
75
+ "with historical roots in philosophy and science.\n\nPractices: Practices involve evidence-based thinking (scientific inquiry, skepticism), secular community (atheist groups, discussions), and ethical activism (human rights, separation of church/state).",
76
+ "tivism (human rights, separation of church/state). No rituals; focus on rational discourse, education, and living meaningfully without faith.\n\nCore Beliefs: Beliefs: No gods exist (or low probability), natural explanations for phenomena, focus on this life.",
77
+ "al explanations for phenomena, focus on this life. Rejects spiritual beings; variations: fallibilistic (open to evidence), incoherence-based (God concepts illogical). Emphasizes burden of proof on theists, empirical reliability.",
78
+ "rden of proof on theists, empirical reliability.\n\nCommon Questions: Common questions: Why no God? Where does morality come from? Do atheists have faith? What about afterlife? Why be moral? Interesting facts: Not a religion, lack of belief; mostly men and young in U.S.",
79
+ "gion, lack of belief; mostly men and young in U.S.; 98% say religion unimportant; doubled in popularity; face discrimination; symbol is atomic whirl; no founder; can pray (meditate); smarter on average per some studies.\n\n\n\n============================================================",
80
+ "=================================================\nReligion: Agnosticism\n============================================================\n\nDescription: Agnosticism holds that the existence of gods or ultimate realities is unknowable, prioritizing evidence and reason while suspending judgment on metaphysi",
81
+ "and reason while suspending judgment on metaphysical claims. Coined by T.H. Huxley in 1869, it fosters intellectual humility amid scientific and philosophical debates.",
82
+ "ility amid scientific and philosophical debates.\n\nPractices: Practices include rigorous inquiry (following evidence, Clifford's ethics against insufficient belief), critical reflection (questioning claims), and openness to data.",
83
+ "ection (questioning claims), and openness to data. No formal rituals; involves ethical living based on reason, potentially contemplative for personal growth.\n\nCore Beliefs: Beliefs: Unknowability of gods/transcendent realities, method over creed (pursue reason, recognize limits).",
84
+ "thod over creed (pursue reason, recognize limits). Variations: secular (nonreligious skepticism), religious (minimal doctrine with evidence), philosophical (Hume/Kant unknowables). Distinguishes from atheism by not denying, but suspending belief.",
85
+ "m atheism by not denying, but suspending belief.\n\nCommon Questions: Common questions: How differs from atheism? Can agnostics be religious? Is it a middle ground? What after death? Interesting facts: Absence of knowledge about gods; coined 1869; honest approach to big questions; can overlap with ath",
86
+ "st approach to big questions; can overlap with atheism; views existence as unknowable; promotes humility; no certain evidence for gods; kids' view: 'not sure' about big questions.\n\n\n\n============================================================\nReligion: New Age Spirituality",
87
+ "==================\nReligion: New Age Spirituality\n============================================================\n\nDescription: New Age Spirituality is an eclectic movement from the 1970s-80s, blending esotericism, theosophy, and mysticism to anticipate an era of peace through personal transformation.",
88
+ "e an era of peace through personal transformation. Rooted in 19th-century theosophy, it promotes holistic growth and global awakening, influencing wellness and alternative therapies.",
89
+ "influencing wellness and alternative therapies.\n\nPractices: Practices include meditation (energy work, channeling), energy healing (crystals, reiki), yoga, astrology, and rituals (affirmations, vision boards). Eclectic: tarot, shamanism, nature communion.",
90
+ "ds). Eclectic: tarot, shamanism, nature communion. Focus on self-transformation and sharing divine energy.\n\nCore Beliefs: Beliefs: Imminent New Age of enlightenment (Aquarian shift), personal spiritual transformation (sadhana path), interconnectedness, reincarnation, Ascended Masters.",
91
+ "terconnectedness, reincarnation, Ascended Masters. Variations: theosophical (Maitreya focus), psychedelic-influenced. Emphasizes active manifestation over passive waiting.",
92
+ "sizes active manifestation over passive waiting.\n\nCommon Questions: Common questions: What is channeling? Why use crystals? Is yoga New Age? Do they believe in reincarnation? What is the Aquarian Age? Interesting facts: Umbrella for contemporary movement; not organized religion; planetary transforma",
93
+ "ment; not organized religion; planetary transformation; integrates astrology, tarot; spiritual healing; influenced by Western esotericism; emblematic universities like Naropa; focuses on human potential.\n\n\n\n============================================================",
94
+ "=================================================\nReligion: Spiritual But Not Religious\n============================================================\n\nDescription: Spiritual But Not Religious (SBNR) is a stance prioritizing personal spirituality over organized religion, focusing on individual well-be",
95
+ "organized religion, focusing on individual well-being and exploration. Emerging in the 1960s-2000s amid deinstitutionalization, it appeals to unaffiliated seekers valuing autonomy and eclecticism.",
96
+ "liated seekers valuing autonomy and eclecticism.\n\nPractices: Practices include meditation (mindfulness, TM), nature connection, eclectic rituals (Tarot, I Ching), and self-reflection. Therapeutic: yoga, journaling for emotional support. Avoids communal worship; experimental and as-needed.",
97
+ "ds communal worship; experimental and as-needed.\n\nCore Beliefs: Beliefs: Spirituality as private empowerment, anti-dogmatic (religion as rigid), focus on mind-body-spirit harmony. Variations: dissenters (reject religion), explorers (wanderlust), seekers (looking for home).",
98
+ "xplorers (wanderlust), seekers (looking for home). Emphasizes curiosity, intellectual freedom, personal path.\n\nCommon Questions: Common questions: What does SBNR mean? Do they believe in God? Why reject religion? What practices? Interesting facts: Connected to true self; most Americans spiritual; ad",
99
+ "nnected to true self; most Americans spiritual; addresses evil/misery; values ethical values; personal divine experience; anti-dogma; hunger for ritual without structure; integrates with other beliefs.\n\n\n\n============================================================\nReligion: Sikhism",
100
+ "===============================\nReligion: Sikhism\n============================================================\n\nDescription: Sikhism is a monotheistic faith founded by Guru Nanak in 15th-century Punjab, emphasizing equality, service, and devotion.",
101
+ "njab, emphasizing equality, service, and devotion. With 25 million adherents, it follows 10 Gurus' teachings, now in the Guru Granth Sahib, promoting ethical living and community amid historical independence from Hinduism.",
102
+ "nity amid historical independence from Hinduism.\n\nPractices: Practices include daily prayer/meditation (Nitnem), community service (seva), langar (free meals), wearing 5 Ks (kesh, kangha, kara, kachera, kirpan), and gurdwara attendance. Festivals: Vaisakhi, Diwali.",
103
+ "gurdwara attendance. Festivals: Vaisakhi, Diwali. Focus on honest living and sharing.\n\nCore Beliefs: Beliefs: One formless God, equality of all, Gurmat (Guru's way), liberation via devotion, rejection of caste/rituals. Scriptures: Guru Granth Sahib.",
104
+ "n of caste/rituals. Scriptures: Guru Granth Sahib. Influences: Sant (nirgun devotion), Nath (meditation ascent). Emphasizes ethical monotheism, service.",
105
+ "ascent). Emphasizes ethical monotheism, service.\n\nCommon Questions: Common questions: What do Sikhs teach about other religions? Who are the Gurus? Why wear turbans/5 Ks? What is langar? Interesting facts: Founded 1469 by Guru Nanak; 27 million followers; originated in Punjab; equality of men/women;",
106
+ "wers; originated in Punjab; equality of men/women; no caste; daily prayer; emblem Khanda; greets with Sat Sri Akal; emphasizes humanity and charity.\n\n\n\n============================================================\nReligion: Indigenous Spirituality",
107
+ "===============\nReligion: Indigenous Spirituality\n============================================================\n\nDescription: Indigenous Spirituality encompasses diverse traditional beliefs of native peoples worldwide, deeply connected to land, ancestors, and nature.",
108
+ ", deeply connected to land, ancestors, and nature. Rooted in ancient oral histories, it emphasizes holistic well-being, resilience, and reciprocity, varying by community but sharing themes of interconnectedness and cultural identity.",
109
+ "mes of interconnectedness and cultural identity.\n\nPractices: Practices include ceremonies (sweat lodges, vision quests), storytelling, seasonal rituals (harvest dances), and healing (herbal medicine, shamanic journeys). Community-focused: elder guidance, sacred sites pilgrimage.",
110
+ "-focused: elder guidance, sacred sites pilgrimage. Emphasizes respect for nature and ancestors.\n\nCore Beliefs: Beliefs: Interconnectedness of all (humans, animals, spirits), land as sacred, ancestor veneration, balance/harmony.",
111
+ "d as sacred, ancestor veneration, balance/harmony. Variations: Native American (Great Spirit, totemism), Aboriginal (Dreamtime, kinship). Holistic: mind-body-spirit integration; resilience through cultural practices.",
112
+ "egration; resilience through cultural practices.\n\nCommon Questions: Common questions: What is Indigenous spirituality? Do they have a Great Spirit? How linked to land? Myths about 'having it easy'? Interesting facts: Diverse, no single belief; spirituality in daily life; no division spiritual/secula",
113
+ "uality in daily life; no division spiritual/secular; kinship with nature; ceremonies vary by tribe; addresses appropriation; hunger for rituals; combined with other faiths sometimes."
114
+ ]
closest_chunk.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ s as paths to nirvana (liberation from rebirth).
2
+
3
+ Practices: Core practices include meditation (vipassana for insight, samatha for calm), mindfulness (awareness in daily life), following the Eightfold Path (right view, intention, speech, action, livelihood, effort, mindfulness, concentration), and o
embeddings.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a70efdf0c758156daf495242a3a19c1bccfce1e38e307720c81ebd16b90f3ed8
3
+ size 172195
rag_utils.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Simple RAG utilities for loading religion data"""
2
+ import csv
3
+
4
+ def load_religions_from_csv(csv_path):
5
+ """Load religion data from CSV file"""
6
+ try:
7
+ religions = {}
8
+ with open(csv_path, 'r', encoding='utf-8') as f:
9
+ reader = csv.DictReader(f)
10
+ for row in reader:
11
+ religions[row['key']] = row
12
+ print(f"✅ Loaded {len(religions)} religions from CSV")
13
+ return religions
14
+ except Exception as e:
15
+ print(f"⚠️ Error loading religions CSV: {e}")
16
+ return {}
17
+
18
+ def prepare_religion_rag_context(religion_data, use_chunks=True):
19
+ """Prepare context string from religion data"""
20
+ parts = []
21
+
22
+ if 'description' in religion_data:
23
+ parts.append(f"Description: {religion_data['description']}")
24
+ if 'practices' in religion_data:
25
+ parts.append(f"Practices: {religion_data['practices']}")
26
+ if 'core_beliefs' in religion_data:
27
+ parts.append(f"Core Beliefs: {religion_data['core_beliefs']}")
28
+ if 'common_curiosities' in religion_data:
29
+ parts.append(f"Common Questions: {religion_data['common_curiosities']}")
30
+
31
+ return ['\n\n'.join(parts)] if not use_chunks else parts
religions_corpus.txt ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ ============================================================
4
+ Religion: Christianity
5
+ ============================================================
6
+
7
+ Description: Christianity is a major monotheistic religion originating from the life, teachings, and death of Jesus of Nazareth in the 1st century CE. It is the world's largest religion with over two billion adherents, emphasizing faith in Jesus Christ as the Son of God who offers salvation through his death and resurrection. The religion has profoundly influenced global culture, ethics, and institutions, evolving through historical interactions with diverse civilizations and adapting to various contexts while maintaining a focus on redemption and community.
8
+
9
+ Practices: Key practices include prayer (personal and communal communication with God), Bible study (reading and interpreting sacred scriptures), attending church services (worship, preaching, and fellowship), and sacraments such as communion (commemorating Jesus' Last Supper) and baptism (symbolizing spiritual rebirth). Other observances involve fasting, charity, mission work, and celebrating holidays like Christmas (Jesus' birth) and Easter (resurrection). Practices vary by denomination, from liturgical rituals in Catholicism to charismatic worship in Pentecostalism.
10
+
11
+ Core Beliefs: Central beliefs include the Trinity (one God in three persons: Father, Son, Holy Spirit), salvation through faith in Jesus Christ (who atoned for humanity's sins), the resurrection and eternal life, original sin (humanity's fallen state), and the authority of the Bible. Additional doctrines encompass grace (God's unmerited favor), the church as the body of believers, eschatology (end times and judgment), and ethical living based on love, forgiveness, and justice. Monotheism is foundational, rejecting polytheism and atheism.
12
+
13
+ Common Questions: Common questions include: Why does God allow evil and suffering? Is faith irrational or opposed to science? Why is Jesus the only way to heaven? Can one lose salvation? Why are there hypocrites in Christianity? How to take the Bible literally? How should Christians respond to issues like LGBTQ+ rights, racism, and injustice? Interesting facts: Christianity emerged from Judaism; not all ministers wear special attire; churches are communities, not just buildings; over 2 billion followers worldwide; the Bible has no contradictions claimed by believers but debated by skeptics.
14
+
15
+
16
+
17
+ ============================================================
18
+ Religion: Islam
19
+ ============================================================
20
+
21
+ Description: Islam is a monotheistic religion founded in 7th-century Arabia by the Prophet Muhammad, emphasizing submission to the will of Allah (God) as revealed in the Quran. With over 1.5 billion adherents worldwide, it integrates spiritual devotion with social, legal, and ethical guidelines, fostering a sense of global community (ummah) and influencing diverse cultures through conquests, trade, and mysticism. It promotes justice, compassion, and personal accountability in both individual and communal life.
22
+
23
+ Practices: Core practices, known as the Five Pillars, include Shahada (profession of faith), Salat (five daily prayers), Zakat (charity to the needy), Sawm (fasting during Ramadan), and Hajj (pilgrimage to Mecca). Additional observances involve Halal dietary laws, ethical business conduct, community service, and Sufi mysticism (meditation, dhikr remembrance of God). Practices emphasize discipline, social equity, and spiritual purification, varying between Sunni and Shia traditions.
24
+
25
+ Core Beliefs: Fundamental beliefs are Tawhid (oneness of Allah), prophethood (Muhammad as the final prophet completing revelations from Adam to Jesus), angels, holy books (Quran as ultimate scripture), Day of Judgment (accountability for deeds), and predestination (Allah's will). Sources include Quran, Sunnah (Prophet's traditions), Ijma (consensus), and Ijtihad (reasoned interpretation). Ethics stress justice, mercy, and community, with variations in Sunni (Hadith-focused) and Shia (Imam-guided) interpretations.
26
+
27
+ Common Questions: Common questions: Why is Islam perceived as violent? What are the Five Pillars? Who was Muhammad? Do Muslims believe in Jesus? What is the difference between Sunni and Shia? Why do Muslims fast during Ramadan? What is Jihad? Interesting facts: Islam recognizes previous prophets like Abraham and Jesus; the Quran contains scientific facts ahead of its time; Muslims believe in one God without partners; major festivals include Eid al-Fitr and Eid al-Adha; over 1.8 billion followers worldwide; emphasizes charity and community.
28
+
29
+
30
+
31
+ ============================================================
32
+ Religion: Buddhism
33
+ ============================================================
34
+
35
+ Description: Buddhism is a philosophy and religion founded by Siddhartha Gautama (the Buddha) in northeastern India between the 6th and 4th centuries BCE, focusing on overcoming suffering through enlightenment. With global influence in Asia and beyond, it emphasizes ethical living, meditation, and wisdom, adapting to diverse cultures while promoting compassion and mindfulness as paths to nirvana (liberation from rebirth).
36
+
37
+ Practices: Core practices include meditation (vipassana for insight, samatha for calm), mindfulness (awareness in daily life), following the Eightfold Path (right view, intention, speech, action, livelihood, effort, mindfulness, concentration), and observing precepts (ethical guidelines like non-violence). Rituals vary: Theravada focuses on monastic discipline, Mahayana on bodhisattva vows and chants, Vajrayana on tantric rituals and mantras. Lay practices involve offerings, festivals, and pilgrimage.
38
+
39
+ Core Beliefs: Key beliefs are the Four Noble Truths (suffering, its cause in desire, cessation through detachment, path to end it), Three Jewels (Buddha, Dharma teachings, Sangha community), karma (actions' consequences), samsara (cycle of rebirth), nirvana (enlightenment), and impermanence (anicca). Variations: Theravada emphasizes individual liberation, Mahayana universal salvation via bodhisattvas, Vajrayana rapid enlightenment through esoteric methods. Rejects a creator god, focusing on self-reliance.
40
+
41
+ Common Questions: Common questions: Who was the Buddha? Is Buddhism a religion or philosophy? Do Buddhists believe in God? What is karma and reincarnation? How does one achieve enlightenment? Why is suffering central? Interesting facts: Originated 2,500 years ago in India; about 535 million followers; no creator god; focuses on ending suffering; diverse schools like Theravada, Mahayana; mindfulness practices influence modern psychology; Buddha means 'awakened one'; no single holy book but many scriptures.
42
+
43
+
44
+
45
+ ============================================================
46
+ Religion: Hinduism
47
+ ============================================================
48
+
49
+ Description: Hinduism is an ancient, diverse tradition originating in the Indian subcontinent around the 2nd millennium BCE, encompassing varied philosophies, rituals, and beliefs aimed at spiritual realization. As the world's oldest living religion with nearly one billion adherents, it adapts regionally and emphasizes dharma (duty), karma (actions' effects), and moksha (liberation), influencing art, ethics, and society globally through texts and practices.
50
+
51
+ Practices: Practices include yoga (physical and meditative disciplines), meditation (for inner peace), puja (worship with offerings), festivals (Diwali, Holi), pilgrimage (to sacred sites like Varanasi), and rites of passage (samskaras like marriage). Daily routines involve mantra chanting, vegetarianism for some, and community service. Variations span devotional bhakti, philosophical jnana, and action-oriented karma paths.
52
+
53
+ Core Beliefs: Core beliefs include dharma (cosmic order and duty), karma (cause and effect across lives), samsara (rebirth cycle), moksha (liberation), and Brahman (ultimate reality). Deities represent aspects of the divine (e.g., Vishnu, Shiva, Devi), with paths like bhakti (devotion), jnana (knowledge), and yoga. Scriptures: Vedas, Upanishads, epics like Ramayana. Emphasizes pluralism, with regional variations in worship and philosophy.
54
+
55
+ Common Questions: Common questions: Why so many gods? Do Hindus believe in reincarnation? What is karma? Why worship cows? Is Hinduism a religion or way of life? Interesting facts: Oldest religion, over 1.1 billion followers mostly in India; no single founder; diverse schools of philosophy; Vedas are ancient scriptures; emphasizes ahimsa (non-violence); multiple paths to truth; polytheistic yet monistic; festivals like Diwali celebrate light over darkness.
56
+
57
+
58
+
59
+ ============================================================
60
+ Religion: Judaism
61
+ ============================================================
62
+
63
+ Description: Judaism is a monotheistic religion developed among ancient Hebrews, centered on a covenant with God revealed through prophets like Abraham and Moses. With about 14 million adherents, it integrates theology, law, and culture, emphasizing ethical living and community while adapting through history, influencing Western civilization profoundly.
64
+
65
+ Practices: Practices include Shabbat observance (weekly rest and prayer), Torah study (scriptural learning), daily prayer (three times), kosher dietary laws, and life-cycle events (bar/bat mitzvah, circumcision). Holidays: Passover, Rosh Hashanah, Yom Kippur. Community involvement via synagogue services and charity (tzedakah). Variations in Orthodox (strict), Conservative (balanced), Reform (modern).
66
+
67
+ Core Beliefs: Beliefs include one transcendent God, Torah as divine law, covenant with Israel, ethical monotheism, messianic hope, resurrection, and free will. Prophets guide moral response; history reveals God's purpose. Emphasizes justice, peace, and human responsibility. Denominations differ in interpretation but share core ethical-historical monotheism.
68
+
69
+ Common Questions: Common questions: Why write G-d? What is the Wailing Wall? Is Judaism a religion or ethnicity? Why kosher laws? What are the branches (Orthodox, Reform)? Interesting facts: Based on Torah; one God; 613 mitzvot; emerged 4,000 years ago; Jews, Israelites, Hebrews same; no proselytizing; emphasis on deeds over beliefs; guardian angels in tradition; diverse customs like not climbing trees on Shabbat.
70
+
71
+
72
+
73
+ ============================================================
74
+ Religion: Taoism
75
+ ============================================================
76
+
77
+ Description: Taoism (Daoism) is an indigenous Chinese tradition over 2,000 years old, emphasizing harmony with the Tao (the Way), a fundamental force underlying reality. It balances yielding, joyful attitudes with metaphysical exploration, influencing Asian cultures through philosophy, religion, and folk practices.
78
+
79
+ Practices: Practices include meditation (for inner harmony), tai chi (movement for energy flow), wu wei (effortless action), simplicity in living, and rituals like Tao worship or alchemy. Religious aspects involve priestly ceremonies; philosophical focus on contemplation. Blends with Confucianism and Buddhism in folk traditions.
80
+
81
+ Core Beliefs: Core beliefs: Tao as the natural order, yin-yang balance (complementary forces), harmony with nature, metaphysical engagement. Texts: Tao Te Ching, Zhuangzi. Variations: philosophical (mystical ideas) vs. religious (ritual worship). Rejects ego-dissolution, affirms reality's nature.
82
+
83
+ Common Questions: Common questions: What is the Tao? Who was Lao Tzu? Is Taoism a religion or philosophy? What is wu wei? How to apply Taoism daily? Interesting facts: Over 2,000 years old; influences Chinese medicine; yin-yang symbol; no absolutes; monasteries called Gong and Guan; ethics based on charity, thrift; Tao indefinable; self-cultivation goal.
84
+
85
+
86
+
87
+ ============================================================
88
+ Religion: Modern Paganism
89
+ ============================================================
90
+
91
+ Description: Modern Paganism (Neopaganism) is a contemporary revival of pre-Christian, nature-based spiritualities, emerging in the 20th century amid environmental and feminist movements. It honors ancient traditions while adapting to modern contexts, emphasizing sacredness in nature and personal empowerment, with diverse, decentralized communities worldwide.
92
+
93
+ Practices: Practices include seasonal celebrations (solstices, equinoxes), rituals (circle casting, offerings), nature work (environmental activism, herbalism), divination (tarot, runes), and meditation. Group covens or solitary paths; festivals like Beltane. Eclectic, drawing from Celtic, Norse, or Wiccan traditions.
94
+
95
+ Core Beliefs: Beliefs: Nature as sacred, polytheism or pantheism (multiple deities or divine in all), cycles of life/death/rebirth, personal responsibility, magic as natural force. Rejects dogma; emphasizes harmony, diversity, and ethical living. Variations: Wicca (witchcraft-focused), Druidry (Celtic-inspired), Heathenry (Norse).
96
+
97
+ Common Questions: Common questions: What is Paganism? Is it witchcraft? Do Pagans worship Satan? How does it differ from ancient paganism? Interesting facts: Umbrella term for non-mainstream religions; revival, not continuous; includes Wicca, Druidry; nature-centric; no central authority; eclectic practices; influenced by 19th-20th century movements; celebrates Wheel of the Year; rejects dogma; modern invention with ancient inspirations.
98
+
99
+
100
+
101
+ ============================================================
102
+ Religion: Secular Humanism
103
+ ============================================================
104
+
105
+ Description: Secular Humanism is a modern ethical philosophy emphasizing human reason, values, and dignity without supernatural beliefs, rooted in Renaissance humanism but distinct in its non-theistic focus. It promotes rational inquiry, science, and social justice as paths to fulfillment and societal improvement.
106
+
107
+ Practices: Practices include critical thinking (evidence-based decision-making), ethical living (compassion, justice), community service (volunteering, activism), and secular ceremonies (humanist weddings, namings). Education and dialogue foster personal growth; no rituals, but celebrations of life milestones.
108
+
109
+ Core Beliefs: Beliefs: Human dignity and potential, reason and science as guides, secular ethics (morality from empathy, not divine command), rejection of supernaturalism. Anthropocentric focus on this life; variations like pragmatic or Christian humanism, but secular emphasizes autonomy and progress.
110
+
111
+ Common Questions: Common questions: Is humanism a religion? What is secularism? Why focus on reason? Can humanists have morals without God? Interesting facts: Man-centered ethics; no supernatural; based on naturalism; promotes science; history from Renaissance; emphasizes human agency; not anti-religion but non-theistic; goal is self-remediation; positive worldview.
112
+
113
+
114
+
115
+ ============================================================
116
+ Religion: Atheism
117
+ ============================================================
118
+
119
+ Description: Atheism is the absence of belief in gods or spiritual beings, emphasizing empirical evidence and rational critique of metaphysical claims. It promotes a naturalistic worldview focused on human experience and ethics, often in opposition to religious doctrines, with historical roots in philosophy and science.
120
+
121
+ Practices: Practices involve evidence-based thinking (scientific inquiry, skepticism), secular community (atheist groups, discussions), and ethical activism (human rights, separation of church/state). No rituals; focus on rational discourse, education, and living meaningfully without faith.
122
+
123
+ Core Beliefs: Beliefs: No gods exist (or low probability), natural explanations for phenomena, focus on this life. Rejects spiritual beings; variations: fallibilistic (open to evidence), incoherence-based (God concepts illogical). Emphasizes burden of proof on theists, empirical reliability.
124
+
125
+ Common Questions: Common questions: Why no God? Where does morality come from? Do atheists have faith? What about afterlife? Why be moral? Interesting facts: Not a religion, lack of belief; mostly men and young in U.S.; 98% say religion unimportant; doubled in popularity; face discrimination; symbol is atomic whirl; no founder; can pray (meditate); smarter on average per some studies.
126
+
127
+
128
+
129
+ ============================================================
130
+ Religion: Agnosticism
131
+ ============================================================
132
+
133
+ Description: Agnosticism holds that the existence of gods or ultimate realities is unknowable, prioritizing evidence and reason while suspending judgment on metaphysical claims. Coined by T.H. Huxley in 1869, it fosters intellectual humility amid scientific and philosophical debates.
134
+
135
+ Practices: Practices include rigorous inquiry (following evidence, Clifford's ethics against insufficient belief), critical reflection (questioning claims), and openness to data. No formal rituals; involves ethical living based on reason, potentially contemplative for personal growth.
136
+
137
+ Core Beliefs: Beliefs: Unknowability of gods/transcendent realities, method over creed (pursue reason, recognize limits). Variations: secular (nonreligious skepticism), religious (minimal doctrine with evidence), philosophical (Hume/Kant unknowables). Distinguishes from atheism by not denying, but suspending belief.
138
+
139
+ Common Questions: Common questions: How differs from atheism? Can agnostics be religious? Is it a middle ground? What after death? Interesting facts: Absence of knowledge about gods; coined 1869; honest approach to big questions; can overlap with atheism; views existence as unknowable; promotes humility; no certain evidence for gods; kids' view: 'not sure' about big questions.
140
+
141
+
142
+
143
+ ============================================================
144
+ Religion: New Age Spirituality
145
+ ============================================================
146
+
147
+ Description: New Age Spirituality is an eclectic movement from the 1970s-80s, blending esotericism, theosophy, and mysticism to anticipate an era of peace through personal transformation. Rooted in 19th-century theosophy, it promotes holistic growth and global awakening, influencing wellness and alternative therapies.
148
+
149
+ Practices: Practices include meditation (energy work, channeling), energy healing (crystals, reiki), yoga, astrology, and rituals (affirmations, vision boards). Eclectic: tarot, shamanism, nature communion. Focus on self-transformation and sharing divine energy.
150
+
151
+ Core Beliefs: Beliefs: Imminent New Age of enlightenment (Aquarian shift), personal spiritual transformation (sadhana path), interconnectedness, reincarnation, Ascended Masters. Variations: theosophical (Maitreya focus), psychedelic-influenced. Emphasizes active manifestation over passive waiting.
152
+
153
+ Common Questions: Common questions: What is channeling? Why use crystals? Is yoga New Age? Do they believe in reincarnation? What is the Aquarian Age? Interesting facts: Umbrella for contemporary movement; not organized religion; planetary transformation; integrates astrology, tarot; spiritual healing; influenced by Western esotericism; emblematic universities like Naropa; focuses on human potential.
154
+
155
+
156
+
157
+ ============================================================
158
+ Religion: Spiritual But Not Religious
159
+ ============================================================
160
+
161
+ Description: Spiritual But Not Religious (SBNR) is a stance prioritizing personal spirituality over organized religion, focusing on individual well-being and exploration. Emerging in the 1960s-2000s amid deinstitutionalization, it appeals to unaffiliated seekers valuing autonomy and eclecticism.
162
+
163
+ Practices: Practices include meditation (mindfulness, TM), nature connection, eclectic rituals (Tarot, I Ching), and self-reflection. Therapeutic: yoga, journaling for emotional support. Avoids communal worship; experimental and as-needed.
164
+
165
+ Core Beliefs: Beliefs: Spirituality as private empowerment, anti-dogmatic (religion as rigid), focus on mind-body-spirit harmony. Variations: dissenters (reject religion), explorers (wanderlust), seekers (looking for home). Emphasizes curiosity, intellectual freedom, personal path.
166
+
167
+ Common Questions: Common questions: What does SBNR mean? Do they believe in God? Why reject religion? What practices? Interesting facts: Connected to true self; most Americans spiritual; addresses evil/misery; values ethical values; personal divine experience; anti-dogma; hunger for ritual without structure; integrates with other beliefs.
168
+
169
+
170
+
171
+ ============================================================
172
+ Religion: Sikhism
173
+ ============================================================
174
+
175
+ Description: Sikhism is a monotheistic faith founded by Guru Nanak in 15th-century Punjab, emphasizing equality, service, and devotion. With 25 million adherents, it follows 10 Gurus' teachings, now in the Guru Granth Sahib, promoting ethical living and community amid historical independence from Hinduism.
176
+
177
+ Practices: Practices include daily prayer/meditation (Nitnem), community service (seva), langar (free meals), wearing 5 Ks (kesh, kangha, kara, kachera, kirpan), and gurdwara attendance. Festivals: Vaisakhi, Diwali. Focus on honest living and sharing.
178
+
179
+ Core Beliefs: Beliefs: One formless God, equality of all, Gurmat (Guru's way), liberation via devotion, rejection of caste/rituals. Scriptures: Guru Granth Sahib. Influences: Sant (nirgun devotion), Nath (meditation ascent). Emphasizes ethical monotheism, service.
180
+
181
+ Common Questions: Common questions: What do Sikhs teach about other religions? Who are the Gurus? Why wear turbans/5 Ks? What is langar? Interesting facts: Founded 1469 by Guru Nanak; 27 million followers; originated in Punjab; equality of men/women; no caste; daily prayer; emblem Khanda; greets with Sat Sri Akal; emphasizes humanity and charity.
182
+
183
+
184
+
185
+ ============================================================
186
+ Religion: Indigenous Spirituality
187
+ ============================================================
188
+
189
+ Description: Indigenous Spirituality encompasses diverse traditional beliefs of native peoples worldwide, deeply connected to land, ancestors, and nature. Rooted in ancient oral histories, it emphasizes holistic well-being, resilience, and reciprocity, varying by community but sharing themes of interconnectedness and cultural identity.
190
+
191
+ Practices: Practices include ceremonies (sweat lodges, vision quests), storytelling, seasonal rituals (harvest dances), and healing (herbal medicine, shamanic journeys). Community-focused: elder guidance, sacred sites pilgrimage. Emphasizes respect for nature and ancestors.
192
+
193
+ Core Beliefs: Beliefs: Interconnectedness of all (humans, animals, spirits), land as sacred, ancestor veneration, balance/harmony. Variations: Native American (Great Spirit, totemism), Aboriginal (Dreamtime, kinship). Holistic: mind-body-spirit integration; resilience through cultural practices.
194
+
195
+ Common Questions: Common questions: What is Indigenous spirituality? Do they have a Great Spirit? How linked to land? Myths about 'having it easy'? Interesting facts: Diverse, no single belief; spirituality in daily life; no division spiritual/secular; kinship with nature; ceremonies vary by tribe; addresses appropriation; hunger for rituals; combined with other faiths sometimes.
196
+
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- # Task 10 - Flask + HTML Integration with Chatbot
2
  Flask>=2.0.0
3
  python-dotenv>=0.19.0
4
- together>=0.2.0
 
1
+ # Flask + HTML Integration with Chatbot
2
  Flask>=2.0.0
3
  python-dotenv>=0.19.0
4
+ together>=0.2.0
static/script.js CHANGED
@@ -78,7 +78,7 @@ function showQuestion(questionIndex) {
78
 
79
  currentQuestion = questionIndex;
80
  document.getElementById('questionCounter').textContent = 'Question ' + questionIndex + ' of ' + totalQuestions;
81
- document.getElementById('progressBar').style.width = ((questionIndex - 1) / totalQuestions) * 100 + '%';
82
  updateNavigationButtons();
83
  }
84
 
 
78
 
79
  currentQuestion = questionIndex;
80
  document.getElementById('questionCounter').textContent = 'Question ' + questionIndex + ' of ' + totalQuestions;
81
+ document.getElementById('progressBar').style.width = (questionIndex / totalQuestions) * 100 + '%';
82
  updateNavigationButtons();
83
  }
84
 
static/style.css CHANGED
@@ -11,21 +11,30 @@ body {
11
  display: flex;
12
  justify-content: center;
13
  align-items: center;
14
- padding: 20px;
15
  }
16
 
17
  .container {
18
  background: white;
19
  border-radius: 16px;
20
- padding: 40px;
21
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
22
  max-width: 700px;
23
  width: 100%;
24
  animation: slideIn 0.4s ease;
25
- max-height: 90vh;
26
  overflow-y: auto;
27
  }
28
 
 
 
 
 
 
 
 
 
 
29
  @keyframes slideIn {
30
  from { opacity: 0; transform: translateY(20px); }
31
  to { opacity: 1; transform: translateY(0); }
@@ -33,12 +42,19 @@ body {
33
 
34
  h1 {
35
  color: #3D3D3D;
36
- font-size: 32px;
37
  margin-bottom: 8px;
38
  text-align: center;
39
  font-weight: 800;
40
  }
41
 
 
 
 
 
 
 
 
42
  h3 {
43
  text-align: center;
44
  color: #3D3D3D;
@@ -48,22 +64,33 @@ p {
48
  color: #6B7280;
49
  text-align: center;
50
  margin-bottom: 30px;
51
- font-size: 15px;
52
  }
53
 
54
  .subtitle {
55
  color: #9CA3AF;
56
- font-size: 14px;
57
  text-align: center;
58
  margin-bottom: 25px;
59
  line-height: 1.6;
60
  }
61
 
 
 
 
 
 
 
 
 
 
 
 
62
  /* Form Inputs */
63
  input[type="text"], input[type="password"] {
64
  width: 100%;
65
- padding: 12px 16px;
66
- font-size: 15px;
67
  border: none;
68
  background: #F5F5F5;
69
  border-radius: 10px;
@@ -71,6 +98,14 @@ input[type="text"], input[type="password"] {
71
  outline: none;
72
  }
73
 
 
 
 
 
 
 
 
 
74
  input:focus {
75
  background: #EBEBEB;
76
  box-shadow: 0 0 0 2px #E5E5E5;
@@ -78,8 +113,8 @@ input:focus {
78
 
79
  /* Buttons - Consolidated styles */
80
  button, .btn, .nav-btn, .submit-btn {
81
- padding: 12px 24px;
82
- font-size: 15px;
83
  background: #3D3D3D;
84
  color: white;
85
  border: none;
@@ -91,6 +126,14 @@ button, .btn, .nav-btn, .submit-btn {
91
  display: inline-block;
92
  }
93
 
 
 
 
 
 
 
 
 
94
  button:hover, .btn:hover, .nav-btn:hover, .submit-btn:hover {
95
  background: #1A1A1A;
96
  transform: translateY(-1px);
@@ -163,7 +206,7 @@ button:disabled {
163
  /* Question Blocks */
164
  .question-block {
165
  background: #FAFAFA;
166
- padding: 30px;
167
  border-radius: 12px;
168
  margin-bottom: 20px;
169
  border: none;
@@ -171,6 +214,14 @@ button:disabled {
171
  min-height: 400px;
172
  }
173
 
 
 
 
 
 
 
 
 
174
  .question-block.active {
175
  display: block;
176
  animation: fadeIn 0.3s ease;
@@ -185,10 +236,17 @@ button:disabled {
185
  color: #3D3D3D;
186
  margin-bottom: 25px;
187
  font-weight: 700;
188
- font-size: 18px;
189
  line-height: 1.6;
190
  }
191
 
 
 
 
 
 
 
 
192
  .question-number {
193
  display: inline-block;
194
  background: #3D3D3D;
@@ -205,18 +263,27 @@ button:disabled {
205
  /* Options */
206
  .option {
207
  display: block;
208
- padding: 16px 20px;
209
- margin-bottom: 12px;
210
  background: white;
211
  border: none;
212
  border-radius: 10px;
213
  cursor: pointer;
214
  transition: all 0.2s;
215
- font-size: 15px;
216
  color: #3D3D3D;
217
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
218
  }
219
 
 
 
 
 
 
 
 
 
 
220
  .option:hover {
221
  background: #F5F5F5;
222
  transform: translateX(5px);
@@ -224,10 +291,19 @@ button:disabled {
224
  }
225
 
226
  .option input[type="radio"] {
227
- margin-right: 12px;
228
  cursor: pointer;
229
- width: 18px;
230
- height: 18px;
 
 
 
 
 
 
 
 
 
231
  }
232
 
233
  .option input[type="radio"]:disabled {
@@ -249,11 +325,18 @@ button:disabled {
249
  .question-counter {
250
  text-align: center;
251
  color: #999;
252
- font-size: 14px;
253
  margin-bottom: 15px;
254
  font-weight: 600;
255
  }
256
 
 
 
 
 
 
 
 
257
  .progress-bar {
258
  background: #F5F5F5;
259
  height: 8px;
 
11
  display: flex;
12
  justify-content: center;
13
  align-items: center;
14
+ padding: 10px;
15
  }
16
 
17
  .container {
18
  background: white;
19
  border-radius: 16px;
20
+ padding: 20px;
21
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
22
  max-width: 700px;
23
  width: 100%;
24
  animation: slideIn 0.4s ease;
25
+ max-height: 95vh;
26
  overflow-y: auto;
27
  }
28
 
29
+ /* Mobile Responsive */
30
+ @media (max-width: 768px) {
31
+ .container {
32
+ padding: 15px;
33
+ border-radius: 12px;
34
+ margin: 5px;
35
+ }
36
+ }
37
+
38
  @keyframes slideIn {
39
  from { opacity: 0; transform: translateY(20px); }
40
  to { opacity: 1; transform: translateY(0); }
 
42
 
43
  h1 {
44
  color: #3D3D3D;
45
+ font-size: 28px;
46
  margin-bottom: 8px;
47
  text-align: center;
48
  font-weight: 800;
49
  }
50
 
51
+ /* Mobile Responsive */
52
+ @media (max-width: 768px) {
53
+ h1 {
54
+ font-size: 24px;
55
+ }
56
+ }
57
+
58
  h3 {
59
  text-align: center;
60
  color: #3D3D3D;
 
64
  color: #6B7280;
65
  text-align: center;
66
  margin-bottom: 30px;
67
+ font-size: 16px;
68
  }
69
 
70
  .subtitle {
71
  color: #9CA3AF;
72
+ font-size: 15px;
73
  text-align: center;
74
  margin-bottom: 25px;
75
  line-height: 1.6;
76
  }
77
 
78
+ /* Mobile Responsive */
79
+ @media (max-width: 768px) {
80
+ p {
81
+ font-size: 18px;
82
+ }
83
+
84
+ .subtitle {
85
+ font-size: 16px;
86
+ }
87
+ }
88
+
89
  /* Form Inputs */
90
  input[type="text"], input[type="password"] {
91
  width: 100%;
92
+ padding: 14px 18px;
93
+ font-size: 16px;
94
  border: none;
95
  background: #F5F5F5;
96
  border-radius: 10px;
 
98
  outline: none;
99
  }
100
 
101
+ /* Mobile Responsive */
102
+ @media (max-width: 768px) {
103
+ input[type="text"], input[type="password"] {
104
+ padding: 16px 20px;
105
+ font-size: 18px;
106
+ }
107
+ }
108
+
109
  input:focus {
110
  background: #EBEBEB;
111
  box-shadow: 0 0 0 2px #E5E5E5;
 
113
 
114
  /* Buttons - Consolidated styles */
115
  button, .btn, .nav-btn, .submit-btn {
116
+ padding: 14px 28px;
117
+ font-size: 16px;
118
  background: #3D3D3D;
119
  color: white;
120
  border: none;
 
126
  display: inline-block;
127
  }
128
 
129
+ /* Mobile Responsive */
130
+ @media (max-width: 768px) {
131
+ button, .btn, .nav-btn, .submit-btn {
132
+ padding: 16px 32px;
133
+ font-size: 18px;
134
+ }
135
+ }
136
+
137
  button:hover, .btn:hover, .nav-btn:hover, .submit-btn:hover {
138
  background: #1A1A1A;
139
  transform: translateY(-1px);
 
206
  /* Question Blocks */
207
  .question-block {
208
  background: #FAFAFA;
209
+ padding: 25px;
210
  border-radius: 12px;
211
  margin-bottom: 20px;
212
  border: none;
 
214
  min-height: 400px;
215
  }
216
 
217
+ /* Mobile Responsive */
218
+ @media (max-width: 768px) {
219
+ .question-block {
220
+ padding: 20px;
221
+ min-height: 350px;
222
+ }
223
+ }
224
+
225
  .question-block.active {
226
  display: block;
227
  animation: fadeIn 0.3s ease;
 
236
  color: #3D3D3D;
237
  margin-bottom: 25px;
238
  font-weight: 700;
239
+ font-size: 20px;
240
  line-height: 1.6;
241
  }
242
 
243
+ /* Mobile Responsive */
244
+ @media (max-width: 768px) {
245
+ .question-block h4 {
246
+ font-size: 22px;
247
+ }
248
+ }
249
+
250
  .question-number {
251
  display: inline-block;
252
  background: #3D3D3D;
 
263
  /* Options */
264
  .option {
265
  display: block;
266
+ padding: 18px 22px;
267
+ margin-bottom: 14px;
268
  background: white;
269
  border: none;
270
  border-radius: 10px;
271
  cursor: pointer;
272
  transition: all 0.2s;
273
+ font-size: 16px;
274
  color: #3D3D3D;
275
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
276
  }
277
 
278
+ /* Mobile Responsive */
279
+ @media (max-width: 768px) {
280
+ .option {
281
+ padding: 20px 24px;
282
+ margin-bottom: 16px;
283
+ font-size: 18px;
284
+ }
285
+ }
286
+
287
  .option:hover {
288
  background: #F5F5F5;
289
  transform: translateX(5px);
 
291
  }
292
 
293
  .option input[type="radio"] {
294
+ margin-right: 14px;
295
  cursor: pointer;
296
+ width: 20px;
297
+ height: 20px;
298
+ }
299
+
300
+ /* Mobile Responsive */
301
+ @media (max-width: 768px) {
302
+ .option input[type="radio"] {
303
+ width: 22px;
304
+ height: 22px;
305
+ margin-right: 16px;
306
+ }
307
  }
308
 
309
  .option input[type="radio"]:disabled {
 
325
  .question-counter {
326
  text-align: center;
327
  color: #999;
328
+ font-size: 16px;
329
  margin-bottom: 15px;
330
  font-weight: 600;
331
  }
332
 
333
+ /* Mobile Responsive */
334
+ @media (max-width: 768px) {
335
+ .question-counter {
336
+ font-size: 18px;
337
+ }
338
+ }
339
+
340
  .progress-bar {
341
  background: #F5F5F5;
342
  height: 8px;
templates/index.html CHANGED
@@ -1,6 +1,8 @@
1
  <!DOCTYPE html>
2
  <html>
3
  <head>
 
 
4
  <title>{{ title if logged_in else 'Spiritual Path Finder - Login' }}</title>
5
  <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
6
  </head>
 
1
  <!DOCTYPE html>
2
  <html>
3
  <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>{{ title if logged_in else 'Spiritual Path Finder - Login' }}</title>
7
  <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
8
  </head>
tsne_visualization.html ADDED
The diff for this file is too large to render. See raw diff