LightRAG/lightrag
anouarbm 349c1945db Optimize RAGAS evaluation with parallel execution and chunk content enrichment
Added efficient RAG evaluation system with optimized API calls and comprehensive benchmarking.

Key Features:
- Single API call per evaluation (2x faster than before)
- Parallel evaluation based on MAX_ASYNC environment variable
- Chunk content enrichment in /query endpoint responses
- Comprehensive benchmark statistics (moyennes)
- NaN-safe metric calculations

API Changes:
- Added include_chunk_content parameter to QueryRequest (backward compatible)
- /query endpoint enriches references with actual chunk content when requested
- No breaking changes - default behavior unchanged

Evaluation Improvements:
- Parallel execution using asyncio.Semaphore (respects MAX_ASYNC)
- Shared HTTP client with connection pooling
- Proper timeout handling (3min connect, 5min read)
- Debug output for context retrieval verification
- Benchmark statistics with averages, min/max scores

Results:
- Moyenne RAGAS Score: 0.9772
- Perfect Faithfulness: 1.0000
- Perfect Context Recall: 1.0000
- Perfect Context Precision: 1.0000
- Excellent Answer Relevance: 0.9087

(cherry picked from commit 0bbef9814e)
2025-12-04 19:11:20 +08:00
..
api Optimize RAGAS evaluation with parallel execution and chunk content enrichment 2025-12-04 19:11:20 +08:00
evaluation Optimize RAGAS evaluation with parallel execution and chunk content enrichment 2025-12-04 19:11:20 +08:00
kg Add entity/relation chunk tracking with configurable source ID limits 2025-12-04 19:11:19 +08:00
llm Refactor keyword_extraction from kwargs to explicit parameter 2025-12-04 19:11:09 +08:00
models tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
services tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
tools Remove manual initialize_pipeline_status() calls across codebase 2025-12-04 19:11:17 +08:00
__init__.py Bump core version to 1.4.9.1 2025-09-28 15:25:02 +08:00
base.py Add entity/relation chunk tracking with configurable source ID limits 2025-12-04 19:11:19 +08:00
constants.py Add entity/relation chunk tracking with configurable source ID limits 2025-12-04 19:11:19 +08:00
exceptions.py Add Qdrant legacy collection migration with workspace support 2025-12-04 19:11:15 +08:00
lightrag.py Fix entity and relationship deletion when no chunk references remain 2025-12-04 19:11:19 +08:00
namespace.py Add entity/relation chunk tracking with configurable source ID limits 2025-12-04 19:11:19 +08:00
operate.py Add entity/relation chunk tracking with configurable source ID limits 2025-12-04 19:11:19 +08:00
prompt.py Improve prompt clarity by standardizing terminology and formatting 2025-09-28 13:31:55 +08:00
rerank.py Fix trailing whitespace and update test mocking for rerank module 2025-12-04 19:11:14 +08:00
security.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
tenant_rag_manager.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
types.py
utils.py Enhance entity/relation editing with chunk tracking synchronization 2025-12-04 19:11:19 +08:00
utils_context.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
utils_graph.py Add chunk tracking support to entity merge functionality 2025-12-04 19:11:19 +08:00