Adapt prompts to clarify all lists must contain strings. Hopefully fixes LLM producing wrong output

This commit is contained in:
Yiorgis Gozadinos 2025-12-12 07:40:25 +02:00
parent 00d621e211
commit 9ee8dfdc0c
No known key found for this signature in database
3 changed files with 28 additions and 26 deletions

View file

@ -10,13 +10,17 @@ Responsibilities:
Plan requirements: Plan requirements:
- Produce at most 3 sub_questions that together cover the main question. - Produce at most 3 sub_questions that together cover the main question.
- sub_questions must be a list of plain strings, where each string is a complete
question. Do NOT use objects with nested fields like {question, details}.
- Each sub_question must be a standalone, self-contained query that can run - Each sub_question must be a standalone, self-contained query that can run
without extra context. Include concrete entities, scope, timeframe, and any without extra context. Include concrete entities, scope, timeframe, and any
qualifiers. Avoid ambiguous pronouns (it/they/this/that). qualifiers. Avoid ambiguous pronouns (it/they/this/that).
- Prioritize the highest-value aspects first; avoid redundancy and overlap. - Prioritize the highest-value aspects first; avoid redundancy and overlap.
- Prefer questions that are likely answerable from the current knowledge base; - Prefer questions that are likely answerable from the current knowledge base;
if coverage is uncertain, make scopes narrower and specific. if coverage is uncertain, make scopes narrower and specific.
- Order sub_questions by execution priority (most valuable first).""" - Order sub_questions by execution priority (most valuable first).
Use the gather_context tool once on the main question before planning."""
SEARCH_AGENT_PROMPT = """You are a search and question-answering specialist. SEARCH_AGENT_PROMPT = """You are a search and question-answering specialist.
@ -46,8 +50,8 @@ Each result includes:
- Type: content type like paragraph, table, code, list_item (when available) - Type: content type like paragraph, table, code, list_item (when available)
- Content: the actual text - Content: the actual text
IMPORTANT: In cited_chunks, use the EXACT, COMPLETE chunk ID (the full UUID). IMPORTANT: cited_chunks must be a list of plain strings containing only the UUIDs.
Do NOT truncate or shorten chunk IDs. Use the EXACT, COMPLETE chunk ID. Do NOT use objects or truncate IDs.
Guidelines: Guidelines:
- Base answers strictly on retrieved content - do not use external knowledge. - Base answers strictly on retrieved content - do not use external knowledge.

View file

@ -10,7 +10,7 @@ Task:
Output format: Output format:
- answer: The complete answer to the original question (2-4 paragraphs) - answer: The complete answer to the original question (2-4 paragraphs)
- cited_chunks: List of chunk IDs (from sub-answers) that directly support your answer - cited_chunks: List of plain strings containing chunk IDs (UUIDs only, not objects)
Guidelines: Guidelines:
- Start directly with the answer - no preamble like "Based on the research..." - Start directly with the answer - no preamble like "Based on the research..."
@ -30,7 +30,7 @@ Task:
Output format: Output format:
- is_sufficient: Boolean indicating if we can answer the question comprehensively - is_sufficient: Boolean indicating if we can answer the question comprehensively
- reasoning: Clear explanation of your assessment - reasoning: Clear explanation of your assessment
- new_questions: List of specific follow-up questions needed (empty if sufficient) - new_questions: List of plain strings, each a specific follow-up question (not objects)
Guidelines: Guidelines:
- Be strict but reasonable in your assessment - Be strict but reasonable in your assessment

View file

