#additional fields in agents thread

4 messages · Page 1 of 1 (latest)

little reef
#

is there a way to add additional fields to a Agents thread?

loud nimbusBOT
#

Hi @little reef. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

You can add additional fields (metadata) to an Agent's thread at creation time by passing them as part of the options object in the createThread call. For example, you can set fields like title, summary, or userId:

const { thread } = await agent.createThread(ctx, {
  userId,
  title: "My thread",
  summary: "This is a summary of the thread",
});

Currently, the documented metadata fields are userId, title, and summary. The documentation notes that metadata may be provided as context to the agent automatically in the future, but for now, it's mainly a convenience for organizing threads in the Playground. There is no explicit mention in the knowledge sources of support for arbitrary custom fields beyond these, nor for extending the thread schema with additional arbitrary properties. If you need to store more complex or custom metadata, you may need to manage that in a separate table or structure in your Convex backend for now Threads.

If you are looking for a way to annotate the schema itself with extra metadata (like labels or input types), this is not currently supported, but has been requested by the community Custom Metadata/Extending Schema.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@little reef Kapa.ai is still learning and improving, please let me know how I did by reacting below.