225 Commits

Author SHA1 Message Date
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
19a38d9310 Feat: add PostgreSQL extensions for vector and AGE
- Ensure VECTOR extension is available when PostgreSQL init
- Ensure AGE extension is available when PGGraphStorage init
2025-07-21 01:46:41 +08:00
yangdx
f033fd6f87 fix(postgres): improve AGE agtype parsing and simplify error logging
- Fix JSON parsing errors caused by :: characters in data content
- Implement precise agtype string parsing using rfind() to separate JSON content from type identifiers
- Add robust error handling for malformed JSON in graph data
2025-07-18 08:50:47 +08:00
yangdx
57c8c19628 Add datetime format migration for doc status table 2025-07-16 22:21:51 +08:00
yangdx
c7b566f6d5 Fix cache migration MD5 error for PostgreSQL 2025-07-16 19:24:57 +08:00
yangdx
80f7e37168 Fix default workspace name for PostgreSQL AGE graph storage 2025-07-16 19:16:22 +08:00
yangdx
bab2803953 Optimize PostgreSQL database migrations for LLM cache
- Combine column migration into single operation
- Optimize LLM cache key migration query
- Improve migration error handling
- Add conflict detection for cache migration
2025-07-16 17:32:53 +08:00
yangdx
bd340fece6 Fix timestamp column migration comment typos
- Correct timezone-related comments
- Fix typo in debug log message
- Update migration success message
- Maintain same migration logic
2025-07-16 14:27:52 +08:00
yangdx
7e988158a9 Fix: Resolve timezone handling problem in PostgreSQL storage
- Changed timestamp columns to naive UTC
- Added datetime formatting utilities
- Updated SQL templates for timestamp extraction
- Simplified timestamp migration logic
2025-07-14 04:12:52 +08:00
yangdx
157fb4c871 Increase field lengths for entity and file paths for PostgreSQL
- Expand entity_name length to 512 chars
- Increase source/target ID lengths
- Convert file_path to TEXT type
- Add migration logic
2025-07-14 00:24:54 +08:00
yangdx
ef79088f60 Move max_graph_nodes to global config 2025-07-07 21:53:57 +08:00
yangdx
da8655002a Add composite indexes for workspace+id columns for PostgreSQL 2025-07-07 03:36:49 +08:00
yangdx
033098c1bc Feat: Add WORKSPACE support to all storage types 2025-07-07 00:57:21 +08:00
yangdx
531502677e fix: Use create_time when update_time is 0 in PGKVStorage queries 2025-07-03 23:38:53 +08:00
yangdx
6c2ae40d7d Refac: Enhance KG rebuild stability by incorporating create_time into the LLM cache 2025-07-03 17:08:29 +08:00
yangdx
70e154b0aa Fix linting 2025-07-03 12:26:05 +08:00
yangdx
ff1b1c61c7 Implemented storage types: PostgreSQL and MongoDB 2025-07-03 11:46:24 +08:00
yangdx
86c9a0cda2 Fix linting 2025-07-02 16:29:43 +08:00
yangdx
271722405f feat: Flatten LLM cache structure for improved recall efficiency
Refactored the LLM cache to a flat Key-Value (KV) structure, replacing the previous nested format. The old structure used the 'mode' as a key and stored specific cache content as JSON nested under it. This change significantly enhances cache recall efficiency.
2025-07-02 16:11:53 +08:00
yangdx
37bf341a69 Fix LLM cache handling for PGKVStorage to address document deletion scenarios.
- Add dynamic cache_type field
- Support mode parameter for LLM cache
- Maintain backward compatibility
2025-06-29 14:39:50 +08:00
yangdx
b7f8c20e61 fix(postgres): use correct table for vector queries
Change SQL templates from LIGHTRAG_DOC_CHUNKS to LIGHTRAG_VDB_CHUNKS
to fix "content_vector does not exist" error in vector operations.
2025-06-28 15:36:54 +08:00
yangdx
2c47367975 Fix linting 2025-06-28 14:37:55 +08:00
yangdx
95c7a7d038 feat(db): Add data migration from LIGHTRAG_DOC_CHUNKS to LIGHTRAG_VDB_CHUNKS 2025-06-28 14:37:47 +08:00
yangdx
3a8a99b73d feat(postgres): Implement text_chunks upsert for PGKVStorage 2025-06-28 14:37:35 +08:00
yangdx
72384f87c4 Remove deprecated code from Postgres_impl.py
- Stop filtering out 'base' node labels
- Match any edge type in query to improve performance
2025-06-25 12:53:07 +08:00
yangdx
109c2b48be Fix linting 2025-06-25 12:39:43 +08:00
yangdx
da46b341dc feat: Optimize document deletion performance
- To enhance performance during document deletion, new batch-get methods, `get_nodes_by_chunk_ids` and `get_edges_by_chunk_ids`, have been added to the graph storage layer (`BaseGraphStorage` and its implementations). The [`adelete_by_doc_id`](lightrag/lightrag.py:1681) function now leverages these methods to avoid unnecessary iteration over the entire knowledge graph, significantly improving efficiency.
- Graph storage updated: Networkx, Neo4j, Postgres AGE
2025-06-25 12:37:57 +08:00
yangdx
cc12460b38 Fix: Silence PostgreSQL logs during idempotent graph initialization 2025-06-23 23:08:56 +08:00
zrguo
4937de8809 Update 2025-06-22 15:12:09 +08:00
yangdx
ada2443653 Optimize default setting of PostgreSQL 2025-05-22 17:09:26 +08:00
yangdx
2ee809cf58 Increase PG connection pool to 20 2025-05-22 16:37:18 +08:00
yangdx
ebdc7cea49 Merge branch 'allow_max_connection_config' into pg-max-connection 2025-05-09 14:16:53 +08:00
Arjun Rao
6ebd76d5da bugfix: convert config val to int 2025-05-09 04:22:46 +10:00
Arjun Rao
f2c522ce7a Allow max_connections to be configured in postgres 2025-05-08 11:00:56 +10:00
widgit
e070c19414
Update postgres_impl.py
Was missing , on the SQL Table create command
2025-05-05 23:55:19 +10:00
yangdx
e46a4b2079 Optimize log message 2025-05-04 22:31:57 +08:00
yangdx
9a41de51fb Optimize log message 2025-05-04 22:20:44 +08:00
yangdx
dcb2a72462 Fix JSON handling error for PostgreSQL graph storage 2025-05-04 22:18:56 +08:00
yangdx
1213f53fc9 Fix mistakenly interpreting a string as JSON for PostgreSQL AGE graph storage 2025-05-04 02:20:43 +08:00
yangdx
045993f7d2 Remove deprecated search_by_prefix 2025-05-03 11:17:49 +08:00
yangdx
81071df982 Fix timezone bugs for PostgreSQL vector storage 2025-05-03 00:44:55 +08:00
yangdx
1b049b4214 Fix time handling bugs for PostgreSQL 2025-05-01 15:13:42 +08:00
yangdx
36f8787bc7 Fix linting 2025-05-01 10:04:31 +08:00
yangdx
950d42c527 Store utc time in PostgreSQL 2025-05-01 10:04:17 +08:00
yangdx
ca63386546 Increase embeding priority for query request 2025-04-28 20:10:39 +08:00
yangdx
90cacdbcc3 Fix file_path missing in acreate_entity and acreate_relation 2025-04-26 22:15:54 +08:00
yangdx
04ebcbebd0 Translate comments to English 2025-04-25 21:54:04 +08:00
yangdx
5eb019a7fc Fix max_nodes not working in graph queries when using the '*' wildcard. 2025-04-25 21:25:37 +08:00
yangdx
e3c87dd6bd Improve graph query speed by batch operation 2025-04-25 16:55:47 +08:00
yangdx
5ca430adcd Fix graph query problem of PostgresSQL AGE 2025-04-25 16:04:41 +08:00