Commit graph

287 commits

Author SHA1 Message Date
Raphaël MANSUY
78c1c69b0a cherry-pick be9e6d16 2025-12-04 19:18:16 +08:00
Raphaël MANSUY
3bba440cfb cherry-pick e1af1c6d (resolved) 2025-12-04 19:17:47 +08:00
Raphaël MANSUY
ef5c1c964c cherry-pick 8a009899 (resolved) 2025-12-04 19:17:47 +08:00
Raphaël MANSUY
f2b2d0d6af cherry-pick d473f635 (resolved) 2025-12-04 19:17:46 +08:00
Raphaël MANSUY
96e23ad2eb cherry-pick b5f83767 2025-12-04 19:17:46 +08:00
Raphaël MANSUY
2493909a2c cherry-pick 1574fec7 (resolved) 2025-12-04 19:17:46 +08:00
Raphaël MANSUY
bf034801f5 cherry-pick cec784f6 2025-12-04 19:17:45 +08:00
Raphaël MANSUY
afb039bec6 cherry-pick a250d881 (resolved) 2025-12-04 19:17:45 +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
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
f43eb00e6c Update webui assets 2025-09-26 20:06:08 +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
6e3aa2092b Update webui assets and bump API version to 0230 2025-09-25 06:28:18 +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
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
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
yangdx
0268768ecd Update webassets and bump API version to 0227 2025-09-22 13:03:27 +08:00
yangdx
b13209e241 Update webui assets 2025-09-22 03:04:06 +08:00
yangdx
0fcb5af333 Update webui assets and bump API version to 0227 2025-09-22 02:02:42 +08:00
yangdx
938eced0de Udate webui assets 2025-09-21 01:19:28 +08:00
yangdx
c2985429ba Update webui assets 2025-09-21 00:32:06 +08:00
yangdx
9e0dabc34d Update webui assets 2025-09-20 23:31:00 +08:00
yangdx
5e0ef7166e Update webui assets and bump api version to 0226 2025-09-20 22:47:45 +08:00
yangdx
3b502af858 Update webui assets 2025-09-20 14:36:34 +08:00
yangdx
b897eedaef Update webui assets and bump API version to 0225 2025-09-20 12:41:52 +08:00
yangdx
361ea5b069 Update webui assets 2025-09-19 15:17:27 +08:00
yangdx
fdf8b176ad Update webui assets 2025-09-17 02:05:26 +08:00
yangdx
dac156ac8e Update webui assets 2025-09-17 01:53:26 +08:00
yangdx
050a00b693 Update webui assets 2025-09-16 17:33:05 +08:00
yangdx
419f4f0268 Update web assets 2025-09-14 02:31:42 +08:00
yangdx
564850aa9d Update webui assets and bump api version to 0218 2025-09-09 11:41:02 +08:00
yangdx
6157318408 Update webui assets and bump api to 0217 2025-09-08 23:37:34 +08:00
yangdx
56df4ac4b1 Update webui assets and bump api version to 0216 2025-09-08 19:36:49 +08:00