Commit graph

3560 commits

Author SHA1 Message Date
Homelab Cursor
44d80d2a9e feat(bot): Schalter Betriebsart Unterlagen (RAG zuerst)
- Neue Tastaturzeile: Unterlagen AUS/AN zeigt Modus und schaltet um.
- document_mode in ask_with_tools: erzwingt lokales Modell und RAG-Pflicht
  wie bei Doc-Keywords (Session wird bei Suche wie bisher bereinigt).
- Optional: doku:/rag: Prefix fuer einmalige Suche ohne Modus.
- Sprache und Hilfetext ergaenzt.
2026-03-26 17:05:06 +01:00
Auto-Sync
b64e9f2acf Auto-Sync: 2026-03-26 17:01 2026-03-26 17:01:54 +01:00
Homelab Cursor
d771a330c7 fix(routing): yearly costs to local RAG, not Sonar
- Remove standalone "kosten" from WEB_TRIGGERS (matched "jährlichen kosten" and sent Perplexity without tools).
- Add LOCAL_OVERRIDES for jahreskosten/jaehrlich/beitragsrechnung phrases.
- Extend forced-RAG keywords and enrich ES query with Beitrag/Beitragsrechnung for cost questions.
- System hint: extract amounts and periods per hit when possible.
2026-03-26 17:01:43 +01:00
Auto-Sync
ec83e3e433 Auto-Sync: 2026-03-26 17:00 2026-03-26 17:00:15 +01:00
Auto-Sync
3b3358d799 Auto-Sync: 2026-03-26 16:56 2026-03-26 16:56:40 +01:00
Homelab Cursor
03f70fdda3 fix(rag): larger forced tool payload (12k) + list all insurance Sparten
- Forced rag_search used top_k=10 and tool content up to 12k chars (was 3k, cut off most hits).
- System instruction: enumerate each Sparte/doc type for same insurer, not only first hit.
- rag.py SYSTEM_PROMPT_EXTRA: same rule for multi-hit answers.
2026-03-26 16:56:29 +01:00
Auto-Sync
6ab0a269d2 Auto-Sync: 2026-03-26 16:51 2026-03-26 16:51:44 +01:00
Homelab Cursor
7b6543be90 fix(rag): strip session history when forced RAG fires
Poisoned session history (4x wrong answers) overrode RAG results.
Now: when doc keywords trigger forced rag_search, rebuild messages
from scratch with ONLY system prompt + RAG results + question.
No session history = no poisoning.
2026-03-26 16:51:29 +01:00
Auto-Sync
6abafbc792 Auto-Sync: 2026-03-26 16:48 2026-03-26 16:48:36 +01:00
Homelab Cursor
e5327cd65e fix(rag): force rag_search in code, do not rely on LLM tool-calling
The LLM ignores system injections when session history already
contains insurance answers. Now: when doc keywords detected, call
rag_search directly in Python, inject results as fake tool-call
into messages. LLM only needs to format the answer.
2026-03-26 16:48:21 +01:00
Auto-Sync
b9141b6b90 Auto-Sync: 2026-03-26 16:46 2026-03-26 16:47:04 +01:00
Auto-Sync
917e55c9e4 Auto-Sync: 2026-03-26 16:45 2026-03-26 16:45:10 +01:00
Auto-Sync
1efaedc1db Auto-Sync: 2026-03-26 16:38 2026-03-26 16:38:55 +01:00
Homelab Cursor
98d0698db0 fix(rag): inject PFLICHT-reminder for doc-keywords to prevent LLM skipping rag_search
When session history already contained insurance/document answers,
the LLM would skip rag_search and hallucinate from memory.
Now: if doc keywords detected, inject system-message reminder AFTER
session history but BEFORE user question, forcing rag_search call.

