Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
feat: remove relationship fields on identities (#5691)
cthomas5e4329143638
diff --git a/fern/openapi.json b/fern/openapi.jsonindex e5d55c24b..694964aae 100644--- a/fern/openapi.json+++ b/fern/openapi.json@@ -22962,7 +22962,8 @@},"type": "array","title": "Agent Ids",- "description": "The IDs of the agents associated with the identity."+ "description": "The IDs of the agents associated with the identity.",+ "deprecated": true},"block_ids": {"items": {@@ -22970,7 +22971,8 @@},"type": "array","title": "Block Ids",- "description": "The IDs of the blocks associated with the identity."+ "description": "The IDs of the blocks associated with the identity.",+ "deprecated": true},"properties": {"items": {diff --git a/letta/orm/agent.py b/letta/orm/agent.pyindex 7f5e1c625..fc1f17a88 100644--- a/letta/orm/agent.py+++ b/letta/orm/agent.py@@ -412,7 +412,7 @@ class Agent(SqlalchemyBase, OrganizationMixin, ProjectMixin, TemplateEntityMixin)state["blocks"] = [m.to_pydantic() for m in memory]state["identity_ids"] = [i.id for i in identities]- state["identities"] = [] # TODO: fix this+ state["identities"] = [i.to_pydantic() for i in identities]state["multi_agent_group"] = multi_agent_groupstate["managed_group"] = multi_agent_groupstate["tool_exec_environment_variables"] = tool_exec_environment_variablesdiff --git a/letta/orm/identity.py b/letta/orm/identity.pyindex bf172d143..dd7ae51c3 100644--- a/letta/orm/identity.py+++ b/letta/orm/identity.py@@ -44,15 +44,15 @@ class Identity(SqlalchemyBase, OrganizationMixin, ProjectMixin):"Block", secondary="identities_blocks", lazy="selectin", passive_deletes=True, back_populates="identities")- @property- def agent_ids(self) -> List[str]:- """Get just the agent IDs without loading the full agent objects"""- return [agent.id for agent in self.agents]+ # @property+ # def agent_ids(self) -> List[str]:+ # """Get just the agent IDs without loading the full agent objects"""+ # return [agent.id for agent in self.agents]- @property- def block_ids(self) -> List[str]:- """Get just the block IDs without loading the full agent objects"""- return [block.id for block in self.blocks]+ # @property+ # def block_ids(self) -> List[str]:+ # """Get just the block IDs without loading the full agent objects"""+ # return [block.id for block in self.blocks]def to_pydantic(self) -> PydanticIdentity:state = {@@ -61,8 +61,8 @@ class Identity(SqlalchemyBase, OrganizationMixin, ProjectMixin):"name": self.name,"identity_type": self.identity_type,"project_id": self.project_id,- "agent_ids": self.agent_ids,- "block_ids": self.block_ids,+ "agent_ids": [],+ "block_ids": [],"organization_id": self.organization_id,"properties": self.properties or [],}diff --git a/letta/schemas/identity.py b/letta/schemas/identity.pyindex 83bd879f7..9318d00cf 100644--- a/letta/schemas/identity.py+++ b/letta/schemas/identity.py@@ -46,8 +46,8 @@ class Identity(IdentityBase):name: str = Field(..., description="The name of the identity.")identity_type: IdentityType = Field(..., description="The type of the identity.")project_id: Optional[str] = Field(None, description="The project id of the identity, if applicable.")- agent_ids: List[str] = Field(..., description="The IDs of the agents associated with the identity.")- block_ids: List[str] = Field(..., description="The IDs of the blocks associated with the identity.")+ agent_ids: List[str] = Field(..., description="The IDs of the agents associated with the identity.", deprecated=True)+ block_ids: List[str] = Field(..., description="The IDs of the blocks associated with the identity.", deprecated=True)organization_id: Optional[str] = Field(None, description="The organization id of the user")properties: List[IdentityProperty] = Field(default_factory=list, description="List of properties associated with the identity")