Skip to content

Commit f74bab6

Browse files
committed
fix: QA prompt — list scan, anti-paraphrase, temporal, sign inversion
1 parent 677afc1 commit f74bab6

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

vektori/qa/generator.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,29 @@ async def generate(self, prompt: str, max_tokens: int | None = None) -> str:
2727
1. Use only the provided context. Logical inference and reasoning from context facts is expected and correct — this is NOT guessing. Do not introduce facts that have no support in any context item.
2828
2. First, silently find every fact, episode, synthesis, or transcript line that directly relates to the question. Do not print this evidence list.
2929
3. For counting, frequency, list, "all", "total", or aggregation questions:
30-
- Consider every relevant item across all sessions, not just the first match.
30+
- Scan EVERY fact AND every episode in the context before writing anything — items may appear in either section. Count how many distinct items you find. If fewer than 3, explicitly check the Episodes section before answering.
3131
- Deduplicate only if the context clearly describes the same item more than once.
3232
- Return the complete set or total.
33-
- For questions asking about "recently", "lately", or "the latest" — return only the single most recent match, not a full list.
33+
- Exception: "recently", "lately", or "the latest" questions — return only the single most recent match, not a full list.
3434
4. For date, time, order, recency, or "when" questions:
3535
- Use exact absolute dates from the context whenever available.
3636
- Do not answer with relative time words like "recently" or "lately" when an absolute date is available.
3737
- If the context includes a temporal note, use it to resolve relative wording into an absolute date.
3838
5. For changed or updated information:
3939
- Prefer the most recent value when later context overrides earlier context.
4040
- Mention older values only if the question asks for history or change over time.
41-
6. Copy critical names, dates, places, titles, quantities, and field names exactly from the context. Do not blur them into a generic paraphrase.
41+
6. Copy critical names, dates, places, titles, quantities, and field names exactly from the context. Do not blur them into a generic paraphrase:
42+
- "mental health" is not "well-being" or "self-care"
43+
- "gold chain" is not "necklace"
44+
- "peaceful" is not "relaxing"
45+
- "dog playdate" is not "socialization"
46+
If the context uses a specific word, reproduce it verbatim.
4247
7. If the context contains any relevant evidence, commit to the most supported answer — even if it requires reasoning. Reserve "I don't have that information" strictly for when the context has zero relevant facts about the subject. Committing to a reasoned answer is preferred over abstaining.
4348
8. For answers expressed as "N days/weeks/months before/after DATE": use the temporal note in the context to compute the actual calendar date and give it as an absolute date (e.g. "18 May 2023"). Do not echo the anchor date as the answer.
49+
- When context marks an event as "recently": it happened BEFORE the session date, not on it. Use the temporal note's prior-range to give the most specific timeframe the context supports.
50+
- When context gives a start date and a completion event, compute and state the elapsed duration (e.g. "nearly two months") rather than listing both dates separately.
4451
9. If the context contains facts about multiple named people, only use facts where the subject explicitly matches the person the question asks about. Before giving your answer, verify: does the fact literally name the person the question is asking about? If a fact says "James did X" and the question asks what John did — that fact is not usable as an answer about John. Do not infer attribution. Facts labeled "User" or "Assistant" refer to the primary conversation participant — if other facts establish that person's name (e.g. "User's name is Caroline"), treat "User" facts as belonging to that person.
52+
Also: if the context says a person MISSED or DID NOT attend an event — that is NOT attendance. Never flip the sign of a negative fact.
4553
4654
ANSWER:
4755
"""

0 commit comments

Comments
 (0)