diff --git a/lightrag/kg/postgres_impl.py b/lightrag/kg/postgres_impl.py index 95d890ba..dab0d652 100644 --- a/lightrag/kg/postgres_impl.py +++ b/lightrag/kg/postgres_impl.py @@ -1100,11 +1100,14 @@ class PGGraphStorage(BaseGraphStorage): elif dtype == "edge": d[k] = json.loads(v) else: - d[k] = ( - json.loads(v) - if isinstance(v, str) and ("{" in v or "[" in v) - else v - ) + try: + d[k] = ( + json.loads(v) + if isinstance(v, str) and (v.startswith("{") or v.startswith("[")) + else v + ) + except json.JSONDecodeError: + d[k] = v return d