Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
Use MutableJSON instead of JSONB type for metadata
Sarah Woodersb8a82b95695c
diff --git a/memgpt/connectors/db.py b/memgpt/connectors/db.pyindex 8ac6ba30d..c22361995 100644--- a/memgpt/connectors/db.py+++ b/memgpt/connectors/db.py@@ -11,7 +11,7 @@ from sqlalchemy.ext.declarative import declarative_basefrom sqlalchemy.sql import funcfrom sqlalchemy import Column, BIGINT, String, DateTimefrom sqlalchemy.dialects.postgresql import JSONB, UUID-from sqlalchemy_json import mutable_json_type+from sqlalchemy_json import mutable_json_type, MutableJsonfrom sqlalchemy import TypeDecorator, CHARimport uuid@@ -78,7 +78,8 @@ def get_db_model(table_name: str, table_type: TableType):agent_id = Column(String)data_source = Column(String) # agent_name if agent, data_source name if from data sourceembedding = mapped_column(Vector(config.embedding_dim))- metadata_ = Column(mutable_json_type(dbtype=JSONB, nested=True))+ # metadata_ = Column(mutable_json_type(dbtype=JSONB, nested=True)) # more performance, but not supported for sqlite+ metadata_ = Column(MutableJson)def __repr__(self):return f"<Passage(passage_id='{self.id}', text='{self.text}', embedding='{self.embedding})>"