Agent-Flags: useSoul, useIdentity, useUserInfo, useMemory

- 4 neue bool-Properties auf AgentRecord (Default: true)
- DB-Migration: use_soul, use_identity, use_user_info, use_memory
- SystemPromptBuilder: IDENTITY.md, SOUL.md, USER.md, Memory-Block bedingt
- AnthropicService: Memory-Tools nur wenn useMemory aktiv
- Agent-Formular: 4 Checkboxen (Seele, Identität, Gegenüber, Erinnerungen)
- API: Create + Update lesen/speichern die neuen Flags
This commit is contained in:
Meleki committed 2026-03-01 14:33:11 +01:00
1 parent da34739cba
commit 6df3591d8b
8 files changed
+57 -10

No files matched your search

+4 -4
View File
@@ -12,7 +12,7 @@ public static class SystemPromptBuilder
// IDENTITY.md - Wer bin ich (ersetzt "Du bist {Name}.")
var hasIdentity = false;
if (memoryService != null && !string.IsNullOrWhiteSpace(agent.AgentId))
if (agent.UseIdentity && memoryService != null && !string.IsNullOrWhiteSpace(agent.AgentId))
{
var identity = memoryService.ReadMemoryFile(agent.AgentId, "IDENTITY.md");
if (!string.IsNullOrEmpty(identity))
@@ -25,7 +25,7 @@ public static class SystemPromptBuilder
parts.Add($"Du bist {agent.Name}.");
// SOUL.md - Persönlichkeit + Regeln
if (memoryService != null && !string.IsNullOrWhiteSpace(agent.AgentId))
if (agent.UseSoul && memoryService != null && !string.IsNullOrWhiteSpace(agent.AgentId))
{
var soul = memoryService.ReadMemoryFile(agent.AgentId, "SOUL.md");
if (!string.IsNullOrEmpty(soul))
@@ -33,7 +33,7 @@ public static class SystemPromptBuilder
}
// USER.md - Global (aus data-Ordner)
if (!string.IsNullOrWhiteSpace(dataDir))
if (agent.UseUserInfo && !string.IsNullOrWhiteSpace(dataDir))
{
var userFile = System.IO.Path.Combine(dataDir, "USER.md");
if (System.IO.File.Exists(userFile))
@@ -67,7 +67,7 @@ Wenn der User auf eine bestimmte Zeile in einer Datei verweist (z.B. `[Datei: fo
parts.Add($"## Kontext\n{session.Context}");
// Memory-System
if (memoryService != null && !string.IsNullOrWhiteSpace(agent.AgentId))
if (agent.UseMemory && memoryService != null && !string.IsNullOrWhiteSpace(agent.AgentId))
{
var memoryLines = new List<string>
{