π GraphRAG Inference Hackathon β Dual Pipeline System
Proving that graphs make LLM inference faster, cheaper, and smarter β with real numbers.
Web Dashboard Β· Architecture Β· Benchmarks Β· Novelties Β· Design System
π― Overview
A production-ready dual-pipeline GraphRAG system with two interfaces:
| Next.js Web Dashboard | Python CLI + Gradio | |
|---|---|---|
| LLM | Claude Sonnet 4 (Anthropic) | GPT-4o-mini (OpenAI) |
| Frontend | React 19 + Recharts + Custom SVG | Gradio 6.x + Plotly |
| Design | TigerGraph Γ Claude fused design system | Standard Gradio |
| Best for | Demos, presentations, judging | Benchmarking, batch eval |
Both interfaces run the same dual-pipeline comparison:
| Pipeline A: Baseline RAG | Pipeline B: GraphRAG | |
|---|---|---|
| Flow | Query β Vector Search β Top-K β LLM | Query β Keywords β Entity Search β Graph Traversal β LLM |
| Wins on | Speed, cost, simple queries | Accuracy on complex multi-hop queries (+21% F1) |
ποΈ Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LAYER 4: EVALUATION β RAGAS + F1/EM + Cost/Token Tracking β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β LAYER 3: LLM β Claude Sonnet 4 Β· Entity/Keyword Extraction β
ββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ€
β Pipeline A: Baseline β Pipeline B: GraphRAG β
β QueryβVectorβLLM β QueryβKeywordsβGraphβContextβLLM β
β β π§ Adaptive Router β
ββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββ€
β LAYER 1: GRAPH β TigerGraph Cloud Β· GSQL Β· Multi-hop BFS β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Novel Features
- π§ Adaptive Query Router β Automatically routes simple queries to baseline (cheaper) and complex ones to GraphRAG (more accurate)
- π Schema-Bounded Extraction β Pre-defined 9 entity types + 15 relation types (~90% cheaper, ~16% more accurate)
- π Dual-Level Keywords β LightRAG-inspired high-level + low-level keyword routing
- π Graph Reasoning Paths β Step-by-step natural language explanation of graph traversal
- π Real-Time Cost Tracking β Every LLM call tracked with tokens, cost, and latency
π₯οΈ Web Dashboard (Next.js)
The flagship interface β a polished React app with the TigerGraph Γ Claude fused design system.
Quick Start
cd web
npm install
cp .env.example .env.local
# Add your Anthropic API key: ANTHROPIC_API_KEY=sk-ant-...
npm run dev
# Open http://localhost:3000
4 Tabs
| Tab | What It Does |
|---|---|
| π΄ Live Compare | Side-by-side answers from both pipelines with real-time metrics, adaptive routing badges, entity/relation display |
| π Benchmark | Radar charts, bar charts, detailed comparison table with HotpotQA results |
| π° Cost Analysis | Interactive cost projections across 4 LLM models, cumulative cost area charts, ROI analysis |
| πΈοΈ Graph Explorer | Interactive SVG knowledge graph with clickable nodes, reasoning path explanation, graph statistics |
Tech Stack
| Layer | Technology |
|---|---|
| Framework | Next.js 15 (App Router) |
| React | React 19 |
| LLM | Claude Sonnet 4 via @anthropic-ai/sdk |
| Charts | Recharts 2.15 |
| Graph Viz | Custom SVG with interaction |
| Styling | Tailwind CSS 4 + 14KB custom design system |
| Fonts | Cormorant Garamond (serif display) + Inter (sans body) + JetBrains Mono (code) |
π¨ Design System
The web dashboard uses a fused design system combining:
- TigerGraph: Orange
#FF6B00(energy, CTAs), Navy#002B49(authority, text), Electric Blue#0072CE(baseline pipeline) - Claude/Anthropic: Cream canvas
#faf9f5(warmth), Coral#cc785c(intelligence), Dark surfaces#181715(product chrome)
Key Principles
- Warm cream canvas (never cold white) β the Claude editorial feel
- Serif display headlines (Cormorant Garamond, weight 400, negative tracking) β literary voice
- Tiger Orange for primary CTAs β energy and action
- Dark surface code windows for architecture diagrams β product chrome
- Cream β Dark alternating section rhythm
π Python Backend + Gradio
The Python backend handles benchmarking, TigerGraph ingestion, and batch evaluation.
Quick Start
pip install -r requirements.txt
cp .env.example .env
# Add: OPENAI_API_KEY=sk-...
python -m graphrag.main dashboard # Gradio UI on :7860
python -m graphrag.main demo # CLI demo
python -m graphrag.main benchmark --samples 50
python -m graphrag.main ingest --samples 100 # Requires TigerGraph
π Benchmark Results
HotpotQA (Distractor Setting, 100 samples)
| Metric | Baseline RAG | GraphRAG | Winner |
|---|---|---|---|
| Avg F1 | 0.5523 | 0.6241 | β GraphRAG (+13%) |
| Avg EM | 0.3810 | 0.4230 | β GraphRAG (+11%) |
| Context Hit | 0.4520 | 0.5830 | β GraphRAG (+29%) |
| Tokens/Query | 952 | 2,387 | β Baseline (2.5Γ) |
| Cost/Query | $0.000203 | $0.000518 | β Baseline (2.6Γ) |
By Question Type
| Type | Baseline F1 | GraphRAG F1 | Ξ |
|---|---|---|---|
| Bridge | 0.52 | 0.63 | +21% |
| Comparison | 0.58 | 0.61 | +5% |
π Project Structure
graphrag-inference-hackathon/
βββ web/ # Next.js Web Dashboard
β βββ src/app/
β β βββ page.tsx # Main page
β β βββ layout.tsx # Root layout
β β βββ globals.css # 14KB fused design system
β β βββ api/compare/route.ts # Claude-powered API
β βββ src/components/
β β βββ Navbar.tsx # TigerGraphΓClaude navbar
β β βββ Hero.tsx # Editorial hero with stats
β β βββ DashboardTabs.tsx # Tab controller
β β βββ Footer.tsx # Dark footer
β β βββ tabs/
β β βββ LiveCompare.tsx # Tab 1: Side-by-side comparison
β β βββ Benchmark.tsx # Tab 2: Radar + bar charts
β β βββ CostAnalysis.tsx # Tab 3: Cost projections
β β βββ GraphExplorer.tsx # Tab 4: Interactive graph viz
β βββ src/lib/design-tokens.ts # Color + typography tokens
β
βββ graphrag/ # Python Backend
β βββ layers/
β β βββ graph_layer.py # Layer 1: TigerGraph
β β βββ orchestration_layer.py # Layer 2: Dual pipeline
β β βββ llm_layer.py # Layer 3: LLM
β β βββ evaluation_layer.py # Layer 4: Evaluation
β βββ dashboard.py # Gradio dashboard
β βββ benchmark.py # Batch benchmark runner
β βββ ingestion.py # Document ingestion
β βββ main.py # CLI entry point
β
βββ requirements.txt # Python dependencies
βββ README.md
π References
Papers
- GraphRAG β From Local to Global Graph RAG
- LightRAG β Simple and Fast RAG (34Kβ)
- HotpotQA β Multi-hop QA Dataset
- RAGAS β RAG Evaluation Framework
- Youtu-GraphRAG β Schema-Bounded Extraction
Tools
TigerGraph Β· Anthropic Claude Β· Next.js Β· Recharts Β· RAGAS Β· HotpotQA
Built for the GraphRAG Inference Hackathon by TigerGraph π§‘
TigerGraph Γ Claude Β· Next.js 15 Β· Recharts Β· RAGAS