Fixes #51 follow-up: LVM query returned wrong answer.
2026-03-26 16:38:29 +01:00
Auto-Sync
ecfe546d45 Auto-Sync: 2026-03-26 16:30 2026-03-26 16:30:09 +01:00
Auto-Sync
aac217ef18 Auto-Sync: 2026-03-26 16:15 2026-03-26 16:15:14 +01:00
Auto-Sync
ac89532e8e Auto-Sync: 2026-03-26 16:00 2026-03-26 16:00:10 +01:00
Auto-Sync
e507f8ac6f Auto-Sync: 2026-03-26 15:45 2026-03-26 15:45:09 +01:00
Auto-Sync
a8c69308e6 Auto-Sync: 2026-03-26 15:30 2026-03-26 15:30:09 +01:00
Homelab Cursor
59e53a2750 rag: 19/20 E2E-Tests bestanden — Dedup + Anti-Halluzination + Pflicht-Prompt
- Dedup auf Dateinamen-Ebene (Extension + Kopie-Marker ignorieren)
- docnm_kwd boost 1.5→3.0 fuer bessere Ordner-Treffer
- SYSTEM_PROMPT_EXTRA verschaerft: IMMER rag_search bei Dokument-Fragen
- Expliziter Ende-Marker gegen LLM-Halluzination
- MIN_TOP_K=5, Default top_k=8
- Content-Snippet 400→600 Zeichen
Ref: Issue #51
2026-03-26 15:25:52 +01:00
Homelab Cursor
a43c0b913b rag: bessere Treffer + Anti-Halluzination
- top_k min=5, default=8 (LLM kann nicht mehr top_k=3 setzen)
- docnm_kwd boost 1.5→3.0 (Ordner/Dateinamen staerker gewichten)
- Ordnerpfad als Kategorie-Info in Ausgabe
- Content-Snippet 400→600 Zeichen
- SYSTEM_PROMPT_EXTRA: LLM darf keine Details erfinden
- es_size erhoehen fuer breitere Suche
Ref: Issue #51
2026-03-26 15:07:31 +01:00
Homelab Cursor
0e1c7a6ebb llm: Routing-Fix — Dokument-Keywords in LOCAL_OVERRIDES
Versicherung/Vertrag/Steuer/Rente/Dokument etc. routen jetzt lokal
statt zu Sonar, damit rag_search per Tool-Calling aufgerufen wird.
Vorher: aktuell in Frage -> Sonar -> kein Tool-Calling -> kein RAG.
Ref: Issue #51
2026-03-26 14:43:56 +01:00
Auto-Sync
c8512d0d09 Auto-Sync: 2026-03-26 14:34 2026-03-26 14:34:53 +01:00
Homelab Cursor
f9b69ad283 rag: Elasticsearch direkt (Hybrid kNN + deutsch) statt RAGFlow API
- ES 100.109.101.12:1200, Filter kb_id, knn auf q_768_vec
- Query-Embedding via Ollama nomic-embed-text
- Text: content_de, content_ltks, docnm_kwd
- OCR-Heuristik, Deduplizierung nach docnm_kwd
- Ref: Issue #51
2026-03-26 14:34:40 +01:00
Auto-Sync
3dc991fdbf Auto-Sync: 2026-03-26 14:30 2026-03-26 14:30:21 +01:00
Auto-Sync
2431aa6f12 Auto-Sync: 2026-03-26 14:15 2026-03-26 14:15:19 +01:00
Auto-Sync
bb0966bd82 Auto-Sync: 2026-03-26 14:00 2026-03-26 14:00:10 +01:00
Auto-Sync
b4b5451443 Auto-Sync: 2026-03-26 13:45 2026-03-26 13:45:10 +01:00
Auto-Sync
2bd9ee501d Auto-Sync: 2026-03-26 13:30 2026-03-26 13:30:10 +01:00
Auto-Sync
d1911ff326 Auto-Sync: 2026-03-26 13:15 2026-03-26 13:15:09 +01:00
Auto-Sync
cd6acac2ce Auto-Sync: 2026-03-26 13:00 2026-03-26 13:00:09 +01:00
Auto-Sync
a9d40af79e Auto-Sync: 2026-03-26 12:45 2026-03-26 12:45:10 +01:00
Auto-Sync
9d79af7481 Auto-Sync: 2026-03-26 12:30 2026-03-26 12:30:10 +01:00
Auto-Sync
ad19a6125e Auto-Sync: 2026-03-26 12:15 2026-03-26 12:15:09 +01:00
Auto-Sync
8cb9293ebe Auto-Sync: 2026-03-26 12:00 2026-03-26 12:00:10 +01:00
Auto-Sync
f954467037 Auto-Sync: 2026-03-26 11:45 2026-03-26 11:45:09 +01:00
Auto-Sync
b22f0e654c Auto-Sync: 2026-03-26 11:30 2026-03-26 11:30:10 +01:00
Auto-Sync
cf8fd46238 Auto-Sync: 2026-03-26 11:15 2026-03-26 11:15:09 +01:00
Auto-Sync
be95938beb Auto-Sync: 2026-03-26 11:00 2026-03-26 11:00:10 +01:00
Auto-Sync
764ed73419 Auto-Sync: 2026-03-26 10:45 2026-03-26 10:45:09 +01:00
Auto-Sync
1a38e6179c Auto-Sync: 2026-03-26 10:30 2026-03-26 10:30:10 +01:00
Auto-Sync
45e6658bb9 Auto-Sync: 2026-03-26 10:15 2026-03-26 10:15:09 +01:00
Auto-Sync
03aa9fa4da Auto-Sync: 2026-03-26 10:00 2026-03-26 10:00:09 +01:00
Auto-Sync
806fc4795c Auto-Sync: 2026-03-26 09:45 2026-03-26 09:45:09 +01:00
Auto-Sync
acba403a1a Auto-Sync: 2026-03-26 09:30 2026-03-26 09:30:10 +01:00
Auto-Sync
8b1862bee7 Auto-Sync: 2026-03-26 09:15 2026-03-26 09:15:09 +01:00
Auto-Sync
79efbc4a45 Auto-Sync: 2026-03-26 09:00 2026-03-26 09:00:10 +01:00
Auto-Sync
a555690b5b Auto-Sync: 2026-03-26 08:45 2026-03-26 08:45:09 +01:00
Auto-Sync
4994f8c2d9 Auto-Sync: 2026-03-26 08:30 2026-03-26 08:30:09 +01:00
Auto-Sync
ff0d6b4e77 Auto-Sync: 2026-03-26 08:15 2026-03-26 08:15:09 +01:00