fix: improve source_indices instruction in deriver prompt

- Clarify that source_indices can point at any speaker's messages,
  not just the user's — what matters is which messages contain the evidence
- Add two examples: assistant-sourced attribution and multi-message
  attribution showing question + recommendation + confirmation
- Addresses issue where deriver cited wrong messages for conclusions
  derived from assistant responses
This commit is contained in:
Ubuntu 2026-07-23 16:30:29 +00:00 committed by Matt Landers
parent 11b3603ab1
commit b53c68a078
1 changed files with 3 additions and 1 deletions

View File

@ -81,13 +81,15 @@ RULES:
- Observations should make sense on their own. Each observation will be used in the future to better understand {peer_id}.
- Extract ALL observations from {peer_id} messages, using others as context.
- Contextualize each observation sufficiently (e.g. "Ann is nervous about the job interview at the pharmacy" not just "Ann is nervous")
- Each message in the <messages> block is prefixed with a 0-based index like [0], [1], [2]. For each observation, set source_indices to the indices of the messages that directly support it. Include the message containing any context needed to interpret the conclusion (e.g., the question being answered by "the first one"). Only include messages that directly support the observation not the entire conversation.
- source_indices: Each message in the <messages> block is prefixed with a 0-based index like [0], [1], [2]. For each observation, set source_indices to the indices of the messages that directly support it. Source messages can be from ANY speaker the user, an assistant, or another participant. What matters is which messages contain the evidence for the conclusion, not who said them. For example, if the assistant proposes a plan and the user confirms it, both messages are source material. Include the message containing any context needed to interpret the conclusion (e.g., the question being answered by "the first one"). Only include messages that directly support the observation not the entire conversation.
EXAMPLES (using `{peer_id}` as the target peer id):
- EXPLICIT: "I just had my 25th birthday last Saturday" "{peer_id} is 25 years old", "{peer_id}'s birthday is June 21st"
- EXPLICIT: "I took my dog for a walk in NYC" "{peer_id} has a dog", "{peer_id} lives in NYC"
- EXPLICIT: "I went to college and then started working at the pharmacy" "{peer_id} attended college", "{peer_id} works at the pharmacy"
- EXPLICIT: "{peer_id} attended college" + general knowledge "{peer_id} completed high school or equivalent"
- EXPLICIT (assistant-sourced): Assistant says "Let's set up a Flask project with SQLite" and {peer_id} replies "Sounds good, let's do that" "{peer_id} is building a project with Flask and SQLite", source_indices: [1, 2] (the assistant's proposal and the user's confirmation both support this)
- EXPLICIT (multi-message): {peer_id} asks "Should I use Postgres or SQLite?" and assistant says "SQLite is simpler for a project like yours" and {peer_id} says "OK, SQLite it is" "{peer_id} chose SQLite for their project", source_indices: [0, 1, 2] (the question provides context, the recommendation explains the reasoning, and the confirmation establishes the decision)
{custom_instructions_section}