Skip to content

SandaruRF/AI-Assisted-Graph-Generation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

VizGen โ€“ AI-Assisted Graph Generator

๐ŸŒ Natural Language to Visualization Platform powered by Multi-Agent AI.

VizGen is a cutting-edge AI-powered web application that allows users to generate intelligent, real-time graphs from natural language prompts. Designed for both technical and non-technical users, it supports seamless SQL database connections, automated chart recommendations, and deep data insight generation.


โœจ Key Features

  • ๐Ÿง  Text-to-Graph: Convert natural language queries into visual charts using advanced LLMs (Claude 3.7 Sonnet & Gemini 2.0 Flash).
  • ๐Ÿค– Multi-Agent Architecture: Specialized agents handle query generation, graph recommendation, insights, and explanation.
  • ๐Ÿ“Š AI-Driven Graph Recommendations: Suggests the best graph types based on data patterns and user intent.
  • โšก Real-Time Interaction: Connect live databases, auto-refresh graphs, and interact dynamically.
  • ๐Ÿงฉ Schema-Free Operation: Works with any SQL database without prior schema knowledge.
  • ๐Ÿ—ƒ๏ธ User Preferences & History: Stores connection settings and user feedback for personalized experiences.
  • ๐Ÿ” JWT-Based Authentication: Supports login, signup, and secure OAuth integration.
  • ๐ŸŽจ Interactive UI: Built with React, Material UI, and framer-motion for a smooth experience.

๐Ÿงฐ Tech Stack

๐Ÿ”ท Frontend

  • React.js + Material UI
  • framer-motion for animations
  • Plotly.js for graph rendering

๐Ÿ”ถ Backend

  • FastAPI (Python) with async support
  • LangChain, LangGraph, LangSmith
  • Claude 3.7 Sonnet, Gemini 2.0 Flash for LLM processing
  • MongoDB for dynamic data storage
  • SQLAlchemy, JWT, and OAuth2 for auth

๐Ÿ—๏ธ Multi-Agent System Architecture

VizGenโ€™s intelligent graph generation is powered by a modular multi-agent system:

  • ๐Ÿงฎ SQL Agent โ€“ Converts NL to SQL, manages query generation, dialect handling
  • ๐Ÿ“ˆ Visualization Agent โ€“ Classifies columns, calculates cardinality, maps chart types
  • ๐Ÿ“Š Analysis Agent โ€“ Detects patterns, performs forecasting and statistical insight generation
  • ๐Ÿ’ฌ Explanation Agent โ€“ Uses external search (Tavily API) and LLMs to explain insights
  • ๐Ÿง  Orchestrator โ€“ Coordinates all agents to process user queries and return optimal visualizations

Agents are designed using LangGraph workflows, allowing dynamic execution and adaptive reasoning.


๐Ÿงช Screenshots

Interface Description
SignUp Simple login/signup with email or Google/GitHub
Landing Landing page of VizGen
Landing SQL database connection using connection string
Landing SQL database connection using connection form
Landing Saved database connections
Prompt Enter natural language query to generate graph
Graph Real-time Plotly.js graph with customization tools

๐Ÿš€ Getting Started

1. Clone the Repository

git clone https://github.com/SandaruRF/AI-Assisted-Graph-Generation.git
cd VizGen

2. Backend Setup

cd backend
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload

3. Frontend Setup

cd frontend
npm install
npm start

๐Ÿ”‘ Environment Variables

๐Ÿ“ Backend โ€“ .env

Create a .env file in the backend/ directory with the following variables:

FRONTEND_URL=your_frontend_url

# API Keys
GOOGLE_API_KEY=your_google_api_key
TAVILY_API_KEY=your_tavily_api_key

# MongoDB Configuration
MONGO_URI=your_mongodb_connection_string
DATABASE_NAME=your_database_name

# Authentication
SECRET_KEY=your_jwt_secret

# Email Service (ClickSend)
CLICK_SEND_API=your_clicksend_api_key
CLICK_SEND_USERNAME=your_clicksend_username

# OAuth Credentials
GOOGLE_CLIENT_ID=your_google_oauth_id
GOOGLE_CLIENT_SECRET=your_google_secret
GITHUB_CLIENT_ID=your_github_oauth_id
GITHUB_CLIENT_SECRET=your_github_secret

๐Ÿ“ Frontend โ€“ .env

Create a .env file in the frontend/ directory with the following variables:

REACT_APP_BACKEND_URL=your_backend_url
REACT_APP_GOOGLE_CLIENT_ID=your_google_oauth_id
REACT_APP_GOOGLE_CLIENT_SECRET=your_google_secret
REACT_APP_GITHUB_CLIENT_ID=your_github_oauth_id

โš ๏ธ Note: All React environment variables must be prefixed with REACTAPP to be accessible in the frontend code.

โœ… Functional Highlights

  • Text-to-SQL query generation
  • Dynamic graph generation (Bar, Line, Pie, etc.)
  • Real-time interaction with live SQL databases
  • Interactive feedback loop to improve future recommendations

๐Ÿ“ฆ Deployment

  • Docker containers configured for both backend and frontend
  • Ready for deployment on AWS, GCP, or any containerized environment
  • CI/CD pipelines planned (GitHub Actions / Jenkins)

๐Ÿ›ฃ Roadmap

  • Support for NoSQL and CSV uploads
  • Admin dashboard for usage analytics
  • Public API access for integration

๐Ÿง  Contributors

Name
W. S. R. Fernando
K. A. I. N. Jayarathne
W. M. S. S. Abeysekara
S. Shanuja

๐Ÿ“œ License

This project is licensed under the MIT License โ€“ see the LICENSE file for details.


๐Ÿ“ฌ Contact

Special thanks to our mentors Prof. A.T.P. Thushari and Mr. Deshan Jayawardana, and Mitra Innovation for their support.


๐Ÿง  Citation

If you use VizGen in your research or academic work, please cite it as:

Fernando, W.S.R., Jayarathne, K.A.I.N., Abeysekara, W.M.S.S., & Shanuja, S. (2025).
VizGen โ€“ AI-Assisted Graph Generator. Department of Computational Mathematics, University of Moratuwa.

About

๐ŸŒ Natural Language to Visualization Platform powered by Multi-Agent AI.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •