Skip to content

Unveiling the Mahabharata's Web: A Graph Journey using Neo4j and a building a gen-ai chatbot for exploring the Mahabharata

License

Notifications You must be signed in to change notification settings

sidagarwal04/mahabharata-genai

Repository files navigation

Introduction

Mahabharata Chatbot is a sophisticated chatbot designed to provide detailed insights and answer questions related to the epic Mahabharata. Leveraging advanced NLP techniques and deep learning models, the bot offers a unique interactive experience, bringing the ancient text to life.

Background

Have you ever been captivated by a story brimming with complex relationships? Stories like the Mahabharata, an ancient Indian epic, weave a spell with a multitude of characters and their intricate connections. These connections - familial bonds, alliances, rivalries - form the very foundation of the narrative, driving the plot and shaping the destinies of its heroes and villains.

It all began with a simple conversation. My wife, engrossed in C. Rajagopalachari's masterful translation of the Mahabharata, sparked my curiosity about the intricate web of relationships within the epic. The idea of translating these connections into a powerful graph model, leveraging the capabilities of Neo4j (a leader in Graph Database Industry), became an irresistible challenge.

alt text

This is when I decided to embark on a fascinating journey to explore the Mahabharata through the lens of graph theory. But this was just the first chapter in my journey. I then decided to unveil an ambitious step forward: a Neo4j-powered chatbot. This innovative tool stems from a desire to make the epic’s complex relationships accessible to everyone, transcending traditional query methods.

Read the three-part blog series on this project:

Read more about GraphRAG here: Building a GraphRAG application

Features

  • Contextual Understanding: Provides answers based on the context of the Mahabharata.
  • Interactive Q&A: Users can ask questions and get detailed answers.
  • Relationship Mapping: Visualizes and explains relationships between characters.
  • Deployment Ready: Easily deployable on platforms like Firebase.

Architecture

The Mahabharata Chatbot is built using:

  • Backend: Python, Google Vertex AI (Google Gemini API), Gradio
  • Frontend: Nuxt.js
  • Database: Neo4j
  • Deployment: Hugging Face Space, Firebase

Configuration

Environment Variables

Make sure to add following environment variables in your Hugging Face project and follow the instructions in setup.md file:

BOB
NEO4J_USERNAME
NEO4J_URI
NEO4J_PASSWORD
PROJECT_ID
LOCATION

Database Setup

  1. Start Neo4j Database: Follow the official Neo4j installation guide to set up your database.

  2. Load Data: Use provided scripts to load Mahabharata data into Neo4j.

Contributing

Do share your feedback here to make the Mahabharata chatbot the best resource for exploring this epic tale. I am welcoming contributions! Please follow these steps:

  • Fork the repository.
  • Create a new branch: git checkout -b feature/YourFeature
  • Make your changes and commit them: git commit -m 'Add some feature'.
  • Push to the branch: git push origin feature/YourFeature.
  • Create a pull request.

License

This project is licensed under the Apache License.

Acknowledgements

Special thanks to my friend, Vrijraj Singh for all his support in building web design for this app, LLM Graph Builder Tool for converting external PDF sources into Knowledge Graph and the open-source community for their valuable resources and support.

About

Unveiling the Mahabharata's Web: A Graph Journey using Neo4j and a building a gen-ai chatbot for exploring the Mahabharata

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published