Home

Awesome

README.md

Overview

This project, graphGita, is the first modern re-interpretation of the Bhagavad Gita that utilizes Knowledge Graphs for accurate query retrieval and qunatify philosphical aspects to serve specific problem-solution needs. The ambitious goal is to incorporate over 200 versions of Gita interpretations written from time-to-time by different past and present scholars and integrate them in form of a sophisticated Knowledge Graph aided with modern retrieval technologies such as Monte Carlo Tree Search, and KG-RAG to provide a seamless multi-modal experience (text, image and video) to users. My primary goal is to increase readers' comprehension of philosophical ideas while offering pertinent perspectives for modern readers. Based on the literature reviews of each of the 18 chapters and how they relate to one another, the text is formatted into a graph structure. This structure may grow more sophisticated and complex with due course of time as the project progresses.

Demo app link

https://graphgita.streamlit.app/

Why Graph the Bhagvad Gita to Re-Understand it in Modern Times ?

There is a significant need to reinterpret ancient texts like the Bhagavad Gita in today's context. The teachings offer valuable perspectives on ethics, human behavior, and spirituality that remain applicable. However, traditional formats often fail to engage modern readers effectively. Advanced technologies, including knowledge graphs and machine learning, can make the wisdom of the Gita more accessible and relevant.

Key Features

Problem Statement

Why is this Project Required?

The Bhagavad Gita presents challenges for modern readers:

Overview of Bhagavad Gita Chapters

The Bhagavad Gita consists of 18 chapters, each focusing on different aspects of dharma, karma, and spiritual knowledge. Below is a comprehensive breakdown of each chapter:

ChapterNameSanskrit NameTotal VersesFocus Area
1The Observation of the ArmiesArjuna Visada Yoga47Introduces the setting and Arjuna's dilemma
2The Way of KnowledgeSankhya Yoga72Fundamental philosophy and nature of Self
3The Way of ActionKarma Yoga43The importance of righteous action
4The Way of Knowledge and ActionJnana Yoga42Divine nature of action and wisdom
5The Way of RenunciationKarma Sanyasa Yoga29Balance between action and renunciation
6The Way of MeditationDhyana Yoga47Practice of meditation and mind control
7The Way of Knowledge and RealizationJnana Vijnana Yoga30Understanding the absolute truth
8The Way to the SupremeAksara Brahma Yoga28Process of reaching the ultimate reality
9The Way of Royal KnowledgeRaja Vidya Yoga34Supreme knowledge and devotion
10The Divine ManifestationsVibhuti Yoga42Divine manifestations in the world
11The Vision of the Universal FormVisvarupa Darsana Yoga55Revelation of the cosmic form
12The Way of DevotionBhakti Yoga20Path of devotional service
13The Field and its KnowerKsetra Ksetrajna Vibhaga Yoga35Nature, the enjoyer, and consciousness
14The Three Modes of Material NatureGunatraya Vibhaga Yoga27Understanding material qualities
15The Supreme PersonPurusottama Yoga20The ultimate truth about God
16The Divine and Demoniac NaturesDaivasura Sampad Vibhaga Yoga24Divine and demoniac qualities
17The Three Divisions of FaithSraddhatraya Vibhaga Yoga28Three types of faith
18The Way of LiberationMoksa Sanyasa Yoga78Conclusion and path to liberation

Total Verses: 701 GraphGita Overview

Why Graph the Gita?

The Bhagavad Gita, while profound in its teachings, can be challenging to navigate and understand in its traditional linear format. By representing it as a knowledge graph:

  1. Non-Linear Navigation: Readers can explore connections between concepts across different chapters
  2. Contextual Understanding: Related verses and themes can be easily discovered regardless of their location in the text
  3. Modern Accessibility: Complex philosophical concepts become more approachable through visual and interactive representations
  4. Pattern Recognition: Mathematical analysis reveals structural patterns and thematic relationships that might not be apparent in linear reading
  5. Personalized Learning: MCTS-powered exploration allows readers to follow paths most relevant to their interests and questions

This graphical representation transforms the ancient text into a dynamic knowledge base that preserves its authenticity while making it more accessible to modern readers.

Limitations of Existing Texts

Readers today may encounter:

Life Problems and Their Solutions in the Bhagavad Gita

The Bhagavad Gita offers guidance for various life challenges. Below is a mapping of common problems to relevant verses:

