102 Commits

Author SHA1 Message Date
yangdx
9923821d75 refactor: Remove deprecated max_token_size from embedding configuration
This parameter is no longer used. Its removal simplifies the API and clarifies that token length management is handled by upstream text chunking logic rather than the embedding wrapper.
2025-07-29 10:49:35 +08:00
yangdx
75d1b1e9f8 Update Ollama context length configuration
- Rename OLLAMA_NUM_CTX to OLLAMA_LLM_NUM_CTX
- Increase default context window size
- Add requirement for minimum context size
- Update documentation examples
2025-07-29 09:53:37 +08:00
yangdx
f2ffff063b feat: refactor ollama server configuration management
- Add ollama_server_infos attribute to LightRAG class with default initialization
- Move default values to constants.py for centralized configuration
- Refactor OllamaServerInfos class with property accessors and CLI support
- Update OllamaAPI to get configuration through rag object instead of direct import
- Add command line arguments for simulated model name and tag
- Fix type imports to avoid circular dependencies
2025-07-28 01:38:35 +08:00
yangdx
519e81aaeb Update env.example 2025-07-27 18:21:10 +08:00
yangdx
ebaff228aa feat: Add rerank score filtering with configurable threshold
- Add DEFAULT_MIN_RERANK_SCORE constant (default: 0.0)
- Add MIN_RERANK_SCORE environment variable support
- Filter chunks with rerank scores below threshold in process_chunks_unified
- Add info-level logging for filtering operations
- Handle empty results gracefully after filtering
- Maintain backward compatibility with non-reranked chunks
2025-07-27 16:37:44 +08:00
yangdx
055629d30d Reduce default max total tokens to 30k 2025-07-27 10:33:06 +08:00
yangdx
b3c2987006 Reduce default MAX_TOKENS from 32000 to 10000 2025-07-26 08:13:49 +08:00
yangdx
ccfe2e73d1 Update env.example 2025-07-25 11:13:15 +08:00
zrguo
55ddc0ee86 fix typo 2025-07-24 15:20:05 +08:00
yangdx
29d1220f26 Merge branch 'main' into context-builder 2025-07-24 14:18:12 +08:00
yangdx
b1dd015e3e Update env.example 2025-07-24 14:17:49 +08:00
yangdx
f57ed21593 Merge branch 'main' into context-builder 2025-07-24 14:07:05 +08:00
yangdx
2767212ba0 Fix linting 2025-07-24 12:25:50 +08:00
yangdx
d979e9078f feat: Integrate Jina embeddings API support
- Implemented Jina embedding function
- Add new EMBEDDING_BINDING type of jina for LightRAG Server
- Add env var sample
2025-07-24 12:15:00 +08:00
yangdx
edeb89abc6 Update comments 2025-07-24 10:09:24 +08:00
yangdx
795ce4cbe7 Update RELATED_CHUNK_NUMBER comment 2025-07-24 10:06:33 +08:00
yangdx
2c940f0728 reduce RELATED_CHUNK_NUMBER from 10 to 5 2025-07-24 02:49:05 +08:00
yangdx
df8b4202f3 feat: Add SSL support for PostgreSQL database connections
- Add SSL configuration options (ssl_mode, ssl_cert, ssl_key, ssl_root_cert, ssl_crl)
- Support all PostgreSQL SSL modes (disable, allow, prefer, require, verify-ca, verify-full)
- Add SSL context creation with certificate validation
- Update initdb() method to handle SSL connection parameters
- Add SSL environment variables to env.example
- Maintain backward compatibility with existing non-SSL configurations
2025-07-21 02:03:06 +08:00
yangdx
2c7d2b3f5f Increase Neo4j connection pool size and timeouts
- Bump default connection pool size to 100
- Add new Neo4j timeout env variables to env.example
2025-07-19 13:27:34 +08:00
yangdx
96b94acc83 Enhance Redis connection handling with retries and timeouts
- Added Redis connection timeout configurations
- Implemented retry logic for Redis operations
- Updated error handling for timeout cases
- Improved connection pool management
- Added environment variable support
2025-07-19 10:15:26 +08:00
yangdx
8103b200db Set DEFAULT_HISTORY_TURNS to 0 2025-07-16 02:20:27 +08:00
yangdx
6e084bfae1 Increase default related chunk number from 5 to 10 2025-07-16 00:22:34 +08:00
yangdx
5f7cb437e8 Centralize query parameters into LightRAG class
This commit refactors query parameter management by consolidating settings like `top_k`, token limits, and thresholds into the `LightRAG` class, and consistently sourcing parameters from a single location.
2025-07-15 23:56:49 +08:00
yangdx
26865c2cd0 Update env.example 2025-07-15 17:08:23 +08:00
yangdx
47341d3a71 Merge branch 'main' into rerank 2025-07-15 16:12:33 +08:00
yangdx
e8e1f6ab56 feat: centralize environment variable defaults in constants.py 2025-07-15 16:11:50 +08:00
zrguo
91d0f65476 Update QueryParam 2025-07-15 14:21:58 +08:00
yangdx
ccc2a20071 feat: remove deprecated MAX_TOKEN_SUMMARY parameter to prevent LLM output truncation
- Remove MAX_TOKEN_SUMMARY parameter and related configurations
- Eliminate forced token-based truncation in entity/relationship descriptions
- Switch to fragment-count based summarization logic using FORCE_LLM_SUMMARY_ON_MERGE
- Update FORCE_LLM_SUMMARY_ON_MERGE default from 6 to 4 for better summarization
- Clean up documentation, environment examples, and API display code
- Preserve backward compatibility by graceful parameter removal

