feat(brain): Titel-Index fürs kalte Gedächtnis + 'beendet' erkennen
Punkt 4B: jeder System-Prompt bekommt einen kompakten Titel-Index der bewusst gespeicherten Nachschlage-Memories (Zugangsdaten, Infra, Projekte) — ARIA sieht WAS sie hat und holt es via memory_search, statt Stefan nach etwas zu fragen, das schon da ist (Git-Credentials-Vorfall). Auto-distillierte Fakten + Conversation-Logs sind ausgefiltert → billig. Punkt 1: _CONV_END_VERB erkennt jetzt auch 'beendet' (beend\w*) und 'stoppe' (stop\w*) — 'Konversation beendet' schloss vorher das Mikro nicht. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+13
-3
@@ -1402,10 +1402,10 @@ def _extract_flow_markers(text: str) -> tuple:
|
||||
# ([^.!?]{0,15}) in beliebiger Reihenfolge; "befehls?kette" damit "Lieferkette"
|
||||
# o.ae. nicht faelschlich matcht.
|
||||
_CONV_NOUN = r"(?:konversation|gespr[aä]ch|befehls?kette)"
|
||||
_CONV_END_VERB = r"(?:ende|beenden|beende|aus|stop|stopp|schluss)"
|
||||
_CONV_END_VERB = r"(?:ende|beend\w*|aus|stop\w*|schluss)"
|
||||
_END_CONVERSATION_RE = re.compile(
|
||||
rf"\b{_CONV_NOUN}\b[^.!?]{{0,15}}\b{_CONV_END_VERB}\b"
|
||||
rf"|\b(?:beende|schlie(?:ß|ss)e?)\b[^.!?]{{0,15}}\b{_CONV_NOUN}\b",
|
||||
rf"|\b(?:beend\w*|schlie(?:ß|ss)\w*)\b[^.!?]{{0,15}}\b{_CONV_NOUN}\b",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
|
||||
@@ -1929,6 +1929,15 @@ class Agent:
|
||||
logger.warning("Cold-Search fehlgeschlagen: %s", exc)
|
||||
cold = []
|
||||
|
||||
# 3b. Titel-Index des kalten Gedaechtnisses — ARIA sieht WAS sie an
|
||||
# Nachschlage-Wissen hat (Zugangsdaten, Infra, Projekte) und holt es via
|
||||
# memory_search, statt Stefan danach zu fragen. Nur Titel = billig.
|
||||
try:
|
||||
memory_index = self.store.list_index_titles()
|
||||
except Exception as exc:
|
||||
logger.warning("Titel-Index laden fehlgeschlagen: %s", exc)
|
||||
memory_index = []
|
||||
|
||||
# 4. Aktive Skills holen + Tool-Liste bauen
|
||||
all_skills = skills_mod.list_skills(active_only=False)
|
||||
active_skills = [s for s in all_skills if s.get("active", True)]
|
||||
@@ -1951,7 +1960,8 @@ class Agent:
|
||||
oauth_port = os.environ.get("RVS_PORT_PUBLIC", os.environ.get("RVS_PORT", "443")).strip()
|
||||
oauth_tls = os.environ.get("RVS_TLS", "true").strip().lower() != "false"
|
||||
|
||||
system_prompt = build_system_prompt(hot, cold, skills=all_skills,
|
||||
system_prompt = build_system_prompt(hot, cold, memory_index=memory_index,
|
||||
skills=all_skills,
|
||||
triggers=all_triggers,
|
||||
condition_vars=condition_vars,
|
||||
condition_funcs=condition_funcs,
|
||||
|
||||
Reference in New Issue
Block a user