3040 Commits

Author SHA1 Message Date
yangdx
b6aedba7ae Add logging for empty naive query results in vector context 2025-08-25 12:21:31 +08:00
yangdx
f1ff5cf93f fix: initialize truncated_chunks variable in _build_query_context
Prevents local variable 'truncated_chunks'referenced before assignment
2025-08-25 11:56:56 +08:00
Thibo Rosemplatt
f5938f76bc Azure OpenAI requires import of OpenAILLMOptions (missing) 2025-08-24 00:28:49 +02:00
yangdx
49ea9a79a7 Update rerank doc in README 2025-08-23 23:06:10 +08:00
yangdx
3d5e6226a9 Refactored rerank_example file to utilize the updated rerank function. 2025-08-23 22:51:41 +08:00
yangdx
9bc349ddd6 Improve Empty Keyword Handling logic 2025-08-23 11:50:58 +08:00
yangdx
1be9a54c8d Rename ENABLE_RERANK to RERANK_BY_DEFAULT and update default to true 2025-08-23 09:46:51 +08:00
yangdx
d29272e6a5 Merge branch 'add-diagnostic-tool' 2025-08-23 02:39:28 +08:00
yangdx
8a293a2c07 Fix linting 2025-08-23 02:39:12 +08:00
yangdx
4595e4b82e Merge branch 'improve-initialization-error-messages' 2025-08-23 02:34:59 +08:00
yangdx
059003c906 Rename allow_create to first_initialization for clarity 2025-08-23 02:34:39 +08:00
yangdx
7f404bbecb Update webui assets and bump api version to 0207 2025-08-23 02:05:09 +08:00
yangdx
47485b130d refac(ui): Show rerank binding info on status card
- Remove separate ENABLE_RERANK flag in favor of rerank_binding="null"
- Change default rerank binding from "cohere" to "null" (disabled)
- Update UI to display both rerank binding and model information
2025-08-23 02:04:14 +08:00
yangdx
bf43e1b8c1 fix: Resolve default rerank config problem when env var missing
- 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
2025-08-23 01:07:59 +08:00
yangdx
580cb7906c feat: Add multiple rerank provider support to LightRAG Server by adding new env vars and cli params
- Add --enable-rerank CLI argument and ENABLE_RERANK env var
- Simplify rerank configuration logic to only check enable flag and binding
- Update health endpoint to show enable_rerank and rerank_configured status
- Improve logging messages for rerank enable/disable states
- Maintain backward compatibility with default value True
2025-08-22 19:29:45 +08:00
Albert Gil López
3fca3be09b fix: Fix server startup issue with PipelineNotInitializedError
- Add allow_create parameter to get_namespace_data() to permit internal initialization
- initialize_pipeline_status() now uses allow_create=True to create the namespace
- External calls still get the error if pipeline_status is not initialized
- This maintains the improved error messages while allowing proper server startup

Fixes server startup failure reported in PR #1978
2025-08-22 10:55:56 +00:00
Albert Gil López
c66fc3483a fix: Implement PipelineNotInitializedError usage in get_namespace_data
- Add PipelineNotInitializedError import to shared_storage.py
- Raise PipelineNotInitializedError when accessing uninitialized pipeline_status namespace
- This provides clear error messages to users about initialization requirements
- Other namespaces continue to be created dynamically as before