@ -16,19 +16,20 @@ Tasks:
Output format (map directly to fields): Output format (map directly to fields):
- highlights: list of insights with fields {summary, status, supporting_sources, - highlights: list of insights with fields {summary, status, supporting_sources,
originating_questions, notes}. Use status one of {validated, open, tentative}. originating_questions, notes}. Use status one of {validated, open, tentative}.
supporting_sources and originating_questions must be lists of plain strings.
- gap_assessments: list of gaps with fields {description, severity, blocking, - gap_assessments: list of gaps with fields {description, severity, blocking,
resolved, resolved_by, supporting_sources, notes}. Severity must be one of resolved, resolved_by, supporting_sources, notes}. Severity must be one of
{low, medium, high}. resolved_by may reference related insight summaries if no {low, medium, high}. resolved_by and supporting_sources must be lists of plain strings.
stable identifier yet. - resolved_gaps: list of plain strings (identifiers or descriptions for gaps now closed).
- resolved_gaps: list of identifiers or descriptions for gaps now closed. - new_questions: list of plain strings, up to 3 standalone questions (no duplicates).
- new_questions: up to 3 standalone, specific sub-questions (no duplicates with
existing ones).
- commentary: 13 sentences summarizing what changed this round. - commentary: 13 sentences summarizing what changed this round.
All list fields must contain plain strings only, not objects.
Guidance: Guidance:
- Be concise and avoid repeating previously recorded information unless it - Be concise and avoid repeating previously recorded information unless it
changed materially. changed materially.
- Tie supporting_sources to the evidence used; omit if unavailable. - For supporting_sources, use only the document_uri strings from the sources.
- Only propose new sub_questions that directly address remaining gaps. - Only propose new sub_questions that directly address remaining gaps.
- When marking a gap as resolved, ensure the rationale is clear via - When marking a gap as resolved, ensure the rationale is clear via
resolved_by or notes.""" resolved_by or notes."""
@ -58,15 +59,15 @@ Strictness:
- Treat unresolved high-severity or blocking gaps as a hard stop. - Treat unresolved high-severity or blocking gaps as a hard stop.
Output fields must line up with EvaluationResult: Output fields must line up with EvaluationResult:
- key_insights: concise bullet-ready statements of the most decision-relevant - key_insights: list of plain strings, concise bullet-ready statements.
insights (cite status if helpful). - new_questions: list of plain strings, follow-up sub-questions (max 3).
- new_questions: follow-up sub-questions (max 3) meeting the specificity rules. - gaps: list of plain strings, remaining blockers (reuse wording from tracked gaps).
- gaps: list remaining blockers; reuse wording from the tracked gaps when
possible to aid downstream reconciliation.
- confidence_score: numeric in [0,1]. - confidence_score: numeric in [0,1].
- is_sufficient: true only when no blocking gaps remain. - is_sufficient: true only when no blocking gaps remain.
- reasoning: short narrative tying the decision to evidence coverage. - reasoning: short narrative tying the decision to evidence coverage.
All list fields must contain plain strings only, not objects.
Remember: prefer maintaining continuity with the structured context over Remember: prefer maintaining continuity with the structured context over
introducing new terminology.""" introducing new terminology."""
@ -82,16 +83,13 @@ Goals:
Report guidelines (map to output fields): Report guidelines (map to output fields):
- title: concise (512 words), informative. - title: concise (512 words), informative.
- executive_summary: 35 sentences summarizing the overall answer. - executive_summary: 35 sentences summarizing the overall answer.
- main_findings: 48 onesentence bullets; each reflects evidence from the - main_findings: list of plain strings, 48 onesentence bullets reflecting evidence.
research (do not include inline citations or snippet text). - conclusions: list of plain strings, 24 bullets following logically from findings.
- conclusions: 24 bullets that follow logically from findings. - recommendations: list of plain strings, 25 actionable bullets tied to findings.
- recommendations: 25 actionable bullets tied to findings. - limitations: list of plain strings, 13 bullets describing constraints or uncertainties.
- limitations: 13 bullets describing key constraints or uncertainties. - sources_summary: single string listing sources with document paths and page numbers.
- sources_summary: List specific sources used with document paths, page numbers,
and section headings where available. Format each as: All list fields must contain plain strings only, not objects.
"- /path/to/document.pdf (p. 5, Section: Introduction)" or
"- /path/to/file.md (Section: Getting Started)"
Include one bullet per distinct source document.
Style: Style:
- Base all content solely on the collected evidence. - Base all content solely on the collected evidence.