Minds Team

Knowledge API

Add knowledge to your minds through files, keywords, or links.

Knowledge API

Add knowledge to your minds via three methods: File, Keyword, or Link. Knowledge is processed, embedded, and automatically retrieved during conversations.

Note: List, add, and delete are available via the v1 API. Knowledge enrichment via keyword search is also supported through the same add endpoint.


List Knowledge Items

Retrieve all knowledge items for a mind.

Endpoint: GET /api/v1/sparks/{sparkId}/knowledge

Headers:

Authorization: Bearer minds_your_api_key

Example:

curl -X GET "https://getminds.ai/api/v1/sparks/{sparkId}/knowledge" \
  -H "Authorization: Bearer minds_your_api_key"

Response:

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "660e8400-e29b-41d4-a716-446655440001",
        "description": "Company Employee Handbook 2025",
        "link": null,
        "filePath": "portfolio/user-id/1234567890_handbook.pdf",
        "isWatched": false,
        "createdAt": "2025-12-10T12:00:00.000Z",
        "updatedAt": "2025-12-10T12:00:00.000Z"
      }
    ],
    "total": 1
  }
}
FieldTypeDescription
data.itemsarrayArray of knowledge item objects
data.totalnumberTotal count of knowledge items for this mind

File Upload

Upload documents or images directly to a mind.

Endpoint: POST /api/v1/sparks/{sparkId}/knowledge

Content-Type: multipart/form-data

FieldTypeRequiredDescription
filefileYesFile to upload (max 30MB)
descriptionstringYesDescription of the content

Supported formats:

  • Documents: PDF, DOCX, DOC, TXT, MD, RTF, CSV, JSON, XML
  • Images: JPG, JPEG, PNG, GIF, WEBP

Example:

curl -X POST "https://getminds.ai/api/v1/sparks/{sparkId}/knowledge" \
  -H "Authorization: Bearer minds_your_api_key" \
  -F "file=@./handbook.pdf" \
  -F "description=Company Employee Handbook 2025"

Response: 201 Created

{
  "success": true,
  "data": {
    "id": "660e8400-e29b-41d4-a716-446655440001",
    "description": "Company Employee Handbook 2025",
    "filePath": "portfolio/user-id/1234567890_handbook.pdf",
    "createdAt": "2025-12-10T12:00:00.000Z"
  }
}

Add knowledge by searching the web for keywords. Searches Tavily and YouTube, extracts content, and adds it to the mind's knowledge base.

Endpoint: POST /api/v1/sparks/{sparkId}/knowledge

Content-Type: application/json

Send a JSON body with a keywords array (instead of link/file) to trigger web search enrichment.

ParameterTypeRequiredDescription
keywordsstringYesKeywords to search (max 35)
regeneratePromptbooleanNoRegenerate system prompt after (default: true)

Example:

curl -X POST "https://getminds.ai/api/v1/sparks/{sparkId}/knowledge" \
  -H "Authorization: Bearer minds_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"keywords": ["solar panel efficiency", "photovoltaic trends"]}'

Response: 202 Accepted

{
  "success": true,
  "data": {
    "sparkId": "660e8400-e29b-41d4-a716-446655440000",
    "keywords": ["solar panel efficiency", "photovoltaic trends"],
    "queued": true,
    "regeneratePrompt": true,
    "message": "Knowledge enrichment queued with 2 keyword(s)."
  }
}

Note: This is asynchronous. Processing runs in background and may take several minutes.


Add knowledge from a URL. Supports web pages, YouTube videos, and research papers.

Endpoint: POST /api/v1/sparks/{sparkId}/knowledge

Content-Type: application/json

ParameterTypeRequiredDescription
linkstringYesURL to web content
descriptionstringYesDescription of the content

Example:

curl -X POST "https://getminds.ai/api/v1/sparks/{sparkId}/knowledge" \
  -H "Authorization: Bearer minds_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"link": "https://example.com/article", "description": "Industry trends article"}'

