Explorer API
REST-API für den Doc2Vector Explorer mit Dokumenten, Seiten, Chunks, Entitäten, Taxonomie und Suche.
| Controller | Controller\Api\ExplorerController |
|---|---|
| Base-URL | /api/v1/explorer |
| Datenbank | ki_content (documents, chunks, entities, ...) |
Endpoints-Übersicht
| Methode | Pfad | Beschreibung |
|---|---|---|
| GET | /api/v1/explorer/stats | Statistiken |
| GET | /api/v1/explorer/dokumente | Alle Dokumente |
| GET | /api/v1/explorer/dokumente/{id} | Dokument-Details |
| GET | /api/v1/explorer/seiten | Alle Seiten |
| GET | /api/v1/explorer/seiten/{id} | Seiten-Details |
| GET | /api/v1/explorer/chunks | Alle Chunks |
| GET | /api/v1/explorer/chunks/{id} | Chunk-Details |
| GET | /api/v1/explorer/taxonomie | Taxonomie-Kategorien |
| GET | /api/v1/explorer/entities | Entitäten gruppiert |
| POST | /api/v1/explorer/suche | Hybrid-Suche |
Statistiken
GET /api/v1/explorer/stats
Liefert Übersicht über alle Daten:
{
"success": true,
"data": {
"dokumente": 15,
"seiten": 120,
"chunks": {
"total": 450,
"tokens": 125000,
"analyzed": 400,
"synced": 380
},
"taxonomy_categories": [...]
}
}
Dokumente
Liste aller Dokumente
GET /api/v1/explorer/dokumente
Liefert alle Quelldokumente mit Statistiken.
Dokument-Details
GET /api/v1/explorer/dokumente/{id}
Liefert Dokument mit zugehörigen Seiten und Taxonomie.
Seiten
Seiten auflisten
GET /api/v1/explorer/seiten?search=&parent_id=&limit=50&offset=0
| Parameter | Typ | Beschreibung |
|---|---|---|
| search | string | Suche in Inhalt |
| parent_id | int | Filter nach Parent-Dokument |
| limit | int | Max. Ergebnisse (max 50) |
| offset | int | Pagination-Offset |
Seiten-Details
GET /api/v1/explorer/seiten/{id}
Liefert Seite mit Chunks und Unterseiten.
Chunks
Chunks auflisten
GET /api/v1/explorer/chunks?category=&status=&search=&limit=50&offset=0
| Parameter | Typ | Beschreibung |
|---|---|---|
| category | string | Taxonomie-Kategorie |
| status | string | Chunk-Status |
| search | string | Suche in Content |
| limit | int | Max. Ergebnisse (max 50) |
| offset | int | Pagination-Offset |
Chunk-Details
GET /api/v1/explorer/chunks/{id}
Liefert Chunk mit allen Metadaten:
{
"success": true,
"data": {
"id": 42,
"chunk_index": 3,
"content": "...",
"token_count": 280,
"entities": [
{"name": "Carl Rogers", "type": "PERSON"}
],
"keywords": ["Therapie", "Empathie"],
"qdrant_id": "abc123..."
}
}
Taxonomie
GET /api/v1/explorer/taxonomie
Liefert Top-Kategorien und Keywords:
{
"success": true,
"data": {
"categories": [...],
"top_keywords": [...]
}
}
Entitäten
GET /api/v1/explorer/entities
Liefert Entitäten gruppiert nach Typ.
Hybrid-Suche
POST /api/v1/explorer/suche
Content-Type: application/json
{
"query": "Systemische Therapie",
"category": "Psychotherapie",
"limit": 10
}
Kombiniert Vektor- und Keyword-Suche:
{
"success": true,
"data": {
"query": "Systemische Therapie",
"results": [...],
"suggestions": [...],
"count": 8
}
}
Response-Format
{
"success": true,
"data": { ... },
"meta": {
"total": 450,
"limit": 50,
"offset": 0
}
}
Datenmodell
documents (ki_content)
| Feld | Typ | Beschreibung |
|---|---|---|
| id | int | Primärschlüssel |
| filename | varchar | Dateiname |
| title | varchar | Titel |
| source | varchar | Quelle (Nextcloud-Pfad) |
| page_count | int | Seitenanzahl |
| status | enum | pending, processing, completed, error |
chunks (ki_content)
| Feld | Typ | Beschreibung |
|---|---|---|
| id | int | Primärschlüssel |
| document_id | int | FK zu documents |
| chunk_index | int | Position in Dokument |
| content | text | Chunk-Inhalt |
| token_count | int | Token-Anzahl |
| embedding_model | varchar | Verwendetes Modell |
| qdrant_id | varchar | Qdrant-Vektor-ID |
entities (ki_content)
| Feld | Typ | Beschreibung |
|---|---|---|
| id | int | Primärschlüssel |
| name | varchar | Entity-Name |
| canonical_name | varchar | Normalisierter Name |
| type | enum | PERSON, CONCEPT, ORGANIZATION, ... |