EdgeQuake vs LightRAG (Python)
EdgeQuake vs LightRAG (Python)
Section titled βEdgeQuake vs LightRAG (Python)βA Rust reimplementation with production-grade enhancements
EdgeQuake is a Rust-native reimplementation of the LightRAG algorithm from HKU. This document compares the two implementations to help you choose the right tool for your needs.
Quick Comparison
Section titled βQuick Comparisonβ| Aspect | EdgeQuake (Rust) | LightRAG (Python) |
|---|---|---|
| Language | Rust | Python |
| Codebase | ~130K LOC | ~50K LOC |
| Query Modes | 6 (naive, local, global, hybrid, mix, bypass) | 6 (same) |
| Streaming | β Native SSE | β Via streaming |
| Multi-tenant | β Built-in | β οΈ Workspace isolation |
| Database | PostgreSQL + pgvector + AGE | Multiple options |
| Type Safety | β Compile-time | Runtime only |
| Async | Tokio-based | asyncio-based |
| Memory Safety | β Guaranteed | β GC-managed |
| Deployment | Single binary | Python environment |
Algorithm Fidelity
Section titled βAlgorithm FidelityβEdgeQuake faithfully implements the core LightRAG algorithm (arxiv:2410.05779):
β Shared Features
Section titled ββ Shared Featuresβ| Feature | Implementation |
|---|---|
| Entity Extraction | LLM-based with tuple format |
| Relationship Extraction | Same prompt structure |
| Graph Construction | Entity β Node, Relationship β Edge |
| Query Modes | All 6 modes identical semantics |
| Gleaning | Multi-pass extraction for completeness |
| Entity Normalization | UPPERCASE_UNDERSCORE format |
| Reranking | Optional BGE-Reranker support |
π EdgeQuake Enhancements
Section titled βπ EdgeQuake EnhancementsβEdgeQuake adds production features not in the original LightRAG:
| Enhancement | Description |
|---|---|
| Multi-tenant Isolation | Full workspace/tenant isolation with header-based routing |
| PostgreSQL Integration | Unified storage with pgvector + Apache AGE |
| REST API | Production-ready Axum-based HTTP API |
| Type-Safe Crate System | 11 modular Rust crates for maintainability |
| Cost Tracking | Token usage and cost metrics per query |
| Source Lineage | Full document β chunk β entity provenance |
Performance Comparison
Section titled βPerformance ComparisonβTheoretical Advantages
Section titled βTheoretical Advantagesβ| Metric | EdgeQuake | LightRAG | Notes |
|---|---|---|---|
| Startup Time | ~50ms | ~2-5s | Python import overhead |
| Memory Usage | ~50MB base | ~200MB+ | Python interpreter overhead |
| Concurrent Connections | 10,000+ | ~500-1,000 | Tokio async vs asyncio |
| CPU Utilization | Near-optimal | 30-50% overhead | No GIL, native code |
| Binary Size | ~30MB | ~500MB+ deps | Single static binary |
Real-World Performance
Section titled βReal-World PerformanceβBoth implementations are I/O bound for typical RAG workloads:
- LLM API latency dominates (100-2000ms per call)
- Vector search latency (10-50ms)
- Graph traversal (5-20ms)
Conclusion: For most use cases, performance difference is negligible. EdgeQuake advantages appear at scale (>1000 concurrent users).
Query Modes Comparison
Section titled βQuery Modes ComparisonβBoth implementations support the same 6 query modes:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ QUERY MODES (IDENTICAL) ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β ββ Mode β EdgeQuake β LightRAG (Python) ββ ββββββββββΌβββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ naive β β
Vector only β β
Vector only ββ local β β
Entity-centric β β
Entity-centric ββ global β β
Community-based β β
Community-based ββ hybrid β β
Local + Global β β
Local + Global ββ mix β β
Weighted blend β β
Weighted blend ββ bypass β β
Direct LLM β β
Direct LLM ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββStorage Backend Comparison
Section titled βStorage Backend ComparisonβLightRAG (Python) Storage Options
Section titled βLightRAG (Python) Storage Optionsβ| Type | Options |
|---|---|
| KV Storage | JsonFile, PostgreSQL, Redis, MongoDB |
| Vector Storage | NanoVector, PostgreSQL, Milvus, Faiss, Qdrant, MongoDB |
| Graph Storage | NetworkX, Neo4J, PostgreSQL/AGE, Memgraph |
EdgeQuake Storage Options
Section titled βEdgeQuake Storage Optionsβ| Type | Options |
|---|---|
| KV Storage | PostgreSQL, In-Memory |
| Vector Storage | PostgreSQL (pgvector), In-Memory |
| Graph Storage | PostgreSQL (Apache AGE), In-Memory |
Key Difference: EdgeQuake uses PostgreSQL as a unified backend, simplifying deployment. LightRAG offers more flexibility with multiple backend options.
API Comparison
Section titled βAPI ComparisonβLightRAG Python API
Section titled βLightRAG Python APIβfrom lightrag import LightRAG, QueryParam
rag = LightRAG( working_dir="./rag_storage", embedding_func=openai_embed, llm_model_func=gpt_4o_mini_complete,)await rag.initialize_storages()
# Insertawait rag.ainsert("Your document text")
# Queryresult = await rag.aquery( "What is the main topic?", param=QueryParam(mode="hybrid"))EdgeQuake REST API
Section titled βEdgeQuake REST APIβ# Insert documentcurl -X POST http://localhost:8080/api/v1/documents \ -H "Content-Type: application/json" \ -d '{"content": "Your document text", "title": "My Document"}'
# Querycurl -X POST http://localhost:8080/api/v1/query \ -H "Content-Type: application/json" \ -d '{"query": "What is the main topic?", "mode": "hybrid"}'EdgeQuake Rust API
Section titled βEdgeQuake Rust APIβuse edgequake_core::EdgeQuake;
let edgequake = EdgeQuake::new(config).await?;
// Insertedgequake.ingest_text("Your document text", None).await?;
// Querylet response = edgequake.query( "What is the main topic?", QueryMode::Hybrid,).await?;When to Choose EdgeQuake
Section titled βWhen to Choose EdgeQuakeββ Choose EdgeQuake when:
- You need production-ready deployment (single binary, no Python deps)
- Multi-tenant architecture is required
- High concurrency (>500 concurrent users)
- Type safety and compile-time guarantees matter
- Youβre already using Rust or have Rust expertise
- PostgreSQL is your preferred database
- Memory efficiency is critical
- You need predictable latency (no GC pauses)
β Consider LightRAG Python when:
- You need rapid prototyping
- Your team has Python expertise
- You need Neo4J or other specialized backends
- You want community plugins and integrations
- Youβre doing research/experimentation
Migration Guide
Section titled βMigration GuideβFrom LightRAG to EdgeQuake
Section titled βFrom LightRAG to EdgeQuakeβ- Export your data using LightRAGβs export functions
- Transform entity format (LightRAG uses similar normalization)
- Import via EdgeQuake API:
# Export from LightRAG (Python)await rag.export_knowledge(output_path="./export.json")
# Import to EdgeQuake (via API)curl -X POST http://localhost:8080/api/v1/documents/import \ -F "file=@export.json"Data Compatibility
Section titled βData Compatibilityβ| Data Type | Compatible | Notes |
|---|---|---|
| Entities | β | Same normalization format |
| Relationships | β | Same structure |
| Embeddings | β οΈ | Must use same embedding model |
| Query history | β | Not transferred |
Feature Matrix
Section titled βFeature Matrixβ| Feature | EdgeQuake | LightRAG |
|---|---|---|
| Entity Extraction | β | β |
| Relationship Extraction | β | β |
| 6 Query Modes | β | β |
| Gleaning | β | β |
| Reranking | β | β |
| Streaming Responses | β | β |
| Multi-tenant | β | β οΈ |
| REST API | β | β |
| WebUI | β | β |
| Graph Visualization | β | β |
| PostgreSQL | β | β |
| Neo4J | β | β |
| MongoDB | β | β |
| Milvus | β | β |
| Docker Compose | β | β |
| Kubernetes | β | β |
| Cost Tracking | β | β οΈ |
| Source Citations | β | β |
| Document Deletion | β | β |
| Entity Merging | β | β |
| Multimodal (RAG-Anything) | β | β |
| Langfuse Tracing | β οΈ | β |
Community & Support
Section titled βCommunity & Supportβ| Aspect | EdgeQuake | LightRAG |
|---|---|---|
| GitHub Stars | Growing | 27.7k+ |
| Contributors | Active | 216+ |
| Discord | TBD | Active |
| Documentation | Comprehensive | Comprehensive |
| License | Apache-2.0 | MIT |
Summary
Section titled βSummaryβEdgeQuake is ideal for production deployments requiring:
- Type safety and performance guarantees
- Multi-tenant architecture
- PostgreSQL-centric infrastructure
- Single-binary deployment
LightRAG (Python) is ideal for:
- Rapid prototyping and research
- Python-centric teams
- Multi-backend flexibility
- Community integrations (RAG-Anything, Langfuse)
Both implement the same core algorithm, so query quality is equivalent. The choice depends on your deployment requirements and team expertise.
See Also
Section titled βSee Alsoβ- LightRAG Algorithm Deep-Dive
- vs GraphRAG - Microsoftβs approach
- vs Traditional RAG - Why graphs matter