Skip to content

DaveTron4/MythInformation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MythInformation Logo

πŸ•΅οΈβ€β™‚οΈ MythInformation

Bringing Lore and Order to the Multiverse.

An AI-powered "Story Detective" that transforms chaotic wiki articles and scripts into interactive 3D Galactic Knowledge Graphs. Extract characters and relationships with Gemini, predict relationship types with ML, and analyze patterns in Databricks.

Try it Here:

MythInformation Site

IMPORTANT: Backend is hosted on free-tier Render, so it times out after a while. Give a couple of minutes for the backend to start.

πŸ† Event

Hackathon Track

πŸ› οΈ Technologies

Python FastAPI React Three.js

Google Gemini Databricks Scikit-learn


πŸ› οΈ The Tech Stack

Layer Technologies
The Brain Python FastAPI Gemini LangChain
The ML Engine Scikit-learn Databricks MLflow
The Face React Vite Three.js Tailwind
The Graph NetworkX D3-Force

πŸš€ Key Features

  • User Authentication: Secure JWT-based register/login system with password hashing via bcrypt.
  • Persistent Analysis Storage: Save, load, and manage multiple lore analyses per user in PostgreSQL.
  • Multiversal Clustering: Characters are automatically grouped into "Solar Systems" based on their source work (e.g., FNAF 1 vs. FNAF 2).
  • Star Magnitude: Characters with more connections glow brighter and appear larger using Degree Centrality metrics.
  • Bridge Detection: Characters appearing in multiple works are rendered with Multi-Segment Segmented Coronas, visually showing their multiversal history.
  • AI Case Files: Click a node to decrypt a character's dossier, including an AI-generated biography and mission history, rendered with rich Markdown support.
  • πŸ€– ML Relationship Predictor: AI-powered relationship type prediction using Random Forest classifier (87.5% accuracy on 20 relationship types). When creating new connections, the system suggests the most likely relationship type with confidence scoring.
  • πŸ“Š Analytics Dashboard: Databricks SQL dashboards showing KPI metrics, character connectivity analysis, relationship type distribution, work comparisons, user activity timelines, and centrality distributions.
  • Fluid Physics Engine: Real-time collision detection and spring-forces create a "liquid" movement feel when adding new lore.
  • Procedural Starfield: A native 20,000-point 3D background for a cinematic immersive experience.

πŸ”§ Quick Start

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • Docker & Docker Compose
  • Google Gemini API key

Installation

  1. Clone & Setup Backend:

    cd backend
    python -m venv venv
    venv\Scripts\activate  # Windows
    pip install -r requirements.txt
  2. Setup Environment Variables:

    # backend/.env
    GEMINI_API_KEY=your_gemini_key_here
    
    # Optional: Databricks Analytics
    DATABRICKS_HOST=your_workspace_url
    DATABRICKS_HTTP_PATH=your_cluster_path
    DATABRICKS_TOKEN=your_pat_token
    DATABRICKS_CATALOG=lore_graph
    DATABRICKS_SCHEMA=analytics
    DATABASE_URL=postgresql://loreuser:lorepass@localhost:5432/loredb
    SECRET_KEY=your-secret-key-change-in-production
  3. Start PostgreSQL Docker Container:

    docker-compose up -d
  4. Run Backend Server:

    cd backend
    uvicorn main:app --reload
  5. Setup Frontend:

    cd frontend
    npm install
    npm run dev
  6. Access Application:


ML Relationship Predictions

  1. While editing: Click "Add Connection" under a character's dossier
  2. Select target: Choose another character from the dropdown
  3. View prediction: The AI suggests the relationship type with a confidence percentage
  4. Modify if needed: Accept the suggestion or choose a different relationship type
  5. Confirm: Click "Create Connection" to add it to your graph

Accessing the Analytics Dashboard

  1. Go to Databricks Workspace: Access your Databricks SQL Warehouse
  2. View SQL Queries: 6 pre-built queries available in the workspace
  3. Track Metrics: Monitor character connectivity, analysis trends, and graph growth over timeect Gutenberg by ID
  4. View the 3D Graph as characters and relationships materialize
  5. Click nodes to view character dossiers
  6. Delete systems by clicking the βœ• next to their name

Saving & Loading

  1. Click "πŸ’Ύ Save Analysis" after building your graph
  2. Name your analysis and add notes
  3. Click "πŸ“‚ Load Analysis" to browse your saved work
  4. Load an analysis to restore it and continue exploring

πŸ—„οΈ Database Schema

Users Table

  • id - UUID primary key
  • username - Unique username

Databricks Delta Lake Tables (Analytics)

  • lore_analyses - Analysis metadata synced from PostgreSQL (user_id, names, total_characters, total_relationships)
  • lore_characters - Character data with graph metrics (analysis_id, name, degree_centrality, work_source, description)
  • lore_relationships - Relationship data for analytics (analysis_id, source_id, target_id, relationship_type, work_source)
  • email - Unique email address
  • hashed_password - Bcrypt hash
  • created_at - Timestamp

Analyses Table

  • id - UUID primary key
  • user_id - Foreign key to users
  • name - Analysis title
  • description - User notes
  • nodes - JSON array of graph nodes
  • links - JSON array of graph edges
  • work_meta - JSON object with system metadata (colors, positions)
  • created_at, updated_at - Timestamps

βœ… What's Working

and custom scrollbars

  • βœ… NEW: ML Relationship Predictor with 87.5% accuracy on 20 relationship types
  • βœ… NEW: Databricks Analytics with Delta Lake table syncing and 6 SQL dashboard queries
  • βœ… NEW: Async/Non-blocking Backend - Databricks writes happen in background threads, API never hangs
  • βœ… Full 3D force-directed graph visualization with 20k-point starfield
  • βœ… Character extraction & relationship mapping via Google Gemini 2.5 Flash
  • βœ… Interactive node selection with smooth camera transitions
  • βœ… Rich character dossiers (showing ML predictions in action)
  • 🌐 Deployment (Backend to Render/Railway, Frontend to Vercel)
  • πŸ“± Mobile responsiveness (lower priority)
  • πŸ“Š Advanced analytics queries and visualization customization

Developed Solo in 36 Hours for Hacklytics 2026 - Entertainment Track *Featuring AI-powered lore extraction, graph visualization, and ML relationship prediction.

  • βœ… Cyberpunk UI with Tailwind theming
  • βœ… Comprehensive error handling and user feedback

🚧 Coming Next

  • 🎬 Demo video walkthrough
  • 🌐 Deployment (Backend to Render/Railway, Frontend to Vercel)
  • πŸ“± Mobile responsiveness (lower priority)
  • πŸ“Š Optional: Databricks integration for advanced analytics

Developed Solo in 36 Hours for Hacklytics 2026.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors