114 lines
3.7 KiB
Markdown
114 lines
3.7 KiB
Markdown
|
|
---
|
||
|
|
doc_type: technical_reference
|
||
|
|
audience: developer, architect
|
||
|
|
scope: database, qdrant, schema
|
||
|
|
status: active
|
||
|
|
version: 2.6
|
||
|
|
context: "Exakte Definition der Datenmodelle (Payloads) in Qdrant und Index-Anforderungen."
|
||
|
|
---
|
||
|
|
|
||
|
|
# Technisches Datenmodell (Qdrant Schema)
|
||
|
|
|
||
|
|
## 1. Collections & Namenskonvention
|
||
|
|
|
||
|
|
Mindnet speichert Daten in drei getrennten Qdrant-Collections. Der Prefix ist via ENV `COLLECTION_PREFIX` konfigurierbar (Default: `mindnet`).
|
||
|
|
|
||
|
|
Das System nutzt folgende drei Collections:
|
||
|
|
* `{prefix}_notes`: Metadaten der Dateien.
|
||
|
|
* `{prefix}_chunks`: Vektorisierte Textsegmente.
|
||
|
|
* `{prefix}_edges`: Gerichtete Graph-Kanten.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 2. Note Payload (`mindnet_notes`)
|
||
|
|
|
||
|
|
Repräsentiert die Metadaten einer Markdown-Datei (1:1 Beziehung).
|
||
|
|
|
||
|
|
**JSON-Schema:**
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"note_id": "string (keyword)", // UUIDv5 (deterministisch) oder Slug
|
||
|
|
"title": "string (text)", // Titel aus Frontmatter
|
||
|
|
"type": "string (keyword)", // Logischer Typ (z.B. 'project', 'concept')
|
||
|
|
"retriever_weight": "float", // Numerische Wichtigkeit (0.0-1.0), aus types.yaml
|
||
|
|
"chunk_profile": "string", // Genutztes Profil (z.B. 'sliding_smart_edges')
|
||
|
|
"edge_defaults": ["string"], // Liste der aktiven Default-Kanten
|
||
|
|
"tags": ["string"], // Liste von Tags aus Frontmatter
|
||
|
|
"created": "string (iso-date)", // Erstellungsdatum
|
||
|
|
"updated": "integer", // Timestamp (File Modification Time)
|
||
|
|
"fulltext": "string (no-index)" // Gesamter Text (nur für Recovery/Export)
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
**Erforderliche Indizes:**
|
||
|
|
Es müssen Payload-Indizes für folgende Felder existieren:
|
||
|
|
* `note_id`
|
||
|
|
* `type`
|
||
|
|
* `tags`
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 3. Chunk Payload (`mindnet_chunks`)
|
||
|
|
|
||
|
|
Die atomare Sucheinheit. Enthält den Vektor.
|
||
|
|
|
||
|
|
**Vektor-Konfiguration:**
|
||
|
|
* Modell: `nomic-embed-text`
|
||
|
|
* Dimension: **768**
|
||
|
|
* Metrik: Cosine Similarity
|
||
|
|
|
||
|
|
**JSON-Schema:**
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"chunk_id": "string (keyword)", // Format: {note_id}#c{index} (z.B. 'abc-123#c01')
|
||
|
|
"note_id": "string (keyword)", // Foreign Key zur Note
|
||
|
|
"type": "string (keyword)", // Kopie aus Note (Denormalisiert für Filterung)
|
||
|
|
"text": "string (text)", // Reintext für Anzeige (ohne Overlap)
|
||
|
|
"window": "string (text)", // Text + Overlap (Basis für Embedding)
|
||
|
|
"ord": "integer", // Laufende Nummer (1..N) für Sortierung
|
||
|
|
"retriever_weight": "float", // Kopie aus Note (für Query-Speed)
|
||
|
|
"chunk_profile": "string", // Vererbt von Note
|
||
|
|
"neighbors_prev": ["string"], // ID des Vorgängers (Linked List)
|
||
|
|
"neighbors_next": ["string"] // ID des Nachfolgers
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
**Erforderliche Indizes:**
|
||
|
|
Es müssen Payload-Indizes für folgende Felder existieren:
|
||
|
|
* `note_id`
|
||
|
|
* `chunk_id`
|
||
|
|
* `type`
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 4. Edge Payload (`mindnet_edges`)
|
||
|
|
|
||
|
|
Gerichtete Kanten zwischen Knoten. Stark erweitert in v2.6 für Provenienz-Tracking.
|
||
|
|
|
||
|
|
**JSON-Schema:**
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"edge_id": "string (keyword)", // Deterministischer Hash aus (src, dst, kind)
|
||
|
|
"source_id": "string (keyword)", // Chunk-ID (Start)
|
||
|
|
"target_id": "string (keyword)", // Chunk-ID oder Note-Titel (bei Unresolved)
|
||
|
|
"kind": "string (keyword)", // Beziehungsart (z.B. 'depends_on')
|
||
|
|
"scope": "string (keyword)", // Immer 'chunk' (Legacy-Support: 'note')
|
||
|
|
"note_id": "string (keyword)", // Owner Note ID (Ursprung der Kante)
|
||
|
|
|
||
|
|
// Provenance & Quality (WP03/WP15)
|
||
|
|
"provenance": "keyword", // 'explicit', 'rule', 'smart' (NEU)
|
||
|
|
"rule_id": "string (keyword)", // Traceability: 'inline:rel', 'explicit:wikilink', 'smart:llm'
|
||
|
|
"confidence": "float" // Vertrauenswürdigkeit (0.0 - 1.0)
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
**Erforderliche Indizes:**
|
||
|
|
Es müssen Payload-Indizes für folgende Felder existieren:
|
||
|
|
* `source_id`
|
||
|
|
* `target_id`
|
||
|
|
* `kind`
|
||
|
|
* `scope`
|
||
|
|
* `note_id`
|