ProblemDescriptionChapter:Verse References
AngerManaging and overcoming anger2:56, 2:62, 2:63, 5:26, 16:1-3, 16:21
DepressionDealing with depression and mental suffering2:3, 2:14, 5:21
ConfusionClearing confusion and gaining clarity2:7, 3:2, 18:61
EnvyDealing with envy and jealousy12:13-14, 16:19, 18:71
Death of Loved OneCoping with death of a loved one2:13, 2:20, 2:22, 2:25, 2:27
DemotivationDealing with lack of motivation11:33, 18:48, 18:78
DiscriminationDealing with discrimination and unfair treatment5:18-19, 6:32, 9:29
FearOvercoming fear and anxiety4:10, 11:50, 18:30
GuiltDealing with guilt and feelings of sinfulness4:36-37, 5:10, 9:30, 10:3, 14:6, 18:66
ForgetfulnessDealing with forgetfulness15:15, 18:61
GreedOvercoming greed and attachment14:17, 16:21, 17:25
LazinessOvercoming laziness and procrastination3:8, 3:20, 6:16, 18:39
LonelinessDealing with feelings of loneliness6:30, 9:29, 13:16, 13:18
HopelessnessDealing with hopelessness and despair4:11, 6:22, 9:34, 18:66, 18:78
LustControlling lust and sensual desires3:37, 3:41, 3:43, 5:22, 16:21
ForgivenessLearning and practicing forgiveness11:44, 12:13-14, 16:1-3
PrideManaging ego and pride16:4, 16:13-15, 18:26, 18:58
Inner PeaceFinding inner peace and tranquility2:66, 2:71, 4:39, 5:29, 8:28
TemptationDealing with temptations2:60-61, 2:70, 7:14
Mental ControlManaging an uncontrolled mind6:5-6, 6:26, 6:35

#Graph Examples GraphGita Overview Figure 1: Overview of the GraphGita Knowledge Graph. Chapter Relationships Figure 2: Visualization of relationships between chapters. Philosophical Concepts Figure 3: Mapping of philosophical concepts within the Gita. User Interface Figure 4: Screenshot of the user interface for exploring the Knowledge Graph.

Note: The verse numbers are presented in chapter:verse format. Ranges (e.g., 16:1-3) indicate consecutive verses addressing the same topic.

Proposed Solution: RAG-Based Gita Enabled by Knowledge Graph

Benefits of Knowledge Graphs and MCTS

  1. Enhanced Analysis: Utilizing GNNs allows for deeper examination of the Gita's teachings and facilitates exploration of relationships between philosophical concepts.

  2. Problem-Solving Framework: The project aims to create mappings of common human problems addressed in the Gita, offering practical solutions based on authentic interpretations. GraphGita Overview

  3. Interactive Exploration: MCTS enables users to engage with the material dynamically, simulating various paths through the text.

  4. Scientific Contribution: This initiative merges ancient philosophy with modern computational techniques, contributing valuable Indic datasets for research in humanities and AI fields.

Technical Implementation

Tech Stack

Requirements

Installation

  1. Clone the repository:

    git clone https://github.com/bhaskatripathi/graphGita
    cd graphGita
    
  2. Install required packages:

    pip install boto3 requests pandas tqdm jsonschema
    
  3. Set up your AWS credentials for S3 and Textract services.

Key Functionalities

Example Outputs

The generated outputs are structured in JSON format. For example, a chapter summary might look like this:

{
    "summary": "Brief summary of the chapter",
    "main_theme": "The overarching theme of the chapter",
    "philosophical_aspects": ["List of key philosophical concepts addressed"],
    "life_problems_addressed": ["List of life problems or questions this chapter helps address"],
    "yoga_type": "The primary type of yoga discussed in this chapter"
}

Contributing

Contributions are welcome. Please submit a pull request or open an issue for any enhancements or bug fixes.

How to Cite

If you use graphGita in your research or project, please cite it as follows:

BibTeX Entry

@software{tripathi2024graphgita,
  author       = {Bhaskar Tripathi},
  title        = {graphGita: A Knowledge Graph Approach to Bhagavad Gita Interpretation},
  year         = 2024,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.14211453},
  url          = {https://doi.org/10.5281/zenodo.14211453}
}

Star History

Star History Chart

License

This project is licensed under the MIT License. See the LICENSE file for details.

Future Pipeline

  1. Create a Knowledge Graph based RAG on more than 200 Gita versions and find the overlaping philosophie, conflicting, and their relationships to the original Bhagwad Gita.
  2. Integrate more sophisticated retrieval technologies for multi-hop query improvements.
  3. Integrate below versions of popular Gita books: