Explorer API
REST-API für Doc2Vector Pipeline mit Dokumenten, Seiten, Chunks, Taxonomie und Suche.
| Controller | Controller\Api\ExplorerController |
|---|---|
| Base-URL | /api/v1/explorer |
| Datenbank | ki_system.dokumentation, dokumentation_chunks |
Statistiken
GET /api/v1/explorer/stats
Liefert Übersicht über alle Daten:
{
"dokumente": 15,
"seiten": 73,
"chunks": {
"total": 450,
"tokens": 125000,
"analyzed": 440,
"synced": 435
},
"taxonomy_categories": [
{"taxonomy_category": "Betriebsdokumentation", "count": 120},
{"taxonomy_category": "API-Referenz", "count": 85}
]
}
Dokumente
Liste aller Dokumente
GET /api/v1/explorer/dokumente
Liefert alle Root-Dokumente (depth=0) mit Statistiken.
Dokument-Details
GET /api/v1/explorer/dokumente/{id}
Liefert Dokument mit Seiten und Taxonomie.
Seiten
Seiten auflisten
GET /api/v1/explorer/seiten?search=apache&parent_id=5&limit=50&offset=0
| Parameter | Typ | Beschreibung |
|---|---|---|
| search | string | Suche in Titel und Pfad |
| parent_id | int | Filter nach Parent-Dokument |
| limit | int | Max. Ergebnisse (max 100) |
| 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=Betriebsdokumentation&status=completed&limit=50
| Parameter | Typ | Beschreibung |
|---|---|---|
| category | string | Taxonomie-Kategorie |
| status | string | pending, completed, error |
| search | string | Suche in Content und Keywords |
| limit | int | Max. Ergebnisse (max 100) |
| offset | int | Pagination-Offset |
Chunk-Details
GET /api/v1/explorer/chunks/{id}
Liefert Chunk mit allen Metadaten:
{
"id": 42,
"chunk_index": 3,
"content": "...",
"token_count": 280,
"taxonomy_category": "Betriebsdokumentation",
"taxonomy_path": ["Server", "Apache", "Konfiguration"],
"entities": [
{"name": "Apache", "type": "SOFTWARE"},
{"name": "mod_rewrite", "type": "COMPONENT"}
],
"keywords": ["vhost", "ssl", "proxy"],
"analysis_status": "completed",
"qdrant_id": "abc123..."
}
Taxonomie
GET /api/v1/explorer/taxonomie
Liefert Kategorien mit Counts und Top-Keywords:
{
"categories": [
{"taxonomy_category": "Betriebsdokumentation", "chunk_count": 120, "token_count": 35000}
],
"top_keywords": {
"apache": 45,
"php": 38,
"mariadb": 25
}
}
Entities
GET /api/v1/explorer/entities
Aggregierte Entities aus allen Chunks, gruppiert nach Typ:
{
"entities": [
{"name": "Apache", "type": "SOFTWARE", "count": 45},
{"name": "MariaDB", "type": "SOFTWARE", "count": 38}
],
"by_type": {
"SOFTWARE": [...],
"COMPONENT": [...],
"PERSON": [...]
},
"total": 250
}
Hybrid-Suche
POST /api/v1/explorer/suche
Content-Type: application/json
{
"query": "Apache SSL Konfiguration",
"category": "Betriebsdokumentation",
"limit": 10
}
Kombiniert Vektor- und Keyword-Suche:
{
"query": "Apache SSL Konfiguration",
"results": [
{
"chunk_id": 42,
"content": "...",
"score": 0.92,
"dokument_title": "Apache",
"taxonomy_category": "Betriebsdokumentation"
}
],
"suggestions": ["mod_ssl", "Let's Encrypt", "HTTPS"],
"count": 8
}
Response-Format
{
"success": true,
"data": { ... },
"meta": {
"total": 450,
"limit": 50,
"offset": 0
}
}
Datenmodell
dokumentation
| Feld | Typ | Beschreibung |
|---|---|---|
| id | int | Primärschlüssel |
| parent_id | int | Parent-Dokument |
| title | varchar | Titel |
| path | varchar | URL-Pfad |
| depth | int | Hierarchie-Tiefe (0=Root) |
dokumentation_chunks
| Feld | Typ | Beschreibung |
|---|---|---|
| id | int | Primärschlüssel |
| dokumentation_id | int | FK zu dokumentation |
| chunk_index | int | Position in Dokument |
| content | text | Chunk-Inhalt |
| token_count | int | Token-Anzahl |
| taxonomy_category | varchar | Kategorie |
| taxonomy_path | json | Pfad im Taxonomie-Baum |
| entities | json | Extrahierte Entities |
| keywords | json | Keywords |
| analysis_status | enum | pending, completed, error |
| qdrant_id | varchar | Qdrant-Vektor-ID |