---
title: "Knowledge API"
description: "Fügen Sie Ihren Minds Wissen über Dateien, Keywords oder Links hinzu."
---

# Knowledge API

Fügen Sie Ihren Minds Wissen über drei Methoden hinzu: **Datei**, **Keyword** oder **Link**. Wissen wird verarbeitet, eingebettet und während Konversationen automatisch abgerufen.

**Hinweis:** Auflisten, Hinzufügen und Löschen sind über die v1-API verfügbar. Knowledge-Anreicherung per Keyword-Suche wird ebenfalls über denselben Add-Endpoint unterstützt.

---

## Knowledge-Einträge auflisten

Ruft alle Knowledge-Einträge eines Minds ab.

**Endpoint:** `GET /api/v1/minds/{mindId}/knowledge`

**Headers:**

```text
Authorization: Bearer minds_your_api_key
```

**Beispiel:**

```bash
curl -X GET "https://getminds.ai/api/v1/minds/{mindId}/knowledge" \
  -H "Authorization: Bearer minds_your_api_key"
```

**Response:**

```json
{
  "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
  }
}
```

<table>
<thead>
  <tr>
    <th>
      Feld
    </th>
    
    <th>
      Typ
    </th>
    
    <th>
      Beschreibung
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        data.items
      </code>
    </td>
    
    <td>
      array
    </td>
    
    <td>
      Array von Knowledge-Eintragsobjekten
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.total
      </code>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      Gesamtzahl der Knowledge-Einträge für diesen Mind
    </td>
  </tr>
</tbody>
</table>

---

## Datei-Upload

Laden Sie Dokumente oder Bilder direkt zu einem Mind hoch.

**Endpoint:** `POST /api/v1/minds/{mindId}/knowledge`

**Content-Type:** `multipart/form-data`

<table>
<thead>
  <tr>
    <th>
      Feld
    </th>
    
    <th>
      Typ
    </th>
    
    <th>
      Erforderlich
    </th>
    
    <th>
      Beschreibung
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        file
      </code>
    </td>
    
    <td>
      file
    </td>
    
    <td>
      Ja
    </td>
    
    <td>
      Hochzuladende Datei (max. 50 MB)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        description
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Ja
    </td>
    
    <td>
      Beschreibung des Inhalts
    </td>
  </tr>
</tbody>
</table>

**Unterstützte Formate:**

- Dokumente: PDF, DOCX, DOC, TXT, MD, RTF, CSV, JSON, XML
- Bilder: JPG, JPEG, PNG, GIF, WEBP

**Beispiel:**

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

**Response:** `201 Created`

```json
{
  "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"
  }
}
```

---

## Keyword-Suche

Fügen Sie Wissen hinzu, indem Sie das Web nach Keywords durchsuchen. Durchsucht Exa und YouTube, extrahiert Inhalte und fügt sie der Wissensbasis des Minds hinzu.

**Endpoint:** `POST /api/v1/minds/{mindId}/knowledge`

**Content-Type:** `application/json`

Senden Sie einen JSON-Body mit einem `keywords`-Array (statt `link`/`file`), um die Web-Suche-Anreicherung auszulösen.

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Typ
    </th>
    
    <th>
      Erforderlich
    </th>
    
    <th>
      Beschreibung
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        keywords
      </code>
    </td>
    
    <td>
      string<span>
        
      </span>
    </td>
    
    <td>
      Ja
    </td>
    
    <td>
      Zu suchende Keywords (max. 35)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        regeneratePrompt
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      Nein
    </td>
    
    <td>
      System Prompt danach neu generieren (Standard: true)
    </td>
  </tr>
</tbody>
</table>

**Beispiel:**

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

**Response:** `202 Accepted`

```json
{
  "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)."
  }
}
```

**Hinweis:** Dies läuft asynchron. Die Verarbeitung findet im Hintergrund statt und kann mehrere Minuten dauern.

---

## Link

Fügen Sie Wissen aus einer URL hinzu. Unterstützt Webseiten, YouTube-Videos und Forschungsarbeiten.

**Endpoint:** `POST /api/v1/minds/{mindId}/knowledge`

**Content-Type:** `application/json`

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Typ
    </th>
    
    <th>
      Erforderlich
    </th>
    
    <th>
      Beschreibung
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        link
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Ja
    </td>
    
    <td>
      URL zu Web-Inhalt
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        description
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Ja
    </td>
    
    <td>
      Beschreibung des Inhalts
    </td>
  </tr>
</tbody>
</table>

**Beispiel:**

```bash
curl -X POST "https://getminds.ai/api/v1/minds/{mindId}/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`

```json
{
  "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"
  }
}
```

**Unterstützte Link-Typen:**

- Webseiten (Inhalt wird per Scraping extrahiert)
- YouTube-Videos (Transkripte werden automatisch extrahiert)
- Forschungsarbeiten (arxiv usw.)

---

## Watch (Auto-Update)

