v1.4.9.9

HKUDS/LightRAGv1.4.9.9Dec 22, 2025by danielaskdd

AI Summary

Major release adding workspace isolation for pipeline status and in-memory storage, vector data isolation by model name and dimension for PostgreSQL and Qdrant, and enhanced document extraction capabilities.

Key Highlights

  • Workspace isolation for pipeline status and in-memory storage
  • Vector data isolation by model name and dimension for PostgreSQL and Qdrant
  • Dimension selection support for OpenAI and Gemini embeddings
  • LLM cache migration and cleanup tools between different KV storage
  • Enhanced DOCX extraction with table content support
  • Enhanced XLSX extraction with tab and newline character handling
  • Critical security vulnerability fix in React Server Components
  • Automatic text truncation support for embedding functions

Breaking Changes

  • Chunking function parameter renaming - requires code updates if passing parameters by name
  • Embedding function now requires model_name parameter when using wrap_embedding_func_with_attrs

New Features

  • Workspace isolation system for multiple LightRAG instances
  • Vector storage model isolation with automatic migration
  • Embedding dimension control with EMBEDDING_SEND_DIM env var
  • LLM cache migration tool
  • LLM query cache cleanup tool
  • Chain of Thought support for Gemini LLM
  • Gemini embedding support
  • vchordrq vector index support for PostgreSQL
  • OpenAI prompt caching optimization
  • Cohere reranker config support
  • Python 3.13 and 3.14 testing support

Full Release Notes

# Release Note V1.4.9.9

## Important Notes

* **Add Workspace Isolation for Pipeline Status and In-memory Storage**: Multiple LightRAG instances with distinct workspaces can be created simultaneously, marking a significant advancement toward seamless workspace switching within a single LightRAG server.
* **Add Workspace Vector Data Isolation by Model Name and Dimension for PostgreSQL and Qdrant**: Previously, LightRAG used a single collection/table for difference embedding model and dimension, which caused dimension mismatch crashes or data pollution in multi-workspace.

* **Dimension Selection is Supported for OpenAI and Gemini** Embedding model with new env var introduced: `EMBEDDING_SEND_DIM`
* **Add LLM Cache Migration and LLM Query Cache Cleanup Tools Between Different KV Storage**: enabling users to switch storage backends without losing cached extraction and summary data.
* Enhanced Enhanced **DOCX Extraction with Table Content Support**.
* Enhanced XLSX extraction with proper handling of `tab` and `newline` characters within cells.
* Fix Critical Security Vulnerability in React Server Components: #2494
* **Add Automatic Text Truncation Support for Embedding Functions**: OpenAI embedding function now respect max_token_size value in EmbeddingFunc, and automatic truncate input text to prevent API errors caused by texts exceeding model token limits.

## What's Breaking (for LightRAG Core integration only)

* **Rename params of chunking function**: If you incorporate the chunking function into LightRAG and pass parameters by name, corresponding code updates are required.

```python
def chunking_by_token_size(
    tokenizer: Tokenizer,
    content: str,
    split_by_character: str | None = None,
    split_by_character_only: bool = False,
    chunk_overlap_token_size: int = 100,
    chunk_token_size: int = 1200,
) -> list[dict[str, Any]]:
```

* **Inject an embedding_func with model_name to LightRAG using wrap_embedding_func_with_attrs**: 

```
@wrap_embedding_func_with_attrs(
    embedding_dim=1536, max_token_size=8192, model_name="text-embedding-3-small"
)
@retry(
    stop=stop_after_attempt(3),
    wait=wait_exponential(multiplier=1, min=4, max=60),
    retry=(
        retry_if_exception_type(RateLimitError)
        | retry_if_exception_type(APIConnectionError)
        | retry_if_exception_type(APITimeoutError)
    ),
)
async def embedding_func(texts: list[str]) -> np.ndarray:
    client = AzureOpenAI(
        api_key=AZURE_OPENAI_API_KEY,
        api_version=AZURE_EMBEDDING_API_VERSION,
        azure_endpoint=AZURE_OPENAI_ENDPOINT,
    )
    embedding = client.embeddings.create(model=AZURE_EMBEDDING_DEPLOYMENT, input=texts)

    embeddings = [item.embedding for item in embedding.data]
    return np.array(embeddings)

rag = LightRAG(
      working_dir=WORKING_DIR,
      llm_model_func=llm_model_func,
      embedding_func=embedding_func,
)
```

