This commit is contained in:
1 parent
23b1cb2966
commit
e9532e8878
30 files changed
+1835
-542
No files matched your search
@@ -1,23 +1,63 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
FILE: scripts/setup_mindnet_collections.py
|
||||
VERSION: 2.1.0 (2025-12-15)
|
||||
STATUS: Active
|
||||
COMPATIBILITY: v2.9.1 (Post-WP14/WP-15b)
|
||||
|
||||
Zweck:
|
||||
-------
|
||||
Richtet die Qdrant-Collections für das mindnet-Projekt ein.
|
||||
Legt Collections und Payload-Indizes an (idempotent).
|
||||
|
||||
Collections:
|
||||
- mindnet_chunks : semantische Suche über Markdown-Text-Chunks (Vektor: dim/Cosine)
|
||||
- mindnet_notes : 1 Punkt pro Notiz (Metadaten, optional Titel-Embedding)
|
||||
- mindnet_edges : explizite Link-Kanten (Dummy-Vektor size=1; Filter über Payload)
|
||||
Funktionsweise:
|
||||
---------------
|
||||
1. Prüft Qdrant-Verfügbarkeit (optional /ready Endpoint)
|
||||
2. Legt drei Collections an:
|
||||
- {prefix}_chunks: Semantische Suche über Text-Chunks (Vektor: dim/Cosine)
|
||||
- {prefix}_notes: Metadaten pro Notiz (Vektor: dim/Cosine)
|
||||
- {prefix}_edges: Link-Kanten (Dummy-Vektor size=1, Filter über Payload)
|
||||
3. Richtet Payload-Indizes ein:
|
||||
- Keyword-Indizes für häufige Filter-Felder
|
||||
- Text-Index für Volltextsuche (chunks.text)
|
||||
|
||||
Eigenschaften:
|
||||
- Idempotent: legt nur an, wenn eine Collection noch nicht existiert
|
||||
- Legt sinnvolle Payload-Indizes an (keyword/text)
|
||||
- Ohne "global"-Seiteneffekte; Qdrant-URL wird sauber übergeben
|
||||
Ergebnis-Interpretation:
|
||||
------------------------
|
||||
- Ausgabe: Status pro Collection ([+] angelegt, [=] existiert bereits)
|
||||
- Abschluss: JSON-Liste aller vorhandenen Collections
|
||||
- Exit-Code 0: Erfolgreich
|
||||
- Exit-Code 1: Fehler (z.B. Qdrant nicht erreichbar)
|
||||
|
||||
Aufrufbeispiel:
|
||||
python3 setup_mindnet_collections.py \
|
||||
--qdrant-url http://127.0.0.1:6333 \
|
||||
--prefix mindnet \
|
||||
--dim 384 \
|
||||
--distance Cosine
|
||||
Verwendung:
|
||||
-----------
|
||||
- Initial-Setup einer neuen mindnet-Instanz
|
||||
- Nach Qdrant-Reset oder Migration
|
||||
- Validierung der Collection-Struktur
|
||||
|
||||
Hinweise:
|
||||
---------
|
||||
- Idempotent: Überspringt existierende Collections
|
||||
- Nutzt HTTP-API direkt (kein qdrant-client)
|
||||
- Legt nur Basis-Indizes an (erweiterte Indizes via ensure_payload_indexes)
|
||||
|
||||
Aufruf:
|
||||
-------
|
||||
python3 -m scripts.setup_mindnet_collections --qdrant-url http://127.0.0.1:6333 --prefix mindnet --dim 768
|
||||
python3 -m scripts.setup_mindnet_collections --prefix mindnet_dev --dim 768 --distance Cosine
|
||||
|
||||
Parameter:
|
||||
----------
|
||||
--qdrant-url URL Qdrant-URL (Default: http://127.0.0.1:6333)
|
||||
--prefix TEXT Collection-Präfix (Default: mindnet)
|
||||
--dim INT Vektor-Dimension (Default: 384, empfohlen: 768 für nomic)
|
||||
--distance METRIC Cosine | Euclid | Dot (Default: Cosine)
|
||||
|
||||
Änderungen:
|
||||
-----------
|
||||
v2.1.0 (2025-12-15): Kompatibilität mit WP-14 Modularisierung
|
||||
- Dokumentation aktualisiert
|
||||
v1.0.0: Initial Release
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
Reference in new issue
Block a user