Use the Metadata Fields Passed from the API in Agent Platform
Metadata is structured data that provides additional context about a session, user, or request. When interacting with the Platform via the execute API, developers can provide custom metadata in every request using the metadata field. This enriches agent context, enabling personalized, stateful, and relevant experiences.The Platform automatically stores this information in its default sessionMeta memory store, according to a specific, defined schema, making it easily accessible within the session.The stored metadata can then be referenced in prompts, allowing agents to respond dynamically based on context passed via the Metadata fields.
A typical request to the execute API includes a metadata field as shown below. In the following example, additional user information is passed to the app via the metadata field.
All fields from the API’s metadata object are stored directly in sessionMeta.metadata. For the above example, the sessionMetaMemory Store will look like: