context: "Vollständige API-Referenz für alle Mindnet-Endpunkte. Basis für Integration und Entwicklung."
---
# API Reference
Diese Dokumentation beschreibt alle verfügbaren API-Endpunkte von Mindnet. Die API basiert auf FastAPI und nutzt automatische OpenAPI-Dokumentation (verfügbar unter `/docs`).
## Basis-URL
```
http://localhost:8001 # Production
http://localhost:8002 # Development
```
## Health Check
### `GET /healthz`
Prüft den Status der API und der Verbindung zu Qdrant.
**Response:**
```json
{
"status": "ok",
"qdrant": "http://localhost:6333",
"prefix": "mindnet"
}
```
---
## Query Endpoints
### `POST /query`
Führt eine hybride oder semantische Suche im Wissensgraph durch.
**Request Body:**
```json
{
"query": "Was ist Mindnet?",
"mode": "hybrid", // "hybrid" oder "semantic"
"top_k": 10,
"expand_depth": 1,
"explain": true
}
```
**Response:**
```json
{
"query_id": "uuid-v4",
"hits": [
{
"chunk_id": "uuid",
"note_id": "uuid",
"text": "Auszug...",
"score": 0.85,
"explanation": {
"reasons": [...]
}
}
],
"stats": {
"total_hits": 10,
"query_time_ms": 45
}
}
```
**Hinweis:** Das Feedback-Logging erfolgt asynchron im Hintergrund (Background Tasks).
---
## Chat Endpoints
### `POST /chat/`
Hauptendpunkt für RAG-Chat und Interview-Modus. Unterstützt Streaming.
**Request Body:**
```json
{
"message": "Was ist Mindnet?",
"history": [], // Optional: Chat-Verlauf
"stream": true // Optional: SSE-Streaming
}
```
**Response (Non-Streaming):**
```json
{
"intent": "FACT",
"response": "Mindnet ist ein persönliches KI-Gedächtnis...",
"sources": [...],
"query_id": "uuid"
}
```
**Response (Streaming):**
Server-Sent Events (SSE) mit Chunks der Antwort.
**Intent-Typen:**
-`FACT`: Wissensabfrage
-`DECISION`: Entscheidungsfrage
-`EMPATHY`: Emotionale Anfrage
-`INTERVIEW`: Wissen erfassen
---
## Graph Endpoints
### `GET /graph/{note_id}`
Lädt den Subgraphen um eine Note herum.
**Query Parameters:**
-`depth` (int, default: 1): Tiefe der Graph-Expansion
-`edge_types` (List[str], optional): Filter für Kanten-Typen