Why this change is needed:
asdict() converts nested dataclasses to dicts. When LightRAG creates
global_config with asdict(self), the embedding_func field (which is an
EmbeddingFunc dataclass) gets converted to a plain dict, losing its
get_model_identifier() method.
How it solves it:
1. Save original EmbeddingFunc object before asdict() call
2. Restore it in global_config after asdict()
3. Add null check and debug logging in _generate_collection_suffix
Impact:
- E2E tests with full LightRAG initialization now work correctly
- Vector storage model isolation features function properly
- Maintains backward compatibility
Testing:
All unit tests pass (12/12 in migration tests)
Why these changes are needed:
1. LightRAG wraps embedding_func with priority_limit_async_func_call
decorator, causing loss of get_model_identifier method
2. UnifiedLock.__aexit__ set main_lock_released flag incorrectly
How it solves them:
1. _generate_collection_suffix now tries multiple approaches:
- First check if embedding_func has get_model_identifier
- Fallback to original EmbeddingFunc in global_config
- Return empty string for backward compatibility
2. Move main_lock_released = True inside the if block so flag
is only set when lock actually exists and is released
Impact:
- Fixes E2E tests that initialize complete LightRAG instances
- Fixes incorrect async lock cleanup in exception scenarios
- Maintains backward compatibility
Testing:
All unit tests pass (test_qdrant_migration.py, test_postgres_migration.py)
Why this change is needed:
To enforce consistent naming and migration strategy across all vector storages.
How it solves it:
- Added _generate_collection_suffix() helper
- Added _get_legacy_collection_name() and _get_new_collection_name() interfaces
Impact:
Prepares storage implementations for multi-model support.
Testing:
Added tests/test_base_storage_integrity.py passing.
• Use "preprocessed" to indicate multimodal processing is required
• Update DocProcessingStatus to process status convertion automatically
• Remove multimodal_processed from DocStatus enum value
• Update UI filter logic
- Add entity_chunks & relation_chunks storage
- Implement KEEP/FIFO limit strategies
- Update env.example with new settings
- Add migration for chunk tracking data
- Support all KV storage
• Add DocStatus.PREPROCESSED enum value
• Update API routes and response models
• Add preprocessed filter in web UI
• Update localization files
• Handle preprocessed status in deletion
• Add include_references param to QueryRequest
• Extend QueryResponse with references field
• Create unified QueryResult data structures
• Refactor kg_query and naive_query functions
• Update streaming to send references first
- Add get_doc_by_file_path to all storages
- Skip processed files in scan operation
- Check duplicates in upload endpoints
- Check duplicates in text insert APIs
- Return status info in duplicate responses
- Read config from selected_rerank_func when env var missing
- Make api_key optional for rerank function
- Add response format validation with proper error handling
- Update Cohere rerank default to official API endpoint
- Add env switch to toggle weighted polling vs vector-similarity strategy
- Implement similarity-based sorting with fallback to weighted
- Introduce batch vector read API for vector storage
- Implement vector store and retrive funtion for Nanovector DB
- Preserve default behavior (weighted polling selection method)
- Introduces an index mapping documents to their corresponding entities and relations. This significantly speeds up `adelete_by_doc_id` by replacing slow graph traversal with a fast key-value lookup.
- Refactors the ingestion pipeline (`merge_nodes_and_edges`) to populate this new index. Adds a one-time data migration script to backfill the index for existing data.
- Add pagination support to BaseDocStatusStorage interface and all implementations (PostgreSQL, MongoDB, Redis, JSON)
- Implement RESTful API endpoints for paginated document queries and status counts
- Create reusable pagination UI components with internationalization support
- Optimize performance with database-level pagination and efficient in-memory processing
- Maintain backward compatibility while adding configurable page sizes (10-200 items)
- Add metadata field to doc_status storage with Unix timestamps for processing start/end times
- Update frontend API types: error -> error_msg, add track_id and metadata support
- Add getTrackStatus API method for document tracking functionality
- Fix frontend DocumentManager to use error_msg field for proper error display
- Ensure full compatibility between backend metadata changes and frontend UI
- To enhance performance during document deletion, new batch-get methods, `get_nodes_by_chunk_ids` and `get_edges_by_chunk_ids`, have been added to the graph storage layer (`BaseGraphStorage` and its implementations). The [`adelete_by_doc_id`](lightrag/lightrag.py:1681) function now leverages these methods to avoid unnecessary iteration over the entire knowledge graph, significantly improving efficiency.
- Graph storage updated: Networkx, Neo4j, Postgres AGE