Skip to content

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.


AspectEdgeQuake (Rust)LightRAG (Python)
LanguageRustPython
Codebase~130K LOC~50K LOC
Query Modes6 (naive, local, global, hybrid, mix, bypass)6 (same)
Streamingβœ… Native SSEβœ… Via streaming
Multi-tenantβœ… Built-in⚠️ Workspace isolation
DatabasePostgreSQL + pgvector + AGEMultiple options
Type Safetyβœ… Compile-timeRuntime only
AsyncTokio-basedasyncio-based
Memory Safetyβœ… Guaranteed❌ GC-managed
DeploymentSingle binaryPython environment

EdgeQuake faithfully implements the core LightRAG algorithm (arxiv:2410.05779):

FeatureImplementation
Entity ExtractionLLM-based with tuple format
Relationship ExtractionSame prompt structure
Graph ConstructionEntity β†’ Node, Relationship β†’ Edge
Query ModesAll 6 modes identical semantics
GleaningMulti-pass extraction for completeness
Entity NormalizationUPPERCASE_UNDERSCORE format
RerankingOptional BGE-Reranker support

EdgeQuake adds production features not in the original LightRAG:

EnhancementDescription
Multi-tenant IsolationFull workspace/tenant isolation with header-based routing
PostgreSQL IntegrationUnified storage with pgvector + Apache AGE
REST APIProduction-ready Axum-based HTTP API
Type-Safe Crate System11 modular Rust crates for maintainability
Cost TrackingToken usage and cost metrics per query
Source LineageFull document β†’ chunk β†’ entity provenance

MetricEdgeQuakeLightRAGNotes
Startup Time~50ms~2-5sPython import overhead
Memory Usage~50MB base~200MB+Python interpreter overhead
Concurrent Connections10,000+~500-1,000Tokio async vs asyncio
CPU UtilizationNear-optimal30-50% overheadNo GIL, native code
Binary Size~30MB~500MB+ depsSingle static binary

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).


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 β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

TypeOptions
KV StorageJsonFile, PostgreSQL, Redis, MongoDB
Vector StorageNanoVector, PostgreSQL, Milvus, Faiss, Qdrant, MongoDB
Graph StorageNetworkX, Neo4J, PostgreSQL/AGE, Memgraph
TypeOptions
KV StoragePostgreSQL, In-Memory
Vector StoragePostgreSQL (pgvector), In-Memory
Graph StoragePostgreSQL (Apache AGE), In-Memory

Key Difference: EdgeQuake uses PostgreSQL as a unified backend, simplifying deployment. LightRAG offers more flexibility with multiple backend options.


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()
# Insert
await rag.ainsert("Your document text")
# Query
result = await rag.aquery(
"What is the main topic?",
param=QueryParam(mode="hybrid")
)
Terminal window
# Insert document
curl -X POST http://localhost:8080/api/v1/documents \
-H "Content-Type: application/json" \
-d '{"content": "Your document text", "title": "My Document"}'
# Query
curl -X POST http://localhost:8080/api/v1/query \
-H "Content-Type: application/json" \
-d '{"query": "What is the main topic?", "mode": "hybrid"}'
use edgequake_core::EdgeQuake;
let edgequake = EdgeQuake::new(config).await?;
// Insert
edgequake.ingest_text("Your document text", None).await?;
// Query
let response = edgequake.query(
"What is the main topic?",
QueryMode::Hybrid,
).await?;

βœ… 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

  1. Export your data using LightRAG’s export functions
  2. Transform entity format (LightRAG uses similar normalization)
  3. Import via EdgeQuake API:
Terminal window
# 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 TypeCompatibleNotes
Entitiesβœ…Same normalization format
Relationshipsβœ…Same structure
Embeddings⚠️Must use same embedding model
Query history❌Not transferred

FeatureEdgeQuakeLightRAG
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βš οΈβœ…

AspectEdgeQuakeLightRAG
GitHub StarsGrowing27.7k+
ContributorsActive216+
DiscordTBDActive
DocumentationComprehensiveComprehensive
LicenseApache-2.0MIT

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.