|
All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 3s
Reviewed-on: #8 # Merge Request: WP-11 Backend Intelligence & Async Core (v2.4.0) **Branch:** `feature/wp11-backend-intelligence` → `main` **Reviewer:** @Mindmaster **Status:** ✅ Ready to Merge ## 🎯 Zielsetzung Dieses Update implementiert die "Active Intelligence" Architektur. Das System wechselt von einer reaktiven Suche zu einem proaktiven Assistenten, der während des Schreibens im Editor semantische Verknüpfungen vorschlägt. Zudem wurde der gesamte Core auf `asyncio` umgestellt, um Timeouts bei der Generierung zu verhindern. ## 🛠 Technische Änderungen ### 1. Async & Performance * **Ingestion:** `scripts/import_markdown.py` und `app/core/ingestion.py` laufen nun asynchron. * **Embeddings:** Neuer `EmbeddingsClient` nutzt `httpx` statt `requests` (Non-blocking). * **Semaphore:** Import nutzt max. 5 parallele Tasks, um Ollama-Überlastung zu verhindern. ### 2. Quality Upgrade (Nomic) * **Modell:** Wechsel von `sentence-transformers` (384 dim) auf `nomic-embed-text` (768 dim). * **Effekt:** Massiv verbesserte semantische Trefferquote (siehe "Italien-Test"). ### 3. Intelligence Features * **Active Intelligence:** Neuer Endpoint `/ingest/analyze` analysiert Drafts mittels "Sliding Window". * **Exact Match:** Erkennt Aliases (z.B. "KI-Gedächtnis") zuverlässig. * **Matrix Logic:** `DiscoveryService` wählt Kanten-Typen kontextsensitiv (z.B. `experience` + `value` -> `based_on`). ### 4. Frontend Integration * **UI:** Neuer Tab "🧠 Intelligence" im manuellen Editor. * **State:** "Resurrection Pattern" verhindert Datenverlust beim Tab-Wechsel. ## ⚠️ Breaking Changes (WICHTIG für Deployment) Dieses Release ist **nicht abwärtskompatibel** zur Datenbank von v2.3! 1. **Vektor-Dimension:** Geändert von 384 auf 768. 2. **Ollama:** Modell `nomic-embed-text` ist PFLICHT. 3. **Config:** `.env` benötigt `VECTOR_DIM=768` und `MINDNET_EMBEDDING_MODEL`. ## 🧪 Test-Protokoll | Test | Befehl | Status | | :--- | :--- | :--- | | **Alias Lookup** | `python debug_analysis.py` | ✅ Pass | | **Async Import** | `python -m scripts.import_markdown ...` | ✅ Pass | | **API Intelligence** | `curl ... /ingest/analyze` | ✅ Pass | | **UI Interaction** | Editor öffnen -> Analyse -> Link einfügen | ✅ Pass | ## 🔄 Deployment Schritte Nach dem Merge auf dem Server ausführen: 1. `git pull` 2. `pip install -r requirements.txt` 3. `ollama pull nomic-embed-text` 4. **DB Reset:** `python -m scripts.reset_qdrant --mode wipe --prefix mindnet --yes` 5. **Re-Import:** `python -m scripts.import_markdown --vault ./vault --prefix mindnet --apply --force` 6. `sudo systemctl restart mindnet-prod mindnet-ui-prod` |
||
|---|---|---|
| .gitea/workflows | ||
| .vscode | ||
| app | ||
| config | ||
| docker | ||
| docs | ||
| Programmmanagement | ||
| schemas | ||
| scripts | ||
| tests | ||
| vault | ||
| README.md | ||
| requirements.txt | ||
mindnet API (bundle)
This bundle provides a minimal FastAPI app for embeddings and Qdrant upserts/queries plus a Markdown importer.
Quick start
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# Environment (adjust as needed)
export QDRANT_URL=http://127.0.0.1:6333
export MINDNET_PREFIX=mindnet
export MINDNET_MODEL=sentence-transformers/all-MiniLM-L6-v2
# Run API
uvicorn app.main:app --host 0.0.0.0 --port 8001 --workers 1
# (optional) Ensure collections exist (or use setup_mindnet_collections.py you already have)
# python3 scripts/setup_mindnet_collections.py --qdrant-url $QDRANT_URL --prefix $MINDNET_PREFIX --dim 384 --distance Cosine
# Import some notes
python3 scripts/import_markdown.py --vault /path/to/Obsidian
Endpoints
POST /embed→{ "texts": [...] }→ 384-d vectorsPOST /qdrant/upsert_notePOST /qdrant/upsert_chunkPOST /qdrant/upsert_edgePOST /qdrant/query→ semantic search over chunks with optional filters
See scripts/quick_test.sh for a runnable example.
Anmerkung: Diese Datei ist veraltet