Link-basierte Knowledge-Einträge können per "Watch" automatisch wöchentlich auf Inhaltsänderungen geprüft werden. Wenn Änderungen erkannt werden, wird das Wissen neu verarbeitet und neu eingebettet.

Watch wird über die Produkt-UI verwaltet. Der Watch-Status ist beim Auflisten von Knowledge-Einträgen über die API sichtbar (Feld `isWatched`).

**Hinweis:** Watch ist nur für link-basiertes Wissen verfügbar, nicht für Dateien oder Keyword-Suchen.

---

## Knowledge-Eintrag aktualisieren

Aktualisiert die Beschreibung eines bestehenden Knowledge-Eintrags.

**Endpoint:** `PUT /api/v1/minds/{mindId}/knowledge/{itemId}`

**Headers:**

```text
Authorization: Bearer minds_your_api_key
Content-Type: application/json
```

**Request Body:**

```json
{
  "description": "Updated description for this knowledge item"
}
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Typ
    </th>
    
    <th>
      Erforderlich
    </th>
    
    <th>
      Beschreibung
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        description
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Ja
    </td>
    
    <td>
      Aktualisierte Beschreibung (darf nicht leer sein)
    </td>
  </tr>
</tbody>
</table>

**Beispiel:**

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

**Response:**

```json
{
  "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** - Keine gültigen Felder zum Aktualisieren oder leere Beschreibung

**401 Unauthorized** - Ungültiger oder fehlender API key

**404 Not Found** - Knowledge-Eintrag oder Mind nicht gefunden

---

## Anreicherung per Keywords (Convenience)

Convenience-Alias für die keyword-basierte Knowledge-Anreicherung.

**Endpoint:** `POST /api/v1/minds/{mindId}/knowledge/enrich`

Dies ist gleichbedeutend mit `POST /api/v1/minds/{mindId}/knowledge` mit einem `keywords`-Body. Siehe [Keyword-Suche](#keyword-suche) für alle Details.

**Beispiel:**

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

---

## Knowledge-Eintrag löschen

Löscht einen Knowledge-Eintrag und alle zugehörigen Daten (Embeddings, Patterns, Dateien) dauerhaft.

**Endpoint:** `DELETE /api/v1/minds/{mindId}/knowledge/{itemId}`

**Headers:**

```text
Authorization: Bearer minds_your_api_key
```

**Beispiel:**

```bash
curl -X DELETE "https://getminds.ai/api/v1/minds/{mindId}/knowledge/{itemId}" \
  -H "Authorization: Bearer minds_your_api_key"
```

**Response:** `204 No Content` (leerer Body bei Erfolg)

### Was wird gelöscht

- Der Knowledge-Eintrags-Datensatz
- Alle zugehörigen Vektor-Embeddings
- Alle zugehörigen Patterns
- Hochgeladene Datei aus dem Storage (wenn dateibasiert)

**Warnung:** Diese Aktion kann nicht rückgängig gemacht werden.

---

## So funktioniert die Verarbeitung

1. **Upload** - Inhalt wird gespeichert und die API gibt Erfolg zurück
2. **Extraktion** - Hintergrundverarbeitung extrahiert Text (Scraping, Transkripte, OCR, Vision)
3. **Embedding** - Inhalt wird in Vektor-Embeddings umgewandelt
4. **Retrieval** - Während des Chats wird relevantes Wissen automatisch per semantischer Suche abgerufen

---

## Errors

<table>
<thead>
  <tr>
    <th>
      Code
    </th>
    
    <th>
      Meldung
    </th>
    
    <th>
      Ursache
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      400
    </td>
    
    <td>
      <code>
        Link and description are required
      </code>
    </td>
    
    <td>
      Pflichtfelder fehlen
    </td>
  </tr>
  
  <tr>
    <td>
      400
    </td>
    
    <td>
      <code>
        Keywords array is required
      </code>
    </td>
    
    <td>
      Leeres oder fehlendes keywords
    </td>
  </tr>
  
  <tr>
    <td>
      400
    </td>
    
    <td>
      <code>
        File too large
      </code>
    </td>
    
    <td>
      Datei überschreitet das 50-MB-Limit
    </td>
  </tr>
  
  <tr>
    <td>
      400
    </td>
    
    <td>
      <code>
        Can only watch link-based knowledge
      </code>
    </td>
    
    <td>
      Versuch, eine Datei zu beobachten
    </td>
  </tr>
  
  <tr>
    <td>
      404
    </td>
    
    <td>
      <code>
        Mind not found or access denied
      </code>
    </td>
    
    <td>
      Ungültige Mind-ID oder kein Zugriff
    </td>
  </tr>
  
  <tr>
    <td>
      415
    </td>
    
    <td>
      <code>
        Unsupported Content-Type
      </code>
    </td>
    
    <td>
      Falscher Content-Type-Header
    </td>
  </tr>
</tbody>
</table>

---

## Nächste Schritte

- [Mit Ihrem Mind chatten](/docs/api/chat)
- [Minds erstellen](/docs/api/minds)
- [API Errors und Limits](/docs/api/errors)