Response: 201 Created

{
  "success": true,
  "data": {
    "id": "660e8400-e29b-41d4-a716-446655440001",
    "link": "https://example.com/article",
    "description": "Industry trends article",
    "createdAt": "2025-12-10T12:00:00.000Z"
  }
}

Supported link types:

  • Web pages (content extracted via scraping)
  • YouTube videos (transcripts extracted automatically)
  • Research papers (arxiv, etc.)

Watch (Auto-Update)

Link-based knowledge items can be "watched" to automatically check for content updates on a weekly cycle. When changes are detected, knowledge is reprocessed and re-embedded.

Watch is managed through the product UI. Watch status is visible when listing knowledge items via the API (isWatched field).

Note: Watch is only available for link-based knowledge, not files or keyword searches.


Update Knowledge Item

Update the description of an existing knowledge item.

Endpoint: PUT /api/v1/sparks/{sparkId}/knowledge/{itemId}

Headers:

Authorization: Bearer minds_your_api_key
Content-Type: application/json

Request Body:

{
  "description": "Updated description for this knowledge item"
}
ParameterTypeRequiredDescription
descriptionstringYesUpdated description (must not be empty)

Example:

curl -X PUT "https://getminds.ai/api/v1/sparks/{sparkId}/knowledge/{itemId}" \
  -H "Authorization: Bearer minds_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"description": "Updated handbook description"}'

Response:

{
  "success": true,
  "data": {
    "id": "660e8400-e29b-41d4-a716-446655440001",
    "description": "Updated handbook description",
    "link": null,
    "filePath": "portfolio/user-id/1234567890_handbook.pdf",
    "isWatched": false,
    "createdAt": "2025-12-10T12:00:00.000Z",
    "updatedAt": "2025-12-15T08:30:00.000Z"
  }
}

Error Responses

400 Bad Request - No valid fields to update or empty description

401 Unauthorized - Invalid or missing API key

404 Not Found - Knowledge item or mind not found


Enrich via Keywords (Convenience)

Convenience alias for keyword-based knowledge enrichment.

Endpoint: POST /api/v1/sparks/{sparkId}/knowledge/enrich

This is equivalent to POST /api/v1/sparks/{sparkId}/knowledge with a keywords body. See Keyword Search for full details.

Example:

curl -X POST "https://getminds.ai/api/v1/sparks/{sparkId}/knowledge/enrich" \
  -H "Authorization: Bearer minds_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"keywords": ["solar panel efficiency", "photovoltaic trends"]}'

Delete Knowledge Item

Permanently delete a knowledge item and all associated data (embeddings, patterns, files).

Endpoint: DELETE /api/v1/sparks/{sparkId}/knowledge/{itemId}

Headers:

Authorization: Bearer minds_your_api_key

Example:

curl -X DELETE "https://getminds.ai/api/v1/sparks/{sparkId}/knowledge/{itemId}" \
  -H "Authorization: Bearer minds_your_api_key"

Response: 204 No Content (empty body on success)

What Gets Deleted

  • The knowledge item record
  • All associated vector embeddings
  • All associated patterns
  • Uploaded file from storage (if file-based)

Warning: This action cannot be undone.


How Processing Works

  1. Upload - Content is stored and API returns success
  2. Extraction - Background processing extracts text (scraping, transcripts, OCR, vision)
  3. Embedding - Content is converted to vector embeddings
  4. Retrieval - During chat, relevant knowledge is automatically retrieved by semantic search

Errors

CodeMessageCause
400Link and description are requiredMissing required fields
400keywords array is required and must not be emptyEmpty or missing keywords
400File too largeFile exceeds 30MB limit
400Can only watch link-based knowledgeTried to watch a file
404Spark not found or access deniedInvalid spark ID or no access
415Unsupported Content-TypeWrong Content-Type header

Next Steps