---
id: create-or-update-agent
title: "Create or update agent"
description: "Create a new agent or update existing agent with personality and background. Auto-fills missing fields with defaults."
sidebar_label: "Create or update agent"
hide_title: true
hide_table_of_contents: true
api: eJztWN1v4zYS/1cI9qUNFNtJe72D3pw0aQPsboNN2pdNEEykscSGIlVyZMdn+H8vhpRsSd7strmHHtD1iyWS88H5+o1mIwkKL9MPcl6gIfEWDBRYoSF5n8gcfeZUTcoamcpzh0AoQBhcCQjHrRNNnfMqPitPyhTtxkpRKWp03hrQitYCTC4eIXsqnG1MPhHzhuzxQmntRaW8Z8qFQp37SJrjAhpNfiITaWt0wDpc5TKVWdDiwbqHKPkhCJSJrMFBhYSOr7ORBiqUqQy7DyqXiVR8iRqolIl0+HujHOYyJddgIn1WYgUy3Uha10znySlTyESSIs0L0T5Xudxu7yM9ejqz+ZqJxuwya4i1SjcS6lqrLOg//c2zITc9abXj25FCz29R540Es/55EW4x1Gab7FZMo7VkTTr93jHtNpE9ow9ZDUXZGo1B73tXNk31iE4msoJnVTWVTE8SWSkTn2d7UT93tOMI6TYEWYHPNTqFJkPx9ez45BvWLbPGZwoNKdv410o/P2ByEKjjE3sN8JkcLNF5FT3xV4Vf9OnHcvube5FQOER41PjaC88HDMZCB7t7qQYbZ0llylevkfmuRz6W2Nvby3tU4B88OTQFla+ReKbAi5uOwVjmT3YlPDlrCr0e1BVlFrrhKPPC1sooa3ZG2CadEvbxN8xokPYf9hnwsbgcRcrYi0P7jm/fy8rrvaq3DhQd+q93QlA4Ih7BYy6sEWeqEJdqiaKyOepJ0AqqWsciMYyr2eTfB14Iax9Jutnk+3EqzCb/GgXNbPJt0isTs8l/tof1hz2/q+qvLV1new4fc9ou8UPlD3X4fSy/B8Zs16O9xMI6EeBCmWIa0CIAlIkYNTJn/xrySkAloCVeovB2QStwKNAUyiC6iFInM7FGcF7YRa/ecXRE8JlrFV7HNflv8Bz/OP59bY2PEHA6m/Hf0II3TZah94tGi/ftYflqPNuB75/C1WSHfy+dfQHjviDbF2T7g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asZfrhPpFLcIoBIPQBufL8nMt0AdrjJ6zy9fsWgL8RL+na4axhlF2CbvhNJvIJ1/1xeGgtSoQcXdAhbp9HScehAdiTH/RD3KtEinmWYU2fPHvfw+nrX2659WzH5ty9ylQ6WHFvAauoqQ0XD71SWNvIrurKVEaW/PsDEJiTiw==
sidebar_class_name: "put api-method"
info_path: docs/api-reference/endpoints/agent-memory-api
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Create or update agent"}
>
</Heading>

<MethodEndpoint
  method={"put"}
  path={"/api/v1/agents/{agent_id}"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Create a new agent or update existing agent with personality and background. Auto-fills missing fields with defaults.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"required":true,"content":{"application/json":{"schema":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"personality":{"anyOf":[{"properties":{"openness":{"type":"number","maximum":1,"minimum":0,"title":"Openness","description":"Openness to experience (0-1)"},"conscientiousness":{"type":"number","maximum":1,"minimum":0,"title":"Conscientiousness","description":"Conscientiousness (0-1)"},"extraversion":{"type":"number","maximum":1,"minimum":0,"title":"Extraversion","description":"Extraversion (0-1)"},"agreeableness":{"type":"number","maximum":1,"minimum":0,"title":"Agreeableness","description":"Agreeableness (0-1)"},"neuroticism":{"type":"number","maximum":1,"minimum":0,"title":"Neuroticism","description":"Neuroticism (0-1)"},"bias_strength":{"type":"number","maximum":1,"minimum":0,"title":"Bias Strength","description":"How strongly personality influences opinions (0-1)"}},"type":"object","required":["openness","conscientiousness","extraversion","agreeableness","neuroticism","bias_strength"],"title":"PersonalityTraits","description":"Personality traits based on Big Five model.","example":{"agreeableness":0.7,"bias_strength":0.7,"conscientiousness":0.6,"extraversion":0.5,"neuroticism":0.3,"openness":0.8}},{"type":"null"}]},"background":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Background"}},"type":"object","title":"CreateAgentRequest","description":"Request model for creating/updating an agent.","example":{"background":"I am a creative software engineer with 10 years of experience","name":"Alice","personality":{"agreeableness":0.7,"bias_strength":0.7,"conscientiousness":0.6,"extraversion":0.5,"neuroticism":0.3,"openness":0.8}}}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"name":{"type":"string","title":"Name"},"personality":{"properties":{"openness":{"type":"number","maximum":1,"minimum":0,"title":"Openness","description":"Openness to experience (0-1)"},"conscientiousness":{"type":"number","maximum":1,"minimum":0,"title":"Conscientiousness","description":"Conscientiousness (0-1)"},"extraversion":{"type":"number","maximum":1,"minimum":0,"title":"Extraversion","description":"Extraversion (0-1)"},"agreeableness":{"type":"number","maximum":1,"minimum":0,"title":"Agreeableness","description":"Agreeableness (0-1)"},"neuroticism":{"type":"number","maximum":1,"minimum":0,"title":"Neuroticism","description":"Neuroticism (0-1)"},"bias_strength":{"type":"number","maximum":1,"minimum":0,"title":"Bias Strength","description":"How strongly personality influences opinions (0-1)"}},"type":"object","required":["openness","conscientiousness","extraversion","agreeableness","neuroticism","bias_strength"],"title":"PersonalityTraits","description":"Personality traits based on Big Five model.","example":{"agreeableness":0.7,"bias_strength":0.7,"conscientiousness":0.6,"extraversion":0.5,"neuroticism":0.3,"openness":0.8}},"background":{"type":"string","title":"Background"}},"type":"object","required":["agent_id","name","personality","background"],"title":"AgentProfileResponse","description":"Response model for agent profile.","example":{"agent_id":"user123","background":"I am a software engineer with 10 years of experience in startups","name":"Alice","personality":{"agreeableness":0.7,"bias_strength":0.7,"conscientiousness":0.6,"extraversion":0.5,"neuroticism":0.3,"openness":0.8}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}
>
  
</StatusCodes>


      