Addresses review feedback from PR #1978 about unused exception class
2025-08-22 02:52:51 +00:00
Albert Gil López
3a64b267cb Merge upstream/main and resolve conflicts 2025-08-21 16:56:11 +00:00
Albert Gil López
ba7b3cedb5 Merge remote-tracking branch 'upstream/main' into add-diagnostic-tool 2025-08-21 16:52:09 +00:00
yangdx
16a1ef1178 Update summary_max_tokens default from 10k to 30k tokens 2025-08-21 23:16:07 +08:00
yangdx
105fb43a54 Updat webui assets and bump api version to 0206 2025-08-21 22:56:44 +08:00
yangdx
8c6b5f4a3a Update README 2025-08-21 18:14:27 +08:00
yangdx
b5c230abdd optimize: avoid duplicate embedding calls in _build_query_context
Reduces API costs and improves query performance while maintaining backward compatibility.
2025-08-21 16:49:24 +08:00
yangdx
62cdc7d7eb Update documentation with LLM selection guidelines and API improvements 2025-08-21 13:59:14 +08:00
yangdx
4b2ef71c25 feat: Add extra_body parameter support for OpenRouter/vLLM compatibility
- Enhanced add_args function to handle dict types with JSON parsing
- Added reasoning and extra_body parameters for OpenRouter/vLLM compatibility
- Updated env.example with OpenRouter/vLLM parameter examples
2025-08-21 13:06:28 +08:00
yangdx
0e67ead8fa Rename MAX_TOKENS to SUMMARY_MAX_TOKENS for clarity 2025-08-21 10:15:20 +08:00
yangdx
aa22772721 Refactor LLM temperature handling to be provider-specific
• Remove global temperature parameter
• Add provider-specific temp configs
• Update env example with new settings
• Fix Bedrock temperature handling
• Clean up splash screen display
2025-08-20 23:52:33 +08:00
yangdx
df7bcb1e3d Add LLM_TIMEOUT configuration for all LLM providers
- Add LLM_TIMEOUT env variable
- Apply timeout to all LLM bindings
2025-08-20 23:50:57 +08:00
yangdx
4c556d8aae Set default TIMEOUT value to 150, and gunicorn timeout to TIMEOUT+30 2025-08-20 22:04:32 +08:00
yangdx
9b7ed84e05 Improve document deletion error handling and message consistency
- Standardize deletion log messages
- Add try-catch for file operations
- Improve enqueued file error handling
2025-08-20 11:01:24 +08:00
yangdx
a4c4b1182a Fix logging level usage in Redis retry decorator
* Replace string with logging.WARNING constant
2025-08-20 05:21:15 +08:00
yangdx
485c4b7de7 Change document deletion warnings to info level logging 2025-08-20 03:28:42 +08:00
yangdx
ced3aef7cb refactor: simplify text encoding by removing redundant safe_encode_for_llm 2025-08-19 19:37:46 +08:00
yangdx
806081645f Refactor text cleaning to use sanitize_text_for_encoding consistently
• Replace clean_text with sanitize_text
• Remove deprecated clean_text function
• Add whitespace trimming to sanitizer
• Improve UTF-8 encoding safety
• Consolidate text cleaning logic
2025-08-19 19:20:01 +08:00
yangdx
f9cf544805 Add text sanitization to prevent UTF-8 encoding errors in LLM calls
• Remove surrogate characters
• Clean control characters
• Sanitize input and history messages
• Add comprehensive error handling
• Log sanitization activities
2025-08-19 18:50:52 +08:00
yangdx
64015548df Refactor MD5 hash functions and consolidate Unicode error handling 2025-08-19 17:49:23 +08:00
yangdx
64058c771f Refactor: Harden compute_args_hash against Unicode errors 2025-08-19 17:19:39 +08:00
yangdx
2603e99005 Enhance file deletion to remove files from both input and enqueued dirs 2025-08-19 17:13:58 +08:00
yangdx
1f86543772 Update i18n translation and webui assets 2025-08-19 16:23:05 +08:00
yangdx
0aa1bc8bf9 Update webui assets and bump api version to 0205 2025-08-19 15:11:34 +08:00
yangdx
e38df464ea Ensure front-end file type uploads are synchronized with back-end 2025-08-19 15:10:13 +08:00
yangdx
ac33cf693d Refactor keyword extraction rules and remove overlap constraint
• Require content in both keyword categories
• Remove no-overlap rule between lists
• Simplify edge case handling
• Clarify source of truth requirement
2025-08-19 15:07:40 +08:00
Albert Gil López
e3ae87b0cb feat: Add diagnostic tool to check initialization status
- Add check_initialization.py tool to help developers verify proper setup
- Tool checks all storage components and pipeline status
- Provides clear feedback on what's missing and how to fix it
- Includes demo mode to show before/after initialization
- Helps prevent common initialization errors proactively

This tool makes it easier for developers to debug initialization issues
2025-08-19 06:44:33 +00:00
Albert Gil López
f35963c020 feat: Add clear error messages for uninitialized storage
- Add StorageNotInitializedError and PipelineNotInitializedError exceptions
- Update JsonDocStatusStorage to raise clear errors when not initialized
- Update JsonKVStorage to raise clear errors when not initialized
- Error messages now include complete initialization instructions
- Helps users understand and fix initialization issues quickly

Addresses feedback from issue #1933 about improving error clarity
2025-08-19 06:41:52 +00:00
yangdx
9ed5b93467 Add [File Extraction] prefix to error messages and logs 2025-08-19 11:33:28 +08:00
yangdx
92c0ad0076 Fix linting 2025-08-19 00:45:29 +08:00
yangdx
23334e7e51 Update prompt.py 2025-08-19 00:29:33 +08:00
yangdx
2a7fec2873 Optimize keyword extraction prompt, and remove conversation history from keywork extraction.
- Remove history context processing
- Update prompt to focus on single query
- Clarify high/low level keyword types
- Improve JSON output instructions
- Add edge case handling guidance
2025-08-18 23:35:04 +08:00
yangdx
cdfbd2114f Merge branch 'main' into pg-optimization 2025-08-18 22:24:37 +08:00
yangdx
1c4d6fde58 Change log level from info to debug for document storage message 2025-08-18 20:04:29 +08:00