An open API service indexing awesome lists of open source software.

https://github.com/ajitonelsonn/medgraph-navigator

πŸ† Submission for https://arangodbhackathon.devpost.com
https://github.com/ajitonelsonn/medgraph-navigator

ai arangodb hackathon healthcare langchain llm llma nextjs

Last synced: 4 months ago
JSON representation

πŸ† Submission for https://arangodbhackathon.devpost.com

Awesome Lists containing this project

README

        

# MedGraph Navigator πŸ₯

ArangoDB
React
Together AI

Next.js
License


Patient Journey & Risk Analytics Platform powered by GraphRAG

A comprehensive healthcare analytics platform built for the [ArangoDB Hackathon: Building the Next-Gen Agentic App with GraphRAG & NVIDIA cuGraph](https://arangodbhackathon.devpost.com/).

[![MedGraph Navigator Demo](/public/ss_home.png)](https://medgraph-navigator.onrender.com)

## πŸš€ Live Demo

Experience MedGraph Navigator live: [https://medgraph-navigator.onrender.com](https://medgraph-navigator.onrender.com)

## πŸ” Overview

MedGraph Navigator is a next-generation healthcare analytics platform that harnesses the power of graph databases and large language models (LLMs) to provide medical professionals with deep, actionable insights into patient data. Built on ArangoDB’s advanced graph capabilities and enhanced with GraphRAG (Graph-based Retrieval Augmented Generation) technology, MedGraph Navigator revolutionizes healthcare analytics by enabling:

- Natural language querying of complex medical data
- Visual exploration of patient journeys through medical systems
- Risk factor identification and analysis
- Discovery of treatment patterns and outcomes
- Comprehensive healthcare analytics dashboards

## ✨ Key Features

- **Natural Language Query Interface** - Query the medical database using everyday language
- **Patient Explorer** - Visualize and analyze individual patient journeys
- **Analytics Dashboard** - Comprehensive visualizations of healthcare metrics
- **Intent Detection** - AI-powered understanding of query intent
- **GraphRAG Implementation** - Combines graph traversal with LLM reasoning

## πŸ› οΈ Technology Stack

- **Frontend**: Next.js 15, React 19, TailwindCSS, Recharts
- **Backend**: Next.js API Routes
- **Database**: ArangoDB Graph Database
- **AI/ML**: LangChain, Together AI (Llama 3.2)
- **Deployment**: Render.com

## πŸ—οΈ System Architecture

MedGraph Navigator follows a modern, layered architecture:

```mermaid
graph TB
User([πŸ‘€ User]) --> NextApp[["βš›οΈ Next.js App"]]

subgraph "Frontend Layer"
NextApp --> Pages["πŸ“„ Pages"]
NextApp --> Components["🧩 UI Components"]
end

subgraph "API Layer"
NextApp --> APIRoutes["πŸ”Œ API Routes"]
APIRoutes --> QueryAPI["πŸ” Query API"]
APIRoutes --> PatientAPI["πŸ‘¨β€βš•οΈ Patient API"]
APIRoutes --> AnalyticsAPI["πŸ“Š Analytics API"]
end

subgraph "Integration Layer"
QueryAPI --> LangChain["🦜️ LangChain"]
LangChain --> TogetherAI["πŸ€– Together AI"]
APIRoutes --> ArangoClient["πŸ“¦ ArangoDB Client"]
end

subgraph "Data Layer"
ArangoClient --> ArangoDB[("πŸ—„οΈ ArangoDB")]
ArangoDB --> MedicalData["πŸ’Š Medical Graph Data"]
end

classDef frontend fill:#d6e4ff,stroke:#9cb2eb,stroke-width:1px;
classDef api fill:#ffe6cc,stroke:#d79b00,stroke-width:1px;
classDef integration fill:#d5e8d4,stroke:#82b366,stroke-width:1px;
classDef database fill:#e1d5e7,stroke:#9673a6,stroke-width:1px;

class Pages,Components,NextApp frontend;
class APIRoutes,QueryAPI,PatientAPI,AnalyticsAPI api;
class LangChain,TogetherAI,ArangoClient integration;
class ArangoDB,MedicalData database;
```

## πŸ”§ Installation & Setup

### Prerequisites

- Node.js 18+ and npm
- ArangoDB 3.10+
- Together AI API key

### Local Development

1. Clone the repository:

```bash
git clone https://github.com/ajitonelsonn/medgraph-navigator.git
cd medgraph-navigator
```

2. Install dependencies:

```bash
npm install
```

3. Set up environment variables:

```bash
cp .env.example .env.local
```

Edit `.env.local` and add your ArangoDB and Together AI credentials.

4. Prepare your ArangoDB database:

- Follow the setup instructions in the [H_ArngoDB repository](https://github.com/ajitonelsonn/H_ArngoDB) to load the Synthea medical dataset

5. Run the development server:

```bash
npm run dev
```

6. Open [http://localhost:3000](http://localhost:3000) in your browser

### Production Deployment

For production deployment to Render.com:

1. Fork this repository
2. Create a new Web Service on Render
3. Link your GitHub repository
4. Configure environment variables
5. Deploy!

## πŸ“Š Usage Examples

### Querying the Medical Database

MedGraph Navigator allows natural language queries against the medical database:

- "How many patients have the race 'white'?"
- "List 10 patients with their birthdates and genders"
- "What is the most common race among patients?"
- "Show me patients born in 2016"

### Analytics Dashboards

The Analytics section provides comprehensive healthcare insights:

- Demographics analysis
- Condition prevalence and trends
- Medication usage patterns
- Treatment outcomes

## πŸ“ Project Structure

```
medgraph-navigator/
β”œβ”€β”€ app/ # Next.js app directory
β”‚ β”œβ”€β”€ analytics/ # Analytics dashboard
β”‚ β”œβ”€β”€ api/ # API routes
β”‚ β”œβ”€β”€ components/ # Shared components
β”‚ β”œβ”€β”€ patients/ # Patient explorer
β”‚ β”œβ”€β”€ query/ # Query interface
β”‚ └── utils/ # Utility functions
β”œβ”€β”€ public/ # Static assets
β”œβ”€β”€ styles/ # Global styles
β”œβ”€β”€ next.config.js # Next.js configuration
└── package.json # Project dependencies
```

## πŸ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## πŸ‘ Acknowledgments

- [ArangoDB](https://www.arangodb.com/) for the powerful graph database
- [NVIDIA Rapids cuGraph](https://github.com/rapidsai/cugraph) for GPU-accelerated graph analytics
- [Synthea](https://synthea.mitre.org/) for the synthetic healthcare dataset
- [Together AI](https://together.ai/) for the LLM infrastructure
- [ArangoDB Hackathon](https://arangodbhackathon.devpost.com/) for the inspiration

## πŸ“¬ Contact

For questions or feedback, please reach out via GitHub Issues or contact:

- GitHub: [@ajitonelsonn](https://github.com/ajitonelsonn)

---

Made with ❀️ in Timor-Leste πŸ‡ΉπŸ‡±