Documentalist
This document describes how to use the DIMARC API to interact with the /documentalist endpoint. This endpoint allows you to send requests to a documentalist agent with a question, specific instructions, and a conversation history.
POST /v2/documentalist
Prerequisites
- An active DIMARC account.
- Administrator status in your organization.
- A configured “Documentalist” type agent.
- Your authentication token
x-api-key
(see Retrieving Your Authentication Token)
Retrieving an agent’s ID
Each agent has a unique ID. To retrieve the ID of the Documentalist agent, go to your dashboard:
- Click on your profile icon in the top right corner, then go to the Organization > API section or by clicking here
- In the References of your agents section, you can retrieve the ID of the Documentalist agent you want to use.
Communicate with your Documentalist
To communicate with the Documentalist agent, send a POST request to the /v2/documentalist/<agent_id>
endpoint with your authentication token.
Request Parameters
Parameter | Type | Description |
---|---|---|
query | string | The question or query to address to the documentalist agent |
instructions | array | List of specific instructions to guide the agent’s response (optional) |
historic | array | History of previous conversations (optional) |
Request Example
curl --location 'https://api.dimarc.ai/v2/documentalist/<agent_id>' \--header 'Content-Type: application/json' \--header 'x-api-key: <your_api_key>' \--data '{ "query": "What does Dimarc do?", "instructions": ["Add 🌈 in your responses"], "historic": []}'
Response Format
The response is returned as an HTTP stream. This allows information to be received progressively as it is generated by the agent. Each chunk of the stream contains a portion of the response.
Managing conversation history
To maintain a consistent context throughout the exchanges, you can include the history of previous conversations in the historic
parameter. This allows the agent to understand the complete context of the exchange.
History Format
The history must be provided as an array of objects alternating between user messages and agent responses:
"historic": [ { "role": "user", "content": "What does Dimarc do?" }, { "role": "assistant", "content": "🌈 Dimarc is an artificial intelligence platform specialized in creating customized AI agents. 🌈" }]
Limitations and considerations
- Response times may vary depending on the complexity of the query and the information sources that the Documentalist agent decides to use.
- The sources used by the Documentalist agent are not returned in the response at the moment.
Support and assistance
For any questions regarding the Documentalist API, contact our support team at support@dimarc.fr