Assistant Associations
Manage AI assistant access to libraries for knowledge retrieval and RAG (Retrieval-Augmented Generation).
GET /api/libraries/{id}/assistant-access
Check if assistant access is enabled for a library.
Authentication: Required
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
Response:
{
"enabled": true
}
PUT /api/libraries/{id}/assistant-access
Enable or disable assistant access for a library.
Authentication: Required
Permissions: Requires library:write permission
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes | Enable (true) or disable (false) assistant access |
Example:
{
"enabled": true
}
Response:
200 OK
{
"enabled": true
}
Enabling assistant access allows AI assistants to query the library's vector embeddings for knowledge retrieval. The library must have indexed files for this to be useful.
DELETE /api/libraries/{id}/assistant-access
Disable assistant access for a library.
Authentication: Required
Permissions: Requires library:write permission
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
Response:
204 No Content
GET /api/libraries/{id}/assistants
List embedded assistants created for files in this library.
Authentication: Required
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
sort | string | - | Sort field |
limit | integer | 30 | Results per page |
Response:
{
"_links": {
"self": { "href": "/api/libraries/{id}/assistants" }
},
"_embedded": {
"inf:assistant": [
{
"id": "assistant-abc-123",
"name": "File Assistant: overview.md",
"libraryId": "550e8400-e29b-41d4-a716-446655440000",
"ownerId": "alice",
"embedded": true,
"instructions": "You are an AI assistant with full access to the file overview.md...",
"chatId": "chat-xyz-789",
"_embedded": {
"inf:chat": {
"id": "chat-xyz-789",
"name": "Chat with overview.md"
}
}
}
]
},
"start": 0,
"count": 1,
"total": 5
}
POST /api/libraries/{id}/assistants
Create an embedded assistant for a file in the library.
Authentication: Required
Permissions: User must have read access to the library
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
fileId | string (UUID) | Yes | File ID to create assistant for |
name | string | No | Assistant name (defaults to library-specific name) |
instructions | string | No | Additional instructions to append |
suggestions | array | No | Suggested prompts |
Example:
{
"fileId": "file-xyz-789",
"name": "Documentation Helper",
"instructions": "Focus on API documentation and provide code examples.",
"suggestions": [
"Summarize this document",
"What are the main topics covered?"
]
}
Response:
201 Created
{
"id": "assistant-abc-123",
"name": "Documentation Helper",
"libraryId": "550e8400-e29b-41d4-a716-446655440000",
"ownerId": "alice",
"embedded": true,
"instructions": "You are an AI assistant with full access to the file overview.md...",
"chatId": "chat-xyz-789"
}
If an embedded assistant already exists for the same file and user, this endpoint returns the existing assistant rather than creating a duplicate.
GET /api/libraries/{id}/assistants/{assistantId}
Get details for an embedded library assistant.
Authentication: Required
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
assistantId | string (UUID) | Assistant ID |
Response:
{
"id": "assistant-abc-123",
"name": "Documentation Helper",
"libraryId": "550e8400-e29b-41d4-a716-446655440000",
"ownerId": "alice",
"embedded": true,
"instructions": "You are an AI assistant with full access to the file overview.md...",
"suggestions": ["Summarize this document"],
"chatId": "chat-xyz-789"
}
PUT /api/libraries/{id}/assistants/{assistantId}
Update an embedded library assistant.
Authentication: Required
Permissions: User must own the assistant
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
assistantId | string (UUID) | Assistant ID |
Request Body:
| Field | Type | Description |
|---|---|---|
name | string | Updated assistant name |
instructions | string | Updated instructions |
suggestions | array | Updated suggestions |
Example:
{
"name": "Updated Documentation Helper",
"suggestions": ["Summarize", "Explain", "Find examples"]
}
Response:
200 OK with updated assistant
DELETE /api/libraries/{id}/assistants/{assistantId}
Delete an embedded library assistant.
Authentication: Required
Permissions: User must own the assistant
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
assistantId | string (UUID) | Assistant ID |
Response:
204 No Content
POST /api/libraries/{id}/assistants/{assistantId}/_promote
Promote an embedded library assistant to a standalone assistant.
Authentication: Required
Permissions: User must own the assistant
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
assistantId | string (UUID) | Assistant ID |
Response:
201 Created
{
"id": "assistant-promoted-456",
"name": "Documentation Helper",
"libraryId": null,
"ownerId": "alice",
"embedded": false,
"instructions": "You are an AI assistant with full access to the file overview.md..."
}
Promoting an assistant creates a new standalone assistant with the same configuration but embedded: false and libraryId: null. The original embedded assistant remains unchanged.