This change resolves issues where LLMs were forcibly truncating entity relationship
descriptions mid-sentence, leading to incomplete and potentially inaccurate knowledge
graph content. The new approach allows LLMs to generate complete descriptions while
still providing summarization when multiple fragments need to be merged.

Breaking Change: None - parameter removal is backward compatible
Fixes: Entity relationship description truncation issues
2025-07-15 12:26:33 +08:00
zrguo
7c882313bb remove chunk_rerank_top_k 2025-07-15 11:52:34 +08:00
zrguo
4e425b1b59 Revert "update from main"
This reverts commit 1d0376d6a926ef60d641af4406dacf5b8bbb430f.
2025-07-14 16:29:00 +08:00
zrguo
1d0376d6a9 update from main 2025-07-14 16:27:49 +08:00
zrguo
c9cbd2d3e0 Merge branch 'main' into rerank 2025-07-14 16:24:29 +08:00
zrguo
ef2115d437 Update token limit 2025-07-14 15:53:48 +08:00
yangdx
b03bb48e24 feat: Refine summary logic and add dedicated Ollama num_ctx config
- Refactor the trigger condition for LLM-based summarization of entities and relations. Instead of relying on character length, the summary is now triggered when the number of merged description fragments exceeds a configured threshold. This provides a more robust and logical condition for consolidation.
- Introduce the `OLLAMA_NUM_CTX` environment variable to explicitly configure the context window size (`num_ctx`) for Ollama models. This decouples the model's context length from the `MAX_TOKENS` parameter, which is now specifically used to limit input for summary generation, making the configuration clearer and more flexible.
- Updated `README` files, `env.example`, and default values to reflect these changes.
2025-07-14 01:55:04 +08:00
yangdx
03b40937f7 Reduce embedding concurrency limit from 16 to 8 2025-07-13 03:13:52 +08:00
yangdx
78033edabb Update env.example 2025-07-09 04:37:04 +08:00
yangdx
5d4484882a Merge branch 'main' into rerank 2025-07-09 03:59:04 +08:00
yangdx
14d51518dd Merge branch 'add-Memgraph-graph-db' into memgraph 2025-07-09 03:38:07 +08:00
yangdx
3a0249a6b9 Update env.example 2025-07-09 03:36:17 +08:00
DavIvek
4438897b6b add changes based on review 2025-07-08 16:28:06 +02:00
zrguo
d4651d59c1 Add rerank to server 2025-07-08 21:44:20 +08:00
zrguo
71cb3adb4f Merge branch 'main' into rerank 2025-07-08 15:10:23 +08:00
zrguo
04a57445da update chunks truncation method 2025-07-08 13:31:05 +08:00
zrguo
f5c80d7cde Simplify Configuration 2025-07-08 11:16:34 +08:00
yangdx
9b7b2a9b0f Reduce default embedding batch size from 32 to 10 2025-07-08 11:00:09 +08:00
yangdx
186c6411fb Update env.example 2025-07-08 10:45:32 +08:00
yangdx
3eaadb8a44 Update env.example 2025-07-08 03:06:19 +08:00
zrguo
75dd4f3498 add rerank model 2025-07-07 22:44:59 +08:00
yangdx
68921bc475 Update env.example 2025-07-07 17:49:33 +08:00
yangdx
752df9d674 Update env.example 2025-07-07 08:53:33 +08:00