> To ensure seamless transition, legacy code injecting embedding_func without  model_name will continue to interface with the original non-suffixed vector tables.

## What's New

* Feat: Add Chain of Thought Support for Gemini LLM by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2326
* Feat: Add Optional Embedding Dimension Control with OpenAI API by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2328
* Feat: Add Gemini Embedding Support to LightRAG by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2329
* Feat: Add LLM Cache Migration Tool by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2330
* Feat: Add LLM Query Cache Cleanup Tool by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2335
* Support async chunking func to improve processing performance when a heavy `chunking_func` is passed in by user by @tongda in https://github.com/HKUDS/LightRAG/pull/2336
* Add ollama cloud support by @LacombeLouis in https://github.com/HKUDS/LightRAG/pull/2348
* Feat: Add Workspace Isolation for Pipeline Status and In-memory Storage by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2369
* feat: add vchordrq vector index support for PostgreSQL by @wmsnp in https://github.com/HKUDS/LightRAG/pull/2378
* Feat: Enhanced DOCX Extraction with Table Content Support by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2383
* Feat: Enhance XLSX Extraction by Adding Separators and Escape Special Characters by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2386
* Optimize for OpenAI Prompt Caching: Restructure entity extraction pro… by @Ghazi-raad in https://github.com/HKUDS/LightRAG/pull/2426

* feat: Vector Storage Model Isolation with Automatic Migration by @BukeLy in https://github.com/HKUDS/LightRAG/pull/2391
* feat: Implement Vector Database Model Isolation and Auto-Migration by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2513
* feat: Add Automatic Text Truncation Support for Embedding Functions by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2523

## What's Changed

* Fix: Remove Duplicate Entity/Realtion Tracking Deletion in adelete_by_doc_id by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2322
* Fix spelling errors in the "使用PostgreSQL存储" section of README-zh.md by @huangbhan in https://github.com/HKUDS/LightRAG/pull/2327
* Add dimensions parameter support to openai_embed() by @yrangana in https://github.com/HKUDS/LightRAG/pull/2323
* Fix Gemini driver retry mechanism by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2331
* HotFix: Restore OpenAI Streaming Response & Refactor keyword_extraction Parameter by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2334
* Refactor: Migrate PDF processing dependency from `pypdf2` to actively `pypdf` by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2338
* Fix: Prevent UnicodeEncodeError in JSON storage operations by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2344
* Remove deprecated response_type parameter from query settings UI by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2345
* Refactor: Optimize write_json for Memory Efficiency and Performance by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2346

* Refact: Remove blocking dependency installation from document upload handlers by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2350
* Refact: Implement Lazy Configuration Initialization for API Server by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2351
* Refact: Enhance DOCLING integration with lazy loading and macOS safeguards by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2352
* Fix: Robust error handling for async database operations in graph storage by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2356
* Update the value corresponding to the extracted entity relationship keywords by @sleeepyin in https://github.com/HKUDS/LightRAG/pull/2358
* Add macOS fork safety check for Gunicorn multi-worker mode by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2360
* Refact: Add Embedding Token Limit Configuration and Improve Error Handling by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2359
* Refact: Add Embedding Dimension Validation in EmbeddingFunc by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2368
* test: Convert test_workspace_isolation.py to pytest style by @BukeLy in https://github.com/HKUDS/LightRAG/pull/2371
* refactor(chunking): rename params and improve docstring for chunking  by @EightyOliveira in https://github.com/HKUDS/LightRAG/pull/2379
* Fix: Add chunk token limit validation with detailed error reporting by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2389
* Fix: Remove redundant exception logging to eliminate pytest shutdown errors by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2390
* issue-2394: use deployment variable instead of model for embeddings API call by @Amrit75 in https://github.com/HKUDS/LightRAG/pull/2395
* Refactor: Centralize keyword_extraction parameter handling in OpenAI LLM implementations by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2401
* Refact: Consolidate Azure OpenAI and OpenAI implementations by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2403
* Update README.md by @chaohuang-ai in https://github.com/HKUDS/LightRAG/pull/2408
* Update README.md by @chaohuang-ai in https://github.com/HKUDS/LightRAG/pull/2409
* feat: create copilot-setup-steps.yml by @netbrah in https://github.com/HKUDS/LightRAG/pull/2410

