Skip to main content

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:

ParameterTypeDescription
idstringLibrary 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:

ParameterTypeDescription
idstringLibrary ID or natural ID

Request Body:

FieldTypeRequiredDescription
enabledbooleanYesEnable (true) or disable (false) assistant access

Example:

{
"enabled": true
}

Response:

200 OK

{
"enabled": true
}
Permission Requirement

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:

ParameterTypeDescription
idstringLibrary 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:

ParameterTypeDescription
idstringLibrary ID or natural ID

Query Parameters:

ParameterTypeDefaultDescription
sortstring-Sort field
limitinteger30Results 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:

ParameterTypeDescription
idstringLibrary ID or natural ID

Request Body:

FieldTypeRequiredDescription
fileIdstring (UUID)YesFile ID to create assistant for
namestringNoAssistant name (defaults to library-specific name)
instructionsstringNoAdditional instructions to append
suggestionsarrayNoSuggested 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"
}
Idempotent Creation

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:

ParameterTypeDescription
idstringLibrary ID or natural ID
assistantIdstring (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:

ParameterTypeDescription
idstringLibrary ID or natural ID
assistantIdstring (UUID)Assistant ID

Request Body:

FieldTypeDescription
namestringUpdated assistant name
instructionsstringUpdated instructions
suggestionsarrayUpdated 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:

ParameterTypeDescription
idstringLibrary ID or natural ID
assistantIdstring (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:

ParameterTypeDescription
idstringLibrary ID or natural ID
assistantIdstring (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..."
}
Promotion Effect

Promoting an assistant creates a new standalone assistant with the same configuration but embedded: false and libraryId: null. The original embedded assistant remains unchanged.