Final README update with Docker deployment, test instructions, live benchmark, provider selector docs
Browse files
README.md
CHANGED
|
@@ -7,331 +7,236 @@
|
|
| 7 |
[](#-openclaw-integration)
|
| 8 |
[](#-ollama-local-models)
|
| 9 |
[](https://nextjs.org/)
|
| 10 |
-
[ β Multi-hop QA Dataset
|
| 330 |
-
7. [RAGAS](https://arxiv.org/abs/2309.15217) β RAG Evaluation Framework
|
| 331 |
-
8. [Youtu-GraphRAG](https://arxiv.org/abs/2508.19855) β Schema-Bounded Extraction
|
| 332 |
|
| 333 |
-
|
| 334 |
-
[TigerGraph](https://tgcloud.io) Β· [Anthropic](https://anthropic.com) Β· [OpenAI](https://openai.com) Β· [Ollama](https://ollama.ai) Β· [Groq](https://groq.com) Β· [OpenRouter](https://openrouter.ai) Β· [LiteLLM](https://litellm.ai) Β· [Next.js](https://nextjs.org) Β· [Recharts](https://recharts.org) Β· [RAGAS](https://ragas.io)
|
| 335 |
|
| 336 |
---
|
| 337 |
|
|
@@ -339,8 +244,6 @@ graphrag-inference-hackathon/
|
|
| 339 |
|
| 340 |
### π Built for the GraphRAG Inference Hackathon by TigerGraph
|
| 341 |
|
| 342 |
-
**12 LLM Providers** Β· **OpenClaw Agent** Β· **Ollama Local** Β· **TigerGraph** Β· **Next.js 15**
|
| 343 |
-
|
| 344 |
-
*Proving that graphs make LLM inference faster, cheaper, and smarter β with any LLM.*
|
| 345 |
|
| 346 |
</div>
|
|
|
|
| 7 |
[](#-openclaw-integration)
|
| 8 |
[](#-ollama-local-models)
|
| 9 |
[](https://nextjs.org/)
|
| 10 |
+
[](#-testing)
|
| 11 |
|
| 12 |
+
**Proving that graphs make LLM inference faster, cheaper, and smarter β with any LLM provider.**
|
|
|
|
| 13 |
|
| 14 |
+
[Quick Start](#-quick-start) Β· [12 Providers](#-supported-llm-providers) Β· [OpenClaw](#-openclaw-integration) Β· [Architecture](#-architecture) Β· [Benchmarks](#-benchmarks) Β· [Deploy](#-deployment)
|
| 15 |
|
| 16 |
</div>
|
| 17 |
|
| 18 |
---
|
| 19 |
|
| 20 |
+
## π Quick Start
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
### Option A: Next.js Dashboard (Recommended)
|
| 23 |
```bash
|
| 24 |
+
cd web
|
| 25 |
+
npm install
|
| 26 |
+
cp .env.example .env.local
|
| 27 |
+
# Set ANY provider key β or just use Ollama for free:
|
| 28 |
+
npm run dev
|
| 29 |
+
# β http://localhost:3000
|
| 30 |
```
|
| 31 |
|
| 32 |
+
### Option B: Docker (One Command)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
```bash
|
| 34 |
+
docker build -t graphrag .
|
| 35 |
+
docker run -p 3000:3000 -e ANTHROPIC_API_KEY=sk-ant-... graphrag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
```
|
| 37 |
|
| 38 |
+
### Option C: Python CLI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
```bash
|
| 40 |
+
pip install -r requirements.txt
|
| 41 |
+
python -m graphrag.main demo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
```
|
| 43 |
|
| 44 |
+
### Option D: Ollama (100% Free, Local)
|
| 45 |
+
```bash
|
| 46 |
+
ollama pull llama3.2
|
| 47 |
+
cd web && npm install && npm run dev
|
| 48 |
+
# Select "Ollama (Local)" in provider dropdown
|
| 49 |
+
```
|
|
|
|
| 50 |
|
| 51 |
---
|
| 52 |
|
| 53 |
+
## ποΈ Architecture (AI Factory Model β 4 Layers)
|
| 54 |
|
| 55 |
```
|
| 56 |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 57 |
+
β LAYER 4: EVALUATION β
|
| 58 |
+
β Next.js Dashboard β RAGAS β F1/EM β Cost Tracking β Live Benchmark β
|
| 59 |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
| 60 |
+
β LAYER 3: UNIVERSAL LLM (12 Providers) β
|
| 61 |
+
β OpenAI β Claude β Gemini β Mistral β Ollama β Groq β DeepSeek β β¦ β
|
|
|
|
| 62 |
ββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββ€
|
| 63 |
β Pipeline A: Baseline RAG β Pipeline B: GraphRAG β
|
| 64 |
β Query β Vector β LLM β Query β Keywords β Graph β Context β LLM β
|
| 65 |
β β π§ Adaptive Router β π Reasoning Paths β
|
| 66 |
ββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββ€
|
| 67 |
+
β LAYER 1: GRAPH (TigerGraph Cloud) β
|
| 68 |
β Schema: Document β Chunk β Entity β Community β
|
| 69 |
+
β GSQL: vectorSearchChunks β vectorSearchEntities β graphRAGTraverse β
|
| 70 |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 71 |
```
|
| 72 |
|
| 73 |
+
**Each layer is a separate module** β swap TigerGraph for Neo4j, Claude for Ollama, or RAGAS for custom evals without touching other layers.
|
| 74 |
+
|
| 75 |
+
---
|
| 76 |
+
|
| 77 |
+
## π€ Supported LLM Providers
|
| 78 |
+
|
| 79 |
+
| # | Provider | Default Model | Cost/1K tokens | Speed |
|
| 80 |
+
|---|----------|---------------|----------------|-------|
|
| 81 |
+
| 1 | **OpenAI** | gpt-4o-mini | $0.00015 in / $0.0006 out | β‘ Fast |
|
| 82 |
+
| 2 | **Anthropic Claude** | claude-sonnet-4 | $0.003 / $0.015 | π΅ Medium |
|
| 83 |
+
| 3 | **Google Gemini** | gemini-2.0-flash | $0.0001 / $0.0004 | β‘ Fast |
|
| 84 |
+
| 4 | **Mistral AI** | mistral-large | $0.002 / $0.006 | π΅ Medium |
|
| 85 |
+
| 5 | **Cohere** | command-r-plus | $0.0025 / $0.01 | π΅ Medium |
|
| 86 |
+
| 6 | **π¦ Ollama** | llama3.2 | **$0 / $0** | β‘ Local |
|
| 87 |
+
| 7 | **OpenRouter** | llama-3.3-70b | $0.0004 / $0.0004 | π΅ Medium |
|
| 88 |
+
| 8 | **Groq** | llama-3.3-70b | $0.0006 / $0.0008 | β‘β‘ Blazing |
|
| 89 |
+
| 9 | **xAI Grok** | grok-3-mini | $0.0003 / $0.0005 | β‘ Fast |
|
| 90 |
+
| 10 | **Together AI** | llama-3.1-70b | $0.0009 / $0.0009 | β‘ Fast |
|
| 91 |
+
| 11 | **HuggingFace** | llama-3.3-70b | **$0 / $0** | π΅ Medium |
|
| 92 |
+
| 12 | **DeepSeek** | deepseek-chat | $0.00014 / $0.00028 | β‘ Fast |
|
| 93 |
+
|
| 94 |
+
**How:** All providers use OpenAI SDK with dynamic `baseURL` β zero extra dependencies. Switch providers from the **dropdown in the dashboard UI**.
|
| 95 |
+
|
| 96 |
---
|
| 97 |
|
| 98 |
## π Novel Features
|
| 99 |
|
| 100 |
+
1. **π§ Adaptive Query Router** β complexity scoring β auto pipeline selection
|
| 101 |
+
2. **π Schema-Bounded Extraction** β 9 entity types + 15 relation types
|
| 102 |
+
3. **π Dual-Level Keywords** β LightRAG-inspired high/low-level retrieval
|
| 103 |
+
4. **π Graph Reasoning Paths** β step-by-step NL traversal explanation
|
| 104 |
+
5. **π€ 12-Provider Universal LLM** β including free Ollama local
|
| 105 |
+
6. **π¦ OpenClaw Agent Skills** β GraphRAG as autonomous agent capabilities
|
| 106 |
+
7. **π Live Benchmark Button** β run real evaluations from the dashboard
|
| 107 |
+
8. **π° 12-Provider Cost Comparison** β real-time projections
|
| 108 |
|
| 109 |
---
|
| 110 |
|
| 111 |
+
## π Benchmarks
|
| 112 |
|
| 113 |
+
### Live Benchmark (Run from Dashboard)
|
| 114 |
+
Click **"π Run Benchmark Now"** in the Benchmark tab to evaluate both pipelines on 10 HotpotQA questions with your configured provider. Results populate real-time with F1, EM, token counts, costs.
|
| 115 |
|
| 116 |
+
### Expected Results (HotpotQA)
|
| 117 |
+
| Metric | Baseline RAG | GraphRAG | Winner |
|
| 118 |
+
|--------|-------------|----------|--------|
|
| 119 |
+
| **F1 Score** | ~0.45β0.60 | ~0.55β0.70 | β
GraphRAG |
|
| 120 |
+
| **Exact Match** | ~0.30β0.45 | ~0.35β0.50 | β
GraphRAG |
|
| 121 |
+
| **Tokens/Query** | ~800β1000 | ~2000β2800 | β
Baseline |
|
| 122 |
+
| **F1 Win Rate** | β | ~55β70% | β
GraphRAG |
|
| 123 |
+
|
| 124 |
+
> **Key Finding:** GraphRAG consistently outperforms baseline on multi-hop questions (bridge type) where connecting facts across documents is required. The token overhead is 2β3Γ, but the Adaptive Router eliminates this cost for simple queries.
|
| 125 |
+
|
| 126 |
+
---
|
| 127 |
+
|
| 128 |
+
## π¦ OpenClaw Integration
|
| 129 |
|
| 130 |
+
Full CIK model (Capability + Identity + Knowledge):
|
| 131 |
+
|
| 132 |
+
| File | Purpose |
|
| 133 |
+
|------|---------|
|
| 134 |
+
| `openclaw/SOUL.md` | Agent identity, values, personality |
|
| 135 |
+
| `openclaw/IDENTITY.md` | Configuration, supported providers |
|
| 136 |
+
| `openclaw/MEMORY.md` | Learned facts about GraphRAG |
|
| 137 |
+
| `openclaw/skills/graph_query/` | NL β knowledge graph traversal |
|
| 138 |
+
| `openclaw/skills/compare_pipelines/` | Dual-pipeline comparison |
|
| 139 |
+
| `openclaw/skills/cost_estimate/` | 12-provider cost projection |
|
| 140 |
+
|
| 141 |
+
---
|
| 142 |
+
|
| 143 |
+
## π§ͺ Testing
|
| 144 |
|
| 145 |
```bash
|
| 146 |
+
# Run all 31 unit tests
|
| 147 |
+
python tests/test_core.py
|
| 148 |
+
|
| 149 |
+
# Tests cover:
|
| 150 |
+
# - cosine_similarity (5 cases including edge cases)
|
| 151 |
+
# - chunk_text (4 cases: basic, empty, short, overlap)
|
| 152 |
+
# - entity ID generation (3 cases: deterministic, case-insensitive, type-different)
|
| 153 |
+
# - F1/EM computation (5 cases: perfect, partial, no overlap, empty)
|
| 154 |
+
# - context hit rate (2 cases)
|
| 155 |
+
# - token efficiency (3 cases)
|
| 156 |
+
# - provider registry (4 cases: completeness, fields, ollama free, available)
|
| 157 |
+
# - evaluation layer aggregate + report (2 cases)
|
| 158 |
```
|
| 159 |
|
| 160 |
---
|
| 161 |
|
| 162 |
+
## π³ Deployment
|
| 163 |
|
| 164 |
+
### Docker
|
| 165 |
+
```bash
|
| 166 |
+
docker build -t graphrag .
|
| 167 |
+
docker run -p 3000:3000 \
|
| 168 |
+
-e ANTHROPIC_API_KEY=sk-ant-... \
|
| 169 |
+
-e OPENAI_API_KEY=sk-... \
|
| 170 |
+
graphrag
|
| 171 |
+
```
|
| 172 |
|
| 173 |
+
### Vercel
|
| 174 |
+
```bash
|
| 175 |
+
cd web
|
| 176 |
+
npx vercel --prod
|
| 177 |
+
```
|
| 178 |
+
|
| 179 |
+
### Env Variables
|
| 180 |
+
```bash
|
| 181 |
+
# Set any/all β system auto-detects available providers
|
| 182 |
+
ANTHROPIC_API_KEY=sk-ant-... # Claude
|
| 183 |
+
OPENAI_API_KEY=sk-... # GPT-4o
|
| 184 |
+
GEMINI_API_KEY=AIza... # Gemini
|
| 185 |
+
GROQ_API_KEY=gsk_... # Groq (ultra-fast)
|
| 186 |
+
DEEPSEEK_API_KEY=sk-... # DeepSeek (cheapest)
|
| 187 |
+
# Or: ollama pull llama3.2 # Free, local
|
| 188 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
|
| 190 |
---
|
| 191 |
|
| 192 |
+
## π Project Structure (68 files, 240KB)
|
| 193 |
|
| 194 |
```
|
| 195 |
+
βββ web/ # Next.js 15 Dashboard
|
| 196 |
+
β βββ src/app/
|
| 197 |
+
β β βββ globals.css # 14KB fused TigerGraphΓClaude design system
|
| 198 |
+
β β βββ api/
|
| 199 |
+
β β βββ compare/route.ts # Multi-provider dual-pipeline API
|
| 200 |
+
β β βββ benchmark/route.ts # Live benchmark runner with F1/EM
|
| 201 |
+
β β βββ providers/route.ts # Available providers + Ollama health
|
| 202 |
+
β βββ src/components/tabs/
|
| 203 |
+
β β βββ LiveCompare.tsx # Provider selector + side-by-side comparison
|
| 204 |
+
β β βββ Benchmark.tsx # Live "Run Now" + radar/bar charts
|
| 205 |
+
β β βββ CostAnalysis.tsx # 12-provider cost projections
|
| 206 |
+
β β βββ GraphExplorer.tsx # Interactive SVG knowledge graph
|
| 207 |
+
β βββ src/lib/
|
| 208 |
+
β βββ llm-providers.ts # 12-provider universal client (18KB)
|
| 209 |
+
β βββ design-tokens.ts # Color + typography tokens
|
| 210 |
β
|
| 211 |
+
βββ openclaw/ # OpenClaw Agent (CIK model)
|
| 212 |
+
β βββ SOUL.md / IDENTITY.md / MEMORY.md
|
| 213 |
+
β βββ skills/ (3 skills)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
β
|
| 215 |
+
βββ graphrag/ # Python Backend
|
| 216 |
+
β βββ layers/
|
| 217 |
+
β βββ graph_layer.py # TigerGraph schema + GSQL
|
| 218 |
+
β βββ orchestration_layer.py # Dual pipeline + adaptive router
|
| 219 |
+
β βββ llm_layer.py # LLM interactions
|
| 220 |
+
β βββ evaluation_layer.py # RAGAS + F1/EM
|
| 221 |
+
β βββ universal_llm.py # LiteLLM 12-provider support
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
β
|
| 223 |
+
βββ tests/test_core.py # 31 unit tests
|
| 224 |
+
βββ Dockerfile # One-command deployment
|
| 225 |
+
βββ README.md
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
```
|
| 227 |
|
| 228 |
---
|
| 229 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
## π References
|
| 231 |
|
| 232 |
+
1. [GraphRAG](https://arxiv.org/abs/2404.16130) β From Local to Global
|
| 233 |
+
2. [LightRAG](https://arxiv.org/abs/2410.05779) β Simple and Fast (34Kβ)
|
| 234 |
+
3. [OpenClaw](https://github.com/Gen-Verse/OpenClaw) β Personal AI Agent
|
| 235 |
+
4. [HotpotQA](https://arxiv.org/abs/1809.09600) β Multi-hop QA
|
| 236 |
+
5. [RAGAS](https://arxiv.org/abs/2309.15217) β RAG Evaluation
|
| 237 |
+
6. [Youtu-GraphRAG](https://arxiv.org/abs/2508.19855) β Schema-Bounded
|
|
|
|
|
|
|
|
|
|
| 238 |
|
| 239 |
+
[TigerGraph](https://tgcloud.io) Β· [Anthropic](https://anthropic.com) Β· [Ollama](https://ollama.ai) Β· [Groq](https://groq.com) Β· [LiteLLM](https://litellm.ai) Β· [Next.js](https://nextjs.org) Β· [Recharts](https://recharts.org)
|
|
|
|
| 240 |
|
| 241 |
---
|
| 242 |
|
|
|
|
| 244 |
|
| 245 |
### π Built for the GraphRAG Inference Hackathon by TigerGraph
|
| 246 |
|
| 247 |
+
**12 LLM Providers** Β· **OpenClaw Agent** Β· **Ollama Local** Β· **TigerGraph** Β· **Next.js 15** Β· **31 Unit Tests** Β· **Docker**
|
|
|
|
|
|
|
| 248 |
|
| 249 |
</div>
|