* Fix: Add Comprehensive Retry Mechanism for Neo4j Storage Operations by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2417
* Refact: Allow API Server to Start Without Built WebUI Assets by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2418
* fix:exception handling order error by @EightyOliveira in https://github.com/HKUDS/LightRAG/pull/2421
* Doc: Update README examples to prevent double-wrapping of embedding functions by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2432
* Fix: Add configurable model support for Jina embedding by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2433
* Fix typos discovered by codespell by @cclauss in https://github.com/HKUDS/LightRAG/pull/2434
* Update README.md by @chaohuang-ai in https://github.com/HKUDS/LightRAG/pull/2439
* Fix KaTeX chemistry formula rendering (\ce command) not working by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2443
* fix(postgres): Add CASCADE to AGE extension creation for automatic dependency resolution by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2446
* Add Python 3.13 and 3.14 to the testing by @cclauss in https://github.com/HKUDS/LightRAG/pull/2436
* Keep GitHub Actions up to date with GitHub's Dependabot by @cclauss in https://github.com/HKUDS/LightRAG/pull/2435
* chore: optimize Dependabot configuration with dependency grouping and PR limits by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2447
* fix: Return existing track_id for duplicate documents in document insertion endpoints by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2469
* feat: Add Cohere reranker config, chunking, and tests by @netbrah in https://github.com/HKUDS/LightRAG/pull/2411
* update to react 19.2.1 by @mccahill in https://github.com/HKUDS/LightRAG/pull/2494
* Fix links in README.md and README-zh.md by @johuellm in https://github.com/HKUDS/LightRAG/pull/2480
* fix(prompt): use language parameter in keywords_extraction prompt by @jcfneto in https://github.com/HKUDS/LightRAG/pull/2491
* feat: Update full-text index name to include workspace label for bett… by @netbrah in https://github.com/HKUDS/LightRAG/pull/2406
* HotFix:  MongoDB `__post_init__` not called and refactor embedding validation by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2521
* Fix nested EmbeddingFunc wrapping and improve embedding function safety by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2522
* fix(postgres): Handle dollar-sign sequences in Cypher queries to prevent syntax errors by @danielaskdd in https://github.com/HKUDS/LightRAG/pull/2524

## New Contributors

* @huangbhan made their first contribution in https://github.com/HKUDS/LightRAG/pull/2327
* @LacombeLouis made their first contribution in https://github.com/HKUDS/LightRAG/pull/2348
* @sleeepyin made their first contribution in https://github.com/HKUDS/LightRAG/pull/2358
* @wmsnp made their first contribution in https://github.com/HKUDS/LightRAG/pull/2378
* @EightyOliveira made their first contribution in https://github.com/HKUDS/LightRAG/pull/2379
* @Amrit75 made their first contribution in https://github.com/HKUDS/LightRAG/pull/2395
* @chaohuang-ai made their first contribution in https://github.com/HKUDS/LightRAG/pull/2408
* @netbrah made their first contribution in https://github.com/HKUDS/LightRAG/pull/2410
* @cclauss made their first contribution in https://github.com/HKUDS/LightRAG/pull/2434
* @mccahill made their first contribution in https://github.com/HKUDS/LightRAG/pull/2494
* @johuellm made their first contribution in https://github.com/HKUDS/LightRAG/pull/2480
* @Ghazi-raad made their first contribution in https://github.com/HKUDS/LightRAG/pull/2426
* @jcfneto made their first contribution in https://github.com/HKUDS/LightRAG/pull/2491

**Full Changelog**: https://github.com/HKUDS/LightRAG/compare/v1.4.9.8...v1.4.9.9