Commit graph

27 commits

Author SHA1 Message Date
clssck
59e89772de refactor: consolidate to PostgreSQL-only backend and modernize stack
Remove legacy storage implementations and deprecated examples:
- Delete FAISS, JSON, Memgraph, Milvus, MongoDB, Nano Vector DB, Neo4j, NetworkX, Qdrant, Redis storage backends
- Remove Kubernetes deployment manifests and installation scripts
- Delete unofficial examples for deprecated backends and offline deployment docs
Streamline core infrastructure:
- Consolidate storage layer to PostgreSQL-only implementation
- Add full-text search caching with FTS cache module
- Implement metrics collection and monitoring pipeline
- Add explain and metrics API routes
Modernize frontend and tooling:
- Switch web UI to Bun with bun.lock, remove npm and pnpm lockfiles
- Update Dockerfile for PostgreSQL-only deployment
- Add Makefile for common development tasks
- Update environment and configuration examples
Enhance evaluation and testing capabilities:
- Add prompt optimization with DSPy and auto-tuning
- Implement ground truth regeneration and variant testing
- Add prompt debugging and response comparison utilities
- Expand test coverage with new integration scenarios
Simplify dependencies and configuration:
- Remove offline-specific requirement files
- Update pyproject.toml with streamlined dependencies
- Add Python version pinning with .python-version
- Create project guidelines in CLAUDE.md and AGENTS.md
2025-12-12 16:28:49 +01:00
clssck
dd1413f3eb test(lightrag,examples): add prompt accuracy and quality tests
Add comprehensive test suites for prompt evaluation:
- test_prompt_accuracy.py: 365 lines testing prompt extraction accuracy
- test_prompt_quality_deep.py: 672 lines for deep quality analysis
- Refactor prompt.py to consolidate optimized variants (removed prompt_optimized.py)
- Apply ruff formatting and type hints across 30 files
- Update pyrightconfig.json for static type checking
- Modernize reproduce scripts and examples with improved type annotations
- Sync uv.lock dependencies
2025-12-05 16:39:52 +01:00
clssck
69358d830d test(lightrag,examples,api): comprehensive ruff formatting and type hints
Format entire codebase with ruff and add type hints across all modules:
- Apply ruff formatting to all Python files (121 files, 17K insertions)
- Add type hints to function signatures throughout lightrag core and API
- Update test suite with improved type annotations and docstrings
- Add pyrightconfig.json for static type checking configuration
- Create prompt_optimized.py and test_extraction_prompt_ab.py test files
- Update ruff.toml and .gitignore for improved linting configuration
- Standardize code style across examples, reproduce scripts, and utilities
2025-12-05 15:17:06 +01:00
clssck
a6b87df758 feat(postgres): add bulk operations and health check
- Implement bulk upsert_nodes/edges via UNWIND reducing round trips
- Add health_check for graph connectivity and AGE catalog status
- Switch to parameterized queries preventing Cypher injection
- Fix node ID sanitization: strip control chars, escape quotes
2025-12-03 18:19:26 +00:00
yangdx
9a8742da59 Improve entity merge logging by removing redundant message and fixing typo 2025-10-31 17:16:59 +08:00
yangdx
6b4514c8ef Reduce logging verbosity in entity merge relation processing 2025-10-31 17:02:10 +08:00
yangdx
ea006bd386 Fix entity update logic to handle renaming operations
- Add is_renaming condition check
- Ensure updates when entity renamed
2025-10-28 00:12:23 +08:00
yangdx
5155edd8d2 feat: Improve entity merge and edit UX
- **API:** The `graph/entity/edit` endpoint now returns a detailed `operation_summary` for better client-side handling of update, rename, and merge outcomes.
- **Web UI:** Added an "auto-merge on rename" option. The UI now gracefully handles merge success, partial failures (update OK, merge fail), and other errors with specific user feedback.
2025-10-27 23:42:08 +08:00
yangdx
11a1631d76 Refactor entity edit and merge functions to support merge-on-rename
• Extract internal implementation helpers
• Add allow_merge parameter to aedit_entity
• Support merging when renaming to existing name
• Improve code reusability and modularity
• Maintain backward compatibility
2025-10-27 14:23:51 +08:00
yangdx
8dfd3bf428 Replace global graph DB lock with fine-grained keyed locking
• Use entity/relation-specific locks
• Lock multiple entities when needed
2025-10-27 02:55:58 +08:00
yangdx
2c09adb8d3 Add chunk tracking support to entity merge functionality
- Pass chunk storages to merge function
- Merge relation chunk tracking data
- Merge entity chunk tracking data
- Delete old chunk tracking records
- Persist chunk storage updates
2025-10-27 02:06:21 +08:00
yangdx
a25003c336 Fix relation deduplication logic and standardize log message prefixes 2025-10-27 00:52:56 +08:00
yangdx
ab32456a79 Refactor entity merging with unified attribute merge function
• Update GRAPH_FIELD_SEP comment clarity
• Deprecate merge_strategy parameter
• Unify entity/relation merge logic
• Add join_unique_comma strategy
2025-10-27 00:04:17 +08:00
yangdx
38559373b3 Fix entity merging to include target entity relationships
* Include target entity in collection
* Merge all relevant relationships
* Prevent relationship loss
* Fix merge completeness
2025-10-26 23:13:50 +08:00
yangdx
6015e8bc68 Refactor graph utils to use unified persistence callback
- Add _persist_graph_updates function
- Remove duplicate callback functions
2025-10-26 20:20:16 +08:00
yangdx
a3370b024d Add chunk tracking cleanup to entity/relation deletion and creation
• Clean up chunk storage on delete
• Track chunks in create operations
• Normalize relation keys consistently
2025-10-26 17:06:16 +08:00
yangdx
bf1897a67e Normalize entity order for undirected graph consistency
• Normalize entity pairs for storage
• Update API docs for undirected edges
2025-10-26 15:53:31 +08:00
yangdx
3fbd704bf9 Enhance entity/relation editing with chunk tracking synchronization
• Add chunk storage sync to edit ops
• Implement incremental chunk ID updates
• Support entity renaming migrations
• Normalize relation keys consistently
• Preserve chunk references on edits
2025-10-26 14:34:56 +08:00
Moddy Surala
319d12bb6a Fix GRAPH_FIELD_SEP import typo 2025-06-29 01:28:39 +05:00
yangdx
e6baffe10c Add retrun status to entity and relation delete operations 2025-06-23 21:39:45 +08:00
yangdx
1697ea4bf6 Fix linting 2025-06-23 19:20:35 +08:00
yangdx
f60bad92f0 Fix: Delete relations from vector DB in both directions 2025-06-23 19:20:10 +08:00
zrguo
40b10e8fcf Update insert_custom_kg 2025-05-27 16:07:04 +08:00
yangdx
90cacdbcc3 Fix file_path missing in acreate_entity and acreate_relation 2025-04-26 22:15:54 +08:00
yangdx
c834570cfc Fix import error 2025-04-14 12:36:41 +08:00
yangdx
5c1d4201f9 Fix linting 2025-04-14 12:08:56 +08:00
yangdx
89d1e68d97 Move graph edit function implemention to a utils_graph.py to educe the size of lightray.py 2025-04-14 03:06:23 +08:00