May 6, 2025
Mapping Mythology with GenAI: Building a Mahabharata Chatbot Using GraphRAG
Dive into a Mahabharata chatbot built with GraphRAG & Neo4j! GenAI meets epic data to deliver smart, contextual answers rooted in India’s greatest story.
Author


Book a call
Table of Contents
Editor’s Note: This blog is adapted from the talk by Siddhant Agarwal, Developer Relations lead for APAC at Neo4j. In this session, he shared how he combined GenAI, graph theory, and ancient Indian epics to create a knowledge-rich chatbot powered by Neo4j and GraphRAG—bringing the Mahabharata to life through data, relationships, and intelligent querying.
From Graphs to Epics: Where It All Began
I wanted to answer a simple question: What happens when Generative AI meets one of the most complex stories ever told—the Mahabharata?
Why Mahabharata? Because It’s a Network
I started by manually mapping out nodes (characters) and edges (relationships). Using Cypher, Neo4j’s query language, I created 191 nodes and over 500 connections, each with meaningful metadata—names, roles, relationships, and more. But this was just the foundation.
Phase Two: Bringing the Epic to Life
That version worked for conferences. But when someone asked, “Can it answer contextual questions too?”, I realized it needed to do more. I had only scratched the surface of what was possible.
Scaling the Dataset: 18 Books, 5,400 Pages, 10 M+ Characters
Handling this volume with standard GenAI approaches would be expensive and inefficient. That’s when I turned to Vector RAG.
Beyond Vector Search: Enter GraphRAG
Neo4j’s LLM Graph Builder Tool made this seamless. I connected it to my instance, uploaded the PDFs, and the tool did the rest—no code, no APIs, no stress. The result: over 51,000 nodes and 500,000 relationships, all extracted from raw text and visually explorable in Neo4j.
The Chatbot, Reimagined
Even better, the tool allowed me to test different LLMs, customize chunking parameters, handle orphan nodes, de-duplicate overlapping entities (e.g., “Bangalore” vs. “BLR”), and add post-processing layers like community detection.
Full Control, Full Flexibility
Neo4j also remains schema-flexible. You can dynamically modify or generate schemas as your data evolves—ideal for anyone building domain-specific graph applications.
What’s Next: Multilingual and Mixed Reality
This journey—from ancient epics to GenAI, from static data to dynamic intelligence—has only just begun.
Subscribe to Our Newsletter
Subscribe to RSS
Press & Media Hub RSS FeedRelated Articles.
More from the engineering frontline.
Dive deep into our research and insights on design, development, and the impact of various trends to businesses.

May 11, 2026
From MVP to Scale: Designing Architecture for AI-First Products

May 7, 2026
The AI native Enterprise Evolution | Saurabh Sahu

May 5, 2026
The Next Era of AI Builders: Building Autonomous Systems for Frontier Firms — Pallavi Lokesh Shetty

May 5, 2026
The Autonomous Factory: Architecting Agentic Workflows with Clean Code Guards | Akash Kamerkar

May 4, 2026
OpenClaw: Build Your Autonomous Assistant | Deepak Chawla

May 4, 2026