Skip to content

Latest commit

 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 BiomedKG RAG Benchmark Suite

TigerGraph GraphRAG Inference Hackathon - Round 1 Submission

A production-grade, multi-pipeline benchmarking platform proving GraphRAG's superiority in token efficiency, latency, and accuracy over traditional vector-based RAG.

Python 3.11+ FastAPI Vanilla JS Docker

TigerGraph Groq Qdrant


BiomedKG Benchmark Dashboard

🏆 The Core Thesis

GraphRAG is fundamentally superior to vector-based Semantic RAG for complex, multi-hop reasoning tasks, especially in highly relational domains like Biomedicine.

To prove this definitively, we built an asynchronous three-pipeline benchmarking system. By querying a shared biomedical corpus, we fanned out exact queries to:

  1. Pipeline 1: LLM-Only Baseline (Zero-Shot via Groq)
  2. Pipeline 2: Basic RAG (Qdrant Vector DB + LlamaIndex + Groq)
  3. Pipeline 3: GraphRAG (TigerGraph Savanna SupportAI)

The Result: TigerGraph GraphRAG achieved a ~78% reduction in token usage and bypassed API rate limits entirely by utilizing structured graph traversal instead of stuffing massive, noisy text chunks into an LLM context window.


🏗️ Architecture Design

Our architecture adheres to Hexagonal Architecture principles, strictly isolating HTTP delivery, orchestration logic, and downstream pipeline execution. All services are fully containerized.

graph TD
    %% Styling
    classDef user fill:#e1f5fe,stroke:#0288d1,stroke-width:2px,color:#000
    classDef orchestrator fill:#fff3e0,stroke:#f57c00,stroke-width:2px,color:#000
    classDef pipeline fill:#e8f5e9,stroke:#388e3c,stroke-width:2px,color:#000
    classDef db fill:#fce4ec,stroke:#c2185b,stroke-width:2px,color:#000
    classDef llm fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#000
    classDef dashboard fill:#e0f2f1,stroke:#00796b,stroke-width:2px,color:#000

    %% Core Flow
    User[User / Judge]:::user --> |"UI Interaction"| Dash[Glassmorphic Dashboard]:::dashboard
    Dash --> |POST /v1/ask| Orch[FastAPI Orchestrator]:::orchestrator

    %% Parallel Fan-Out
    Orch --> |Asyncio Gather| P1[Pipeline 1: LLM-Only]:::pipeline
    Orch --> |Asyncio Gather| P2[Pipeline 2: Basic RAG]:::pipeline
    Orch --> |Asyncio Gather| P3[Pipeline 3: GraphRAG]:::pipeline

    %% Downstream Services
    P1 --> |Direct Prompt| Groq1[Groq API]:::llm
    
    P2 --> |1. Semantic Search| Qdrant[(Qdrant Vector DB)]:::db
    P2 --> |2. Context Prompt| Groq2[Groq API]:::llm
    
    P3 --> |1. Entity Extraction| TG[(TigerGraph SupportAI)]:::db
    TG --> |2. Graph Traversal| GraphLogic{GSQL Graph Logic}
    GraphLogic --> |3. Synthesize| LLM3[Internal LLM]:::llm
Loading

📊 Empirical Benchmark Results

We ran highly complex biomedical queries (e.g., "How does Alzheimer's disease affect acetylcholine neurotransmission?") across the suite.

Metric Pipeline 1 (LLM-Only) Pipeline 2 (Basic RAG) Pipeline 3 (GraphRAG)
Token Usage ~316 tokens ~1,340 tokens (Bloated) ~287 tokens (Efficient)
Cost (USD) ~$0.000125 ~$0.000246 $0.000000 (Managed)
Accuracy (Multi-hop) Hallucination Risk Frequent "Not enough info" Precise & Relational

Conclusion: Basic RAG relies on text chunks ranking highly in vector space. If a gene name isn't semantically close to a disease name, Qdrant fails to retrieve the critical chunk. GraphRAG circumvents semantic limitations entirely by walking deterministic graph edges (e.g., Disease → ASSOCIATED_WITH → Gene), returning 100% accurate context with a massive token discount.


🚀 Quick Start & Deployment Guide

This project is built for immediate, reproducible deployment using Docker Compose.

1. Prerequisites

  • Docker Desktop & Docker Compose
  • TigerGraph Savanna Workspace Credentials
  • Groq API Key
  • Qdrant Cloud Cluster Key

2. Environment Configuration

Clone the repository and set up your environment variables:

git clone https://github.com/your-username/Graph-RAG.git
cd Graph-RAG
cp .env.example .env

Edit .env to insert your active API keys.

3. Local Deployment (Docker)

We use Docker Compose to spin up the entire orchestrated fleet:

cd infra
docker compose up -d --build

4. Cloud Deployment Strategy

For production deployment, the architecture naturally fits a microservices paradigm:

  • Frontend Dashboard: Deployable as a static site via Vercel, Netlify, or AWS Amplify.
  • FastAPI Backend Services: (Orchestrator, LLM-Only, Basic RAG) can be deployed via Railway, Render, or an AWS EC2 / DigitalOcean Droplet utilizing the provided docker-compose.yml.
  • Database Layer: TigerGraph is natively hosted on tgcloud.io (Savanna), and Qdrant is hosted on Qdrant Cloud.

5. Access the Platform

Navigate to http://localhost:3000 (or your mapped dashboard port) to view the live side-by-side benchmarking UI.


📂 Repository Structure

Graph-RAG/
├── dashboard/               # Premium glassmorphic UI (Vanilla JS + CSS)
├── infra/                   # Docker Compose, networking, Nginx configs
├── scripts/                 # Automated data ingestion & test scripts
└── services/
    ├── orchestrator/        # FastAPI async fan-out & cost calculator
    ├── llm-only/            # Pipeline 1: Zero-shot baseline
    └── basic-rag/           # Pipeline 2: Qdrant vector retrieval


Built with ❤️ for the TigerGraph GraphRAG Inference Hackathon.

About

BiomedKG RAG Benchmark Suite

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages