diff --git a/src/basic_memory/api/routers/utils.py b/src/basic_memory/api/routers/utils.py index 82aa173b4..f7ce922a1 100644 --- a/src/basic_memory/api/routers/utils.py +++ b/src/basic_memory/api/routers/utils.py @@ -52,7 +52,7 @@ async def to_summary(item: SearchIndexRow | ContextResultRow): file_path=item.file_path, permalink=item.permalink, # pyright: ignore relation_type=item.relation_type, # pyright: ignore - from_entity=from_entity.title, # pyright: ignore + from_entity=from_entity.title if from_entity else None, to_entity=to_entity.title if to_entity else None, created_at=item.created_at, ) diff --git a/src/basic_memory/schemas/memory.py b/src/basic_memory/schemas/memory.py index b16a7c750..34e51df1a 100644 --- a/src/basic_memory/schemas/memory.py +++ b/src/basic_memory/schemas/memory.py @@ -134,7 +134,7 @@ class RelationSummary(BaseModel): file_path: str permalink: str relation_type: str - from_entity: str + from_entity: Optional[str] = None to_entity: Optional[str] = None created_at: datetime