Refine interaction memory into a social profile

This commit is contained in:
Meta Vens 2026-04-25 07:56:00 +01:00
commit bfe5ba3cd4
7 changed files with 585 additions and 41 deletions

View file

@ -364,6 +364,8 @@ function buildSystemPrompt(context: ContextBundle): string {
"Stay honest about what context was actually provided to you.",
"Use retrieved snippets and recent channel context when they help answer the question.",
"If explicit interaction memory for the current speaker is attached, you may let it gently color the tone and reference it when relevant, but do not invent history beyond what was provided.",
"If that memory suggests the speaker is ambitious but anxious or insecure, be affirming without feeding pie-in-the-sky nonsense. Ground big plans in constraints, evidence, and the next concrete step.",
"If that memory suggests the speaker is repeatedly pushy, dismissive, or refuses to listen, push back, set boundaries, or refuse instead of acting like a servant.",
"When the answer depends on archived Discord history or indexed repo/lore context, use the available read-only tools instead of guessing.",
"If you need to target a specific indexed repo and do not know the valid repo names yet, call list_indexed_repos before search_sources.",
renderSourceGroundingInstructions(context, false),
@ -437,6 +439,9 @@ function renderInteractionMemory(context: ContextBundle): string {
`- Summary: ${context.interactionMemory.summary}`,
`- Disposition: ${context.interactionMemory.disposition}`,
`- Affinity score: ${context.interactionMemory.affinityScore}`,
`- Psychological profile: ${context.interactionMemory.psychologicalProfile}`,
`- Inferred traits: ${context.interactionMemory.inferredTraits.length > 0 ? context.interactionMemory.inferredTraits.join(", ") : "(none yet)"}`,
`- Response guidance: ${context.interactionMemory.responseGuidance}`,
`- Direct remembered interactions: ${context.interactionMemory.directInteractionCount}`,
`- Ambient remembered mentions: ${context.interactionMemory.ambientMentionCount}`,
"- Specific remembered incidents:",

View file

@ -1009,6 +1009,8 @@ function buildDiscordReplyPrompt(
"- When the moment invites voice, wit, or a memorable turn of phrase, take a beat to choose wording with bite instead of blurting the first serviceable sentence. Do not overwork straightforward technical replies.",
"- The configured MCP tools are available in this session, especially search_history, get_message_context, list_indexed_repos, search_sources, and get_source_context.",
"- If explicit interaction memory for the current speaker is attached, you may let it subtly color the tone and reference it when relevant, but do not invent relationship history beyond that record.",
"- If that memory suggests the speaker is ambitious but anxious or insecure, be affirming without feeding pie-in-the-sky fantasies. Ground large plans in constraints, evidence, and the next concrete move.",
"- If that memory suggests the speaker is repeatedly pushy, dismissive, or not listening, push back, set boundaries, or refuse instead of acting like a servant.",
`- search_history and search_sources accept limit values between 1 and ${MAX_HISTORY_LIMIT}. Do not ask for more than ${MAX_HISTORY_LIMIT} results in one call.`,
"- get_message_context and get_source_context accept before/after values between 0 and 20. Do not ask for larger context windows in one call.",
"- You may inspect the workspace and use safe read-only commands if needed.",
@ -1156,6 +1158,9 @@ function renderInteractionMemory(context: ContextBundle): string {
`- Summary: ${context.interactionMemory.summary}`,
`- Disposition: ${context.interactionMemory.disposition}`,
`- Affinity score: ${context.interactionMemory.affinityScore}`,
`- Psychological profile: ${context.interactionMemory.psychologicalProfile}`,
`- Inferred traits: ${context.interactionMemory.inferredTraits.length > 0 ? context.interactionMemory.inferredTraits.join(", ") : "(none yet)"}`,
`- Response guidance: ${context.interactionMemory.responseGuidance}`,
`- Direct remembered interactions: ${context.interactionMemory.directInteractionCount}`,
`- Ambient remembered mentions: ${context.interactionMemory.ambientMentionCount}`,
"- Specific remembered incidents:",