feat: Konversationsgedaechtnis - Kurzzeit-Gespraechsverlauf pro Session

- Store: messages-Tabelle + append_message/get_recent_messages (mit Mandanten-Schutz)
- LLMProvider.complete um history erweitert (openrouter + local bauen system+history+user)
- Orchestrator.chat_text reicht den Verlauf ans LLM weiter
- chat.py: bei session_id letzte HISTORY_MAX_MESSAGES laden, danach User-/Assistant-Turn speichern
- ohne session_id weiterhin zustandslos; ?debug zeigt history_len
- Config HISTORY_MAX_MESSAGES (Default 10)
- Tests: 32 gruen (3 neue Gedaechtnis-Tests)
- Doku aktualisiert (README, BEDIENUNGSANLEITUNG, Architektur)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-06-17 04:16:35 +02:00
commit 16a964032e
12 changed files with 225 additions and 40 deletions

View file

@ -48,7 +48,7 @@ def test_session_route_applies():
def test_chat_per_request_override_and_loopback(monkeypatch):
class StubLLM:
async def complete(self, text, session_id=None):
async def complete(self, text, history=None, session_id=None):
return "Mir geht es gut, danke."
class StubTTS: