Update documentation and technical references for Mindnet v3.1.1: Revise versioning across all documents to reflect the latest updates, including the integration of Lazy-Prompt-Orchestration and enhancements in AI model capabilities. Update context descriptions to clarify new features and improvements in prompt management, ingestion validation, and decision engine processes.

This commit is contained in:
Lars committed 2026-01-03 09:56:49 +01:00
1 parent 8505538b34
commit 62a00d1ac3
12 files changed
+732 -66

No files matched your search

@@ -1,10 +1,10 @@
---
doc_type: technical_reference
audience: developer, admin
scope: configuration, env, registry, scoring, resilience, modularization, agentic_rag, moe
scope: configuration, env, registry, scoring, resilience, modularization, agentic_rag, moe, lazy_prompts
status: active
version: 3.0.0
context: "Umfassende Referenztabellen für Umgebungsvariablen (inkl. Hybrid-Cloud & WP-76), YAML-Konfigurationen, Edge Registry Struktur, WP-25 Multi-Stream RAG und WP-25a Mixture of Experts (MoE) unter Berücksichtigung von WP-14."
version: 3.1.1
context: "Umfassende Referenztabellen für Umgebungsvariablen (inkl. Hybrid-Cloud & WP-76), YAML-Konfigurationen, Edge Registry Struktur, WP-25 Multi-Stream RAG, WP-25a Mixture of Experts (MoE) und WP-25b Lazy-Prompt-Orchestration unter Berücksichtigung von WP-14."
---
# Konfigurations-Referenz
@@ -302,13 +302,47 @@ Die Strategie `INTERVIEW` dient der strukturierten Datenerfassung.
> **Hinweis:** Da spezifische Schemas für Projekte oder Erfahrungen direkt in der `types.yaml` definiert werden, dient die `decision_engine.yaml` hier primär als Fallback für generische Datenaufnahmen.
### 5.6 Prompts-Konfiguration (`prompts.yaml` v3.1.2)
### 5.6 Prompts-Konfiguration (`prompts.yaml` v3.2.2 - WP-25b)
Seit WP-25 nutzen die Synthese-Templates explizite Stream-Variablen:
Seit WP-25b nutzt MindNet eine **hierarchische Prompt-Struktur** mit Lazy-Loading. Prompts werden erst zur Laufzeit geladen, basierend auf dem exakt aktiven Modell.
**Template-Struktur:**
**Hierarchische Template-Struktur:**
```yaml
decision_synthesis_v1:
# Level 1: Modell-spezifisch (höchste Priorität)
"google/gemini-2.0-flash-exp:free": |
WERTE & PRINZIPIEN (Identität):
{values_stream}
OPERATIVE FAKTEN (Realität):
{facts_stream}
RISIKO-RADAR (Konsequenzen):
{risk_stream}
ENTSCHEIDUNGSFRAGE:
{query}
Nutze deine hohe Reasoning-Kapazität für eine tiefe Synthese.
"meta-llama/llama-3.3-70b-instruct:free": |
Erstelle eine fundierte Synthese für die Frage: "{query}"
Nutze die Daten: {values_stream}, {facts_stream} und {risk_stream}.
Trenne klare Fakten von Erfahrungen. Bleibe strikt beim bereitgestellten Kontext.
# Level 2: Provider-Fallback (mittlere Priorität)
openrouter: |
WERTE & PRINZIPIEN (Identität):
{values_stream}
OPERATIVE FAKTEN (Realität):
{facts_stream}
RISIKO-RADAR (Konsequenzen):
{risk_stream}
ENTSCHEIDUNGSFRAGE:
{query}
ollama: |
WERTE & PRINZIPIEN (Identität):
{values_stream}
@@ -321,13 +355,31 @@ decision_synthesis_v1:
ENTSCHEIDUNGSFRAGE:
{query}
# Level 3: Global Default (niedrigste Priorität)
default: |
Synthetisiere die folgenden Informationen für: {query}
{values_stream} | {facts_stream} | {risk_stream}
```
**Auflösungs-Logik:**
1. **Level 1:** Exakte Modell-ID (z.B. `google/gemini-2.0-flash-exp:free`)
2. **Level 2:** Provider-Fallback (z.B. `openrouter`, `ollama`, `gemini`)
3. **Level 3:** Global Default (`default` → `gemini` → `ollama` → `""`)
**Lazy-Loading:**
* Prompts werden erst zur Laufzeit geladen, wenn das aktive Modell bekannt ist
* **Parameter:** `prompt_key` und `variables` statt vorformatierter Strings
* **Vorteil:** Maximale Resilienz bei Modell-Fallbacks (Cloud → Local)
**Pre-Initialization:**
Alle möglichen Stream-Variablen werden vorab initialisiert (verhindert KeyErrors bei unvollständigen Konfigurationen).
**Provider-spezifische Templates:**
Separate Versionen für Ollama, Gemini und OpenRouter.
**PROMPT-TRACE Logging:**
Das System protokolliert die genutzte Auflösungs-Ebene:
* `🎯 [PROMPT-TRACE] Level 1 Match: Model-specific`
* `📡 [PROMPT-TRACE] Level 2 Match: Provider-fallback`
* `⚓ [PROMPT-TRACE] Level 3 Match: Global Default`
---
@@ -404,6 +456,261 @@ values_stream:
---
## 7. Konfigurations-Verbindungen & Datenfluss
Die vier zentralen Konfigurationsdateien (`types.yaml`, `decision_engine.yaml`, `llm_profiles.yaml`, `prompts.yaml`) arbeiten eng zusammen, um das agentische Multi-Stream RAG System zu steuern. Diese Sektion erklärt die Verbindungen und zeigt einen konkreten Praxisablauf.
### 7.1 Architektur-Übersicht
```mermaid
graph TB
subgraph "1. Typ-Definition (types.yaml)"
T1[Typ: value<br/>chunking_profile: structured_strict<br/>retriever_weight: 1.00]
T2[Typ: risk<br/>chunking_profile: sliding_short<br/>retriever_weight: 0.85]
T3[Typ: project<br/>chunking_profile: sliding_smart_edges<br/>retriever_weight: 0.97]
end
subgraph "2. Stream-Konfiguration (decision_engine.yaml)"
D1[values_stream<br/>filter_types: value, principle, belief...<br/>llm_profile: identity_safe<br/>compression_profile: identity_safe]
D2[risk_stream<br/>filter_types: risk, obstacle, bias<br/>llm_profile: synthesis_pro<br/>compression_profile: compression_fast]
D3[facts_stream<br/>filter_types: project, decision, task...<br/>llm_profile: synthesis_pro<br/>compression_profile: compression_fast]
end
subgraph "3. Strategie-Komposition (decision_engine.yaml)"
S1[DECISION Strategie<br/>use_streams: values_stream, facts_stream, risk_stream<br/>llm_profile: synthesis_pro<br/>prompt_template: decision_synthesis_v1]
end
subgraph "4. Experten-Profile (llm_profiles.yaml)"
P1[synthesis_pro<br/>provider: openrouter<br/>model: google/gemini-2.0-flash-exp:free<br/>temperature: 0.7<br/>fallback_profile: synthesis_backup]
P2[compression_fast<br/>provider: openrouter<br/>model: mistralai/mistral-7b-instruct:free<br/>temperature: 0.1<br/>fallback_profile: identity_safe]
P3[identity_safe<br/>provider: ollama<br/>model: phi3:mini<br/>temperature: 0.2<br/>fallback_profile: null]
end
subgraph "5. Prompt-Templates (prompts.yaml)"
PR1[decision_synthesis_v1<br/>Level 1: google/gemini-2.0-flash-exp:free<br/>Level 2: openrouter<br/>Level 3: default]
end
T1 -->|filter_types| D1
T2 -->|filter_types| D2
T3 -->|filter_types| D3
D1 -->|use_streams| S1
D2 -->|use_streams| S1
D3 -->|use_streams| S1
S1 -->|llm_profile| P1
D1 -->|llm_profile| P3
D2 -->|compression_profile| P2
D3 -->|compression_profile| P2
S1 -->|prompt_template| PR1
P1 -->|model lookup| PR1
style T1 fill:#e1f5ff
style T2 fill:#e1f5ff
style T3 fill:#e1f5ff
style D1 fill:#fff4e1
style D2 fill:#fff4e1
style D3 fill:#fff4e1
style S1 fill:#ffe1f5
style P1 fill:#e1ffe1
style P2 fill:#e1ffe1
style P3 fill:#e1ffe1
style PR1 fill:#f5e1ff
```
### 7.2 Verbindungs-Matrix
| Von | Zu | Verbindung | Beschreibung |
| :--- | :--- | :--- | :--- |
| **`types.yaml`** | **`decision_engine.yaml`** | `filter_types` | Streams filtern Notizen basierend auf Typen aus `types.yaml`. Die Liste `filter_types: ["value", "principle", "belief"]` muss exakt den Typ-Namen aus `types.yaml` entsprechen. |
| **`types.yaml`** | **`decision_engine.yaml`** | `detection_keywords` | Keywords aus `types.yaml` werden für den Interview-Modus verwendet (z.B. "Projekt" + "neu" → `INTERVIEW`). |
| **`decision_engine.yaml`** | **`llm_profiles.yaml`** | `router_profile` | Intent-Erkennung nutzt das Profil `compression_fast` für schnelle Klassifizierung. |
| **`decision_engine.yaml`** | **`llm_profiles.yaml`** | `llm_profile` (Stream) | Jeder Stream definiert sein eigenes Profil für Retrieval und Kompression (z.B. `identity_safe` für Privacy). |
| **`decision_engine.yaml`** | **`llm_profiles.yaml`** | `llm_profile` (Strategie) | Die finale Synthese nutzt das Strategie-Profil (z.B. `synthesis_pro` für DECISION). |
| **`decision_engine.yaml`** | **`llm_profiles.yaml`** | `compression_profile` | Überlange Streams werden via `compression_profile` verdichtet (z.B. `compression_fast`). |
| **`decision_engine.yaml`** | **`prompts.yaml`** | `prompt_template` | Strategien referenzieren Template-Keys (z.B. `decision_synthesis_v1`). |
| **`llm_profiles.yaml`** | **`prompts.yaml`** | Hierarchische Auflösung | Das aktive Modell aus dem Profil bestimmt, welcher Prompt-Level geladen wird (Model-ID → Provider → Default). |
| **`llm_profiles.yaml`** | **`llm_profiles.yaml`** | `fallback_profile` | Rekursive Fallback-Kaskade bei Fehlern (z.B. `synthesis_pro` → `synthesis_backup` → `identity_safe`). |
### 7.3 Praxisbeispiel: DECISION-Anfrage
**User-Anfrage:** `"Soll ich das neue Projekt starten?"`
#### Schritt 1: Intent-Erkennung
**Datei:** `decision_engine.yaml`
```yaml
settings:
router_profile: "compression_fast" # → llm_profiles.yaml
router_prompt_key: "intent_router_v1" # → prompts.yaml
```
**Ablauf:**
1. System prüft `trigger_keywords` in `DECISION` Strategie → findet `"soll ich"` → **Intent: DECISION**
2. Falls kein Keyword-Match: LLM-Router nutzt `compression_fast` Profil aus `llm_profiles.yaml`
3. Router lädt `intent_router_v1` aus `prompts.yaml` (hierarchisch basierend auf aktivem Modell)
#### Schritt 2: Stream-Aktivierung
**Datei:** `decision_engine.yaml`
```yaml
strategies:
DECISION:
use_streams: ["values_stream", "facts_stream", "risk_stream"]
llm_profile: "synthesis_pro" # → llm_profiles.yaml
prompt_template: "decision_synthesis_v1" # → prompts.yaml
```
**Ablauf:**
1. System aktiviert drei parallele Streams: `values_stream`, `facts_stream`, `risk_stream`
#### Schritt 3: Stream-Konfiguration & Typ-Filterung
**Datei:** `decision_engine.yaml` (Streams) + `types.yaml` (Typ-Definitionen)
```yaml
# decision_engine.yaml
values_stream:
filter_types: ["value", "principle", "belief", "trait", "boundary", "need", "motivation"]
llm_profile: "identity_safe" # → llm_profiles.yaml
compression_profile: "identity_safe" # → llm_profiles.yaml
query_template: "Welche meiner Werte und Prinzipien betreffen: {query}"
facts_stream:
filter_types: ["project", "decision", "task", "goal", "event", "state"]
llm_profile: "synthesis_pro" # → llm_profiles.yaml
compression_profile: "compression_fast" # → llm_profiles.yaml
query_template: "Status, Ressourcen und Fakten zu: {query}"
risk_stream:
filter_types: ["risk", "obstacle", "bias"]
llm_profile: "synthesis_pro" # → llm_profiles.yaml
compression_profile: "compression_fast" # → llm_profiles.yaml
query_template: "Gefahren, Hindernisse oder Risiken bei: {query}"
```
**Ablauf:**
1. **Values Stream:** Sucht in Qdrant nach Notizen mit `type IN ["value", "principle", "belief", ...]` (definiert in `types.yaml`)
2. **Facts Stream:** Sucht nach Notizen mit `type IN ["project", "decision", "task", ...]` (definiert in `types.yaml`)
3. **Risk Stream:** Sucht nach Notizen mit `type IN ["risk", "obstacle", "bias"]` (definiert in `types.yaml`)
#### Schritt 4: Profil-Auflösung & Modell-Auswahl
**Datei:** `llm_profiles.yaml`
```yaml
synthesis_pro:
provider: "openrouter"
model: "google/gemini-2.0-flash-exp:free"
temperature: 0.7
fallback_profile: "synthesis_backup" # → Rekursiver Fallback
compression_fast:
provider: "openrouter"
model: "mistralai/mistral-7b-instruct:free"
temperature: 0.1
fallback_profile: "identity_safe"
identity_safe:
provider: "ollama"
model: "phi3:mini"
temperature: 0.2
fallback_profile: null # Terminaler Endpunkt
```
**Ablauf:**
1. **Values Stream:** Nutzt `identity_safe` → Ollama/phi3:mini (lokal, Privacy)
2. **Facts Stream:** Nutzt `synthesis_pro` → OpenRouter/Gemini 2.0 (Cloud)
3. **Risk Stream:** Nutzt `synthesis_pro` → OpenRouter/Gemini 2.0 (Cloud)
4. **Kompression:** Falls Stream > `compression_threshold`, nutzt `compression_fast` → OpenRouter/Mistral 7B
#### Schritt 5: Prompt-Loading (Hierarchische Auflösung)
**Datei:** `prompts.yaml`
```yaml
decision_synthesis_v1:
# Level 1: Modell-spezifisch (höchste Priorität)
"google/gemini-2.0-flash-exp:free": |
Agiere als strategischer Partner für: {query}
WERTE: {values_stream} | FAKTEN: {facts_stream} | RISIKEN: {risk_stream}
Prüfe die Fakten gegen meine Werte. Zeige Zielkonflikte auf. Gib eine klare Empfehlung.
# Level 2: Provider-Fallback
openrouter: |
Strategische Multi-Stream Analyse für: {query}
Werte-Basis: {values_stream} | Fakten: {facts_stream} | Risiken: {risk_stream}
Bitte wäge ab und gib eine Empfehlung.
# Level 3: Global Default
default: "Prüfe {query} gegen Werte {values_stream} und Fakten {facts_stream}."
```
**Ablauf:**
1. System hat `synthesis_pro` Profil geladen → Modell: `google/gemini-2.0-flash-exp:free`
2. System sucht in `prompts.yaml` nach `decision_synthesis_v1`:
- **Level 1:** Findet exakten Match für `google/gemini-2.0-flash-exp:free` → **Verwendet diesen Prompt**
- Falls nicht gefunden: **Level 2** → `openrouter` Fallback
- Falls nicht gefunden: **Level 3** → `default` Fallback
3. Prompt wird mit Stream-Variablen formatiert: `{values_stream}`, `{facts_stream}`, `{risk_stream}`, `{query}`
#### Schritt 6: Finale Synthese
**Ablauf:**
1. System ruft LLM auf mit:
- **Profil:** `synthesis_pro` (OpenRouter/Gemini 2.0, Temperature 0.7)
- **Prompt:** Level-1 Template aus `prompts.yaml` (modell-spezifisch optimiert)
- **Variablen:** Formatierte Stream-Inhalte
2. Falls Fehler (z.B. Rate-Limit 429):
- **Fallback:** `synthesis_backup` (Llama 3.3)
- **Prompt:** Automatisch Level-2 (`openrouter`) oder Level-3 (`default`) geladen
3. Antwort wird an User zurückgegeben
### 7.4 Konfigurations-Synchronisation Checkliste
Beim Ändern einer Konfigurationsdatei müssen folgende Abhängigkeiten geprüft werden:
**✅ `types.yaml` ändern:**
- [ ] Prüfe, ob `filter_types` in `decision_engine.yaml` Streams noch gültig sind
- [ ] Prüfe, ob `detection_keywords` für Interview-Modus noch passen
- [ ] Prüfe, ob `chunking_profile` noch existiert (in `types.yaml` definiert)
**✅ `decision_engine.yaml` ändern:**
- [ ] Prüfe, ob alle `filter_types` in Streams existieren in `types.yaml`
- [ ] Prüfe, ob alle `llm_profile` / `compression_profile` existieren in `llm_profiles.yaml`
- [ ] Prüfe, ob alle `prompt_template` Keys existieren in `prompts.yaml`
**✅ `llm_profiles.yaml` ändern:**
- [ ] Prüfe, ob `fallback_profile` Referenzen zirkulär sind (Schutz: `visited_profiles`)
- [ ] Prüfe, ob alle referenzierten Profile existieren
- [ ] Prüfe, ob Modell-IDs mit `prompts.yaml` Level-1 Keys übereinstimmen (optional, aber empfohlen)
**✅ `prompts.yaml` ändern:**
- [ ] Prüfe, ob alle `prompt_template` Keys aus `decision_engine.yaml` existieren
- [ ] Prüfe, ob Modell-spezifische Keys (Level 1) mit `llm_profiles.yaml` Modell-IDs übereinstimmen
- [ ] Prüfe, ob alle Stream-Variablen (`{values_stream}`, `{facts_stream}`, etc.) initialisiert werden
### 7.5 Debugging-Tipps
**Problem:** Stream findet keine Notizen
- **Prüfung:** `filter_types` in Stream stimmt mit Typ-Namen in `types.yaml` überein? (Case-sensitive!)
- **Prüfung:** Existieren Notizen mit diesen Typen im Vault?
**Problem:** Falsches Modell wird verwendet
- **Prüfung:** `llm_profile` in Stream/Strategie existiert in `llm_profiles.yaml`?
- **Prüfung:** `fallback_profile` Kaskade führt zu unerwartetem Modell?
**Problem:** Prompt wird nicht gefunden
- **Prüfung:** `prompt_template` Key existiert in `prompts.yaml`?
- **Prüfung:** Hierarchische Auflösung (Level 1 → 2 → 3) funktioniert? (Logs: `[PROMPT-TRACE]`)
**Problem:** Kompression wird nicht ausgelöst
- **Prüfung:** `compression_threshold` in Stream-Konfiguration gesetzt?
- **Prüfung:** `compression_profile` existiert in `llm_profiles.yaml`?
---
Auszug aus der decision_engine.yaml
```yaml
strategies: