@@ -125,7 +125,7 @@ class EntitySummary(BaseModel):
125125
126126 type : Literal ["entity" ] = "entity"
127127 external_id : str # UUID for v2 API routing
128- entity_id : int # Database ID for v2 API consistency
128+ entity_id : Optional [ int ] = Field ( None , exclude = True ) # Internal DB ID
129129 permalink : Optional [str ]
130130 title : str
131131 content : Optional [str ] = None
@@ -143,18 +143,18 @@ class RelationSummary(BaseModel):
143143 """Simplified relation representation."""
144144
145145 type : Literal ["relation" ] = "relation"
146- relation_id : int # Database ID for v2 API consistency
147- entity_id : Optional [int ] = None # ID of the entity this relation belongs to
146+ relation_id : Optional [ int ] = Field ( None , exclude = True ) # Internal DB ID
147+ entity_id : Optional [int ] = Field ( None , exclude = True ) # Internal FK
148148 title : str
149149 file_path : str
150150 permalink : str
151151 relation_type : str
152152 from_entity : Optional [str ] = None
153- from_entity_id : Optional [int ] = None # ID of source entity
154- from_entity_external_id : Optional [str ] = None # UUID of source entity for v2 API routing
153+ from_entity_id : Optional [int ] = Field ( None , exclude = True ) # Internal FK
154+ from_entity_external_id : Optional [str ] = Field ( None , exclude = True ) # Internal routing ID
155155 to_entity : Optional [str ] = None
156- to_entity_id : Optional [int ] = None # ID of target entity
157- to_entity_external_id : Optional [str ] = None # UUID of target entity for v2 API routing
156+ to_entity_id : Optional [int ] = Field ( None , exclude = True ) # Internal FK
157+ to_entity_external_id : Optional [str ] = Field ( None , exclude = True ) # Internal routing ID
158158 created_at : Annotated [
159159 datetime , Field (json_schema_extra = {"type" : "string" , "format" : "date-time" })
160160 ]
@@ -168,10 +168,10 @@ class ObservationSummary(BaseModel):
168168 """Simplified observation representation."""
169169
170170 type : Literal ["observation" ] = "observation"
171- observation_id : int # Database ID for v2 API consistency
172- entity_id : Optional [int ] = None # ID of the entity this observation belongs to
173- entity_external_id : Optional [str ] = None # UUID of parent entity for v2 API routing
174- title : str
171+ observation_id : Optional [ int ] = Field ( None , exclude = True ) # Internal DB ID
172+ entity_id : Optional [int ] = Field ( None , exclude = True ) # Internal FK
173+ entity_external_id : Optional [str ] = Field ( None , exclude = True ) # Internal routing ID
174+ title : Optional [ str ] = Field ( None , exclude = True ) # Redundant with parent entity
175175 file_path : str
176176 permalink : str
177177 category : str
@@ -192,19 +192,13 @@ class MemoryMetadata(BaseModel):
192192 types : Optional [List [SearchItemType ]] = None
193193 depth : int
194194 timeframe : Optional [str ] = None
195- generated_at : Annotated [
196- datetime , Field (json_schema_extra = {"type" : "string" , "format" : "date-time" })
197- ]
195+ generated_at : Optional [datetime ] = Field (None , exclude = True ) # Internal timing
198196 primary_count : Optional [int ] = None # Changed field name
199197 related_count : Optional [int ] = None # Changed field name
200- total_results : Optional [int ] = None # For backward compatibility
198+ total_results : Optional [int ] = Field ( None , exclude = True ) # Internal counter
201199 total_relations : Optional [int ] = None
202200 total_observations : Optional [int ] = None
203201
204- @field_serializer ("generated_at" )
205- def serialize_generated_at (self , dt : datetime ) -> str :
206- return dt .isoformat ()
207-
208202
209203class ContextResult (BaseModel ):
210204 """Context result containing a primary item with its observations and related items."""
0 commit comments