Commit graph

1157 commits

Author SHA1 Message Date
yangdx
ed46d375fb Auto-initialize pipeline status in LightRAG.initialize_storages()
• Remove manual initialize_pipeline_status calls
• Auto-init in initialize_storages method
• Update error messages for clarity
• Warn on workspace conflicts

(cherry picked from commit e22ac52ebc)
2025-12-04 19:09:05 +08:00
yangdx
db508954d1 Add uv package manager support to installation docs
(cherry picked from commit 7bc6ccea19)
2025-12-04 19:09:04 +08:00
yangdx
407a2c2ecd Remove redundant shutdown message from gunicorn
(cherry picked from commit 6d4a55100e)
2025-12-04 19:09:02 +08:00
Anush008
e86aa091f4 refactor: Qdrant Multi-tenancy (Include staged)
Signed-off-by: Anush008 <anushshetty90@gmail.com>
(cherry picked from commit 8584980e3a)
2025-12-04 19:09:01 +08:00
yangdx
b0bdbb5839 Add offline deployment support with cache management and layered deps
• Add tiktoken cache downloader CLI
• Add layered offline dependencies
• Add offline requirements files
• Add offline deployment guide

(cherry picked from commit a5c05f1b92)
2025-12-04 19:07:09 +08:00
Raphael MANSUY
fe9b8ec02a
tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4)
* feat: Implement multi-tenant architecture with tenant and knowledge base models

- Added data models for tenants, knowledge bases, and related configurations.
- Introduced role and permission management for users in the multi-tenant system.
- Created a service layer for managing tenants and knowledge bases, including CRUD operations.
- Developed a tenant-aware instance manager for LightRAG with caching and isolation features.
- Added a migration script to transition existing workspace-based deployments to the new multi-tenant architecture.

* chore: ignore lightrag/api/webui/assets/ directory

* chore: stop tracking lightrag/api/webui/assets (ignore in .gitignore)

* feat: Initialize LightRAG Multi-Tenant Stack with PostgreSQL

- Added README.md for project overview, setup instructions, and architecture details.
- Created docker-compose.yml to define services: PostgreSQL, Redis, LightRAG API, and Web UI.
- Introduced env.example for environment variable configuration.
- Implemented init-postgres.sql for PostgreSQL schema initialization with multi-tenant support.
- Added reproduce_issue.py for testing default tenant access via API.

* feat: Enhance TenantSelector and update related components for improved multi-tenant support

* feat: Enhance testing capabilities and update documentation

- Updated Makefile to include new test commands for various modes (compatibility, isolation, multi-tenant, security, coverage, and dry-run).
- Modified API health check endpoint in Makefile to reflect new port configuration.
- Updated QUICK_START.md and README.md to reflect changes in service URLs and ports.
- Added environment variables for testing modes in env.example.
- Introduced run_all_tests.sh script to automate testing across different modes.
- Created conftest.py for pytest configuration, including database fixtures and mock services.
- Implemented database helper functions for streamlined database operations in tests.
- Added test collection hooks to skip tests based on the current MULTITENANT_MODE.

* feat: Implement multi-tenant support with demo mode enabled by default

- Added multi-tenant configuration to the environment and Docker setup.
- Created pre-configured demo tenants (acme-corp and techstart) for testing.
- Updated API endpoints to support tenant-specific data access.
- Enhanced Makefile commands for better service management and database operations.
- Introduced user-tenant membership system with role-based access control.
- Added comprehensive documentation for multi-tenant setup and usage.
- Fixed issues with document visibility in multi-tenant environments.
- Implemented necessary database migrations for user memberships and legacy support.

* feat(audit): Add final audit report for multi-tenant implementation

- Documented overall assessment, architecture overview, test results, security findings, and recommendations.
- Included detailed findings on critical security issues and architectural concerns.

fix(security): Implement security fixes based on audit findings

- Removed global RAG fallback and enforced strict tenant context.
- Configured super-admin access and required user authentication for tenant access.
- Cleared localStorage on logout and improved error handling in WebUI.

chore(logs): Create task logs for audit and security fixes implementation

- Documented actions, decisions, and next steps for both audit and security fixes.
- Summarized test results and remaining recommendations.

chore(scripts): Enhance development stack management scripts

- Added scripts for cleaning, starting, and stopping the development stack.
- Improved output messages and ensured graceful shutdown of services.

feat(starter): Initialize PostgreSQL with AGE extension support

- Created initialization scripts for PostgreSQL extensions including uuid-ossp, vector, and AGE.
- Ensured successful installation and verification of extensions.

* feat: Implement auto-select for first tenant and KB on initial load in WebUI

- Removed WEBUI_INITIAL_STATE_FIX.md as the issue is resolved.
- Added useTenantInitialization hook to automatically select the first available tenant and KB on app load.
- Integrated the new hook into the Root component of the WebUI.
- Updated RetrievalTesting component to ensure a KB is selected before allowing user interaction.
- Created end-to-end tests for multi-tenant isolation and real service interactions.
- Added scripts for starting, stopping, and cleaning the development stack.
- Enhanced API and tenant routes to support tenant-specific pipeline status initialization.
- Updated constants for backend URL to reflect the correct port.
- Improved error handling and logging in various components.

* feat: Add multi-tenant support with enhanced E2E testing scripts and client functionality

* update client

* Add integration and unit tests for multi-tenant API, models, security, and storage

- Implement integration tests for tenant and knowledge base management endpoints in `test_tenant_api_routes.py`.
- Create unit tests for tenant isolation, model validation, and role permissions in `test_tenant_models.py`.
- Add security tests to enforce role-based permissions and context validation in `test_tenant_security.py`.
- Develop tests for tenant-aware storage operations and context isolation in `test_tenant_storage_phase3.py`.

* feat(e2e): Implement OpenAI model support and database reset functionality

* Add comprehensive test suite for gpt-5-nano compatibility

- Introduced tests for parameter normalization, embeddings, and entity extraction.
- Implemented direct API testing for gpt-5-nano.
- Validated .env configuration loading and OpenAI API connectivity.
- Analyzed reasoning token overhead with various token limits.
- Documented test procedures and expected outcomes in README files.
- Ensured all tests pass for production readiness.

* kg(postgres_impl): ensure AGE extension is loaded in session and configure graph initialization

* dev: add hybrid dev helper scripts, Makefile, docker-compose.dev-db and local development docs

* feat(dev): add dev helper scripts and local development documentation for hybrid setup

* feat(multi-tenant): add detailed specifications and logs for multi-tenant improvements, including UX, backend handling, and ingestion pipeline

* feat(migration): add generated tenant/kb columns, indexes, triggers; drop unused tables; update schema and docs

* test(backward-compat): adapt tests to new StorageNameSpace/TenantService APIs (use concrete dummy storages)

* chore: multi-tenant and UX updates — docs, webui, storage, tenant service adjustments

* tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency

- gpt5_nano_compatibility: add pytest-asyncio markers, skip when OPENAI key missing, prevent module-level asyncio.run collection, add conftest
- Ollama tests: add server availability check and skip markers; avoid pytest collection warnings by renaming helper classes
- Graph storage tests: rename interactive test functions to avoid pytest collection
- Document & Tenant routes: support external_ids for idempotency; ensure HTTPExceptions are re-raised
- LightRAG core: support external_ids in apipeline_enqueue_documents and idempotent logic
- Tests updated to match API changes (tenant routes & document routes)
- Add logs and scripts for inspection and audit
2025-12-04 16:04:21 +08:00
yangdx
df43afc89b Relax conversation history role validation requirements
• Remove strict role value checking
• Allow any non-empty string roles
2025-09-29 13:10:15 +08:00
yangdx
ba216787c1 Update webui assets 2025-09-28 22:51:06 +08:00
yangdx
6e3e67fc24 Update webui assets 2025-09-28 21:34:09 +08:00
yangdx
81bc1ba025 Update webui assets and bump API version to 0235 2025-09-28 21:05:40 +08:00
yangdx
978f154680 Update webui assets and bump API version to 0234 2025-09-28 15:14:05 +08:00
yangdx
7cba458f22 Limit deprecated documents endpoint to 1000 records with fair distribution 2025-09-28 11:18:10 +08:00
yangdx
fcbab77613 docs: add API key usage example and security guidance 2025-09-28 10:56:52 +08:00
yangdx
91be53ffd2 Fix linting 2025-09-27 22:36:38 +08:00
yangdx
e0ac05db90 Simplify query route documentation and clarify conversation history 2025-09-27 22:36:16 +08:00
yangdx
f66a0aad8b Update query streaming endpoint docs to clarify behavior 2025-09-27 22:27:49 +08:00
yangdx
3ca2165c69 Bump API version to 0233 2025-09-27 15:31:30 +08:00
yangdx
e7948df541 Fix linting 2025-09-27 15:13:07 +08:00
yangdx
1766cddd6c Fix mode parameter serialization error in Ollama chat API
• Use mode.value for API requests
• Add debug logging in aquery_llm
2025-09-27 15:11:51 +08:00
yangdx
81caee3498 Enhance query API with streaming control and comprehensive documentation
- Add stream parameter to QueryRequest
- Support non-streaming in /query/stream
- Add detailed OpenAPI response schemas
- Expand endpoint documentation
- Include usage examples and error handling
2025-09-27 11:53:31 +08:00
yangdx
f43eb00e6c Update webui assets 2025-09-26 20:06:08 +08:00
yangdx
a528213210 Fix logging filter logic
• Fix boolean operator precedence in filter
• Consolidate GET/POST condition logic
2025-09-26 19:42:33 +08:00
yangdx
3ba06478a8 fix http log message order for streaming respond
- Move aquery_llm call outside generator
- Execute query before stream starts
2025-09-26 19:27:44 +08:00
yangdx
8cd4139cbf refactor: fix double query problem by add aquery_llm function for consistent response handling
- Add new aquery_llm/query_llm methods providing structured responses
- Consolidate /query and /query/stream endpoints to use unified aquery_llm
- Optimize cache handling by moving cache checks before LLM calls
2025-09-26 19:05:03 +08:00
yangdx
862026905a Update webui assets and bump AIP version to 0232 2025-09-26 13:15:21 +08:00
yangdx
b6b4baff21 Update webui assets 2025-09-25 19:05:51 +08:00
yangdx
2a4c12cc56 Update webui assets 2025-09-25 18:01:49 +08:00
yangdx
9e59339110 Bump API version to 0231 2025-09-25 16:57:13 +08:00
yangdx
b848ca49e6 Fix linting 2025-09-25 16:22:00 +08:00
yangdx
b08b8a6a6a Add reference list support to query API endpoints with unified result handling
• 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
2025-09-25 16:21:42 +08:00
yangdx
6e3aa2092b Update webui assets and bump API version to 0230 2025-09-25 06:28:18 +08:00
yangdx
699ca3ba00 Remove deprecated history_turns and ids parameters from query API endpoint
• Update QueryParam documentation
• Mark history_turns as deprecated
• Clean up splash screen display
• Clarify conversation_history usage
2025-09-25 04:58:57 +08:00
yangdx
625e4c686c Update webui assets 2025-09-25 01:49:35 +08:00
yangdx
09bdf2c028 Update webui assets 2025-09-25 00:18:39 +08:00
yangdx
1381575db8 Update webui assets 2025-09-24 23:29:00 +08:00
yangdx
7aeeaa56a8 Update webui assets 2025-09-24 23:12:25 +08:00
yangdx
2208151b82 Update webui assets 2025-09-24 22:32:31 +08:00
yangdx
810493b7c9 Update webui assets and bump API version to 0229 2025-09-24 22:16:59 +08:00
yangdx
5eb4a4b799 feat: simplify citations, add reference merging, and restructure API response format 2025-09-24 14:30:10 +08:00
yangdx
18968c6b6b Update webui assets 2025-09-23 23:46:17 +08:00
yangdx
8a49f968b2 Update webui assets 2025-09-23 23:45:12 +08:00
yangdx
3591cb69b5 Update webui assets 2025-09-23 23:16:26 +08:00
yangdx
6a599680ec Update webui assets 2025-09-23 22:41:43 +08:00
yangdx
c9c691384b Update webui assets 2025-09-23 22:33:47 +08:00
yangdx
faa65d39c3 Update webui assets 2025-09-23 22:28:54 +08:00
yangdx
2adb8efdc7 Add duplicate document detection and skip processed files in scanning
- 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
2025-09-23 17:30:54 +08:00
yangdx
6b953fa53d Remove auto-scan-at-startup feature and related documentation
• Remove --auto-scan-at-startup arg
• Delete auto scan docs sections
• Remove startup scanning logic
2025-09-23 16:24:53 +08:00
yangdx
fc15e9f142 Update webui assets 2025-09-23 13:25:11 +08:00
yangdx
8093bfb5a3 Update webui assets 2025-09-23 13:12:00 +08:00
yangdx
20802b1ee6 Update webui assets 2025-09-22 15:16:23 +08:00