Skip to main content

Arc API

The Arc API defines the interfaces and data models that are used to interact with Arc Agents.

The Arc GraphQL Spring Boot Starter is the first implementation of this API. See Arc Graphql.

Agent Request

The following defines the data model for sending a request to an Arc Agent.

Field NameDescriptionRequired
agentNameThe Name of the Agent that should retrieve the request. If omitted the application should route the request to a default Agent.false
request/conversationContextThe conversation context contains fields that are related to the conversation model.
request/conversationContext/conversationIdThe unique identifier of the conversation.true
request/systemContextThe system context contains information related to the system, such as, tenant id.
request/userContextThe user context contains data related to the user.
request/userContext/userIdThe unique identifier of the user.true
request/userContext/profileA key/value set of fields providing information about the user. This can be used to tailor the response generated by the Agent.false
request/messagesA list of messages that are part of the conversation.true
request/messages/roleThe message role, i.e. user, assistanttrue
request/messages/formatThe message format, i.e. text, json.true
request/messages/contentThe content of the message.true

Agent Response

The following defines the data model response.

Field NameDescriptionRequired
responseTimeThe time the response took in seconds.false
messages/contentThe content of the response. The response will only contain new messages.true

GraphQL Example

Here is an example of a Agent Request being sent over a GraphQL subscription:

subscription {
agent(
agentName: "assistant-agent"
request: {
conversationContext: {
conversationId: "1"
}
systemContext: [],
userContext: {
userId: "1234",
profile: [{
key: "name",
value: "Pat"
}]
},
messages: [
{
role: "user",
content: "Hi",
format: "text",
}
]
}
) {
messages {
content
}
}
}