diff --git a/haiku_rag_slim/haiku/rag/graph/common/prompts.py b/haiku_rag_slim/haiku/rag/graph/common/prompts.py index 2f17ad7f..29eb922f 100644 --- a/haiku_rag_slim/haiku/rag/graph/common/prompts.py +++ b/haiku_rag_slim/haiku/rag/graph/common/prompts.py @@ -10,13 +10,17 @@ Responsibilities: Plan requirements: - 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 without extra context. Include concrete entities, scope, timeframe, and any qualifiers. Avoid ambiguous pronouns (it/they/this/that). - Prioritize the highest-value aspects first; avoid redundancy and overlap. - Prefer questions that are likely answerable from the current knowledge base; 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. @@ -46,8 +50,8 @@ Each result includes: - Type: content type like paragraph, table, code, list_item (when available) - Content: the actual text -IMPORTANT: In cited_chunks, use the EXACT, COMPLETE chunk ID (the full UUID). -Do NOT truncate or shorten chunk IDs. +IMPORTANT: cited_chunks must be a list of plain strings containing only the UUIDs. +Use the EXACT, COMPLETE chunk ID. Do NOT use objects or truncate IDs. Guidelines: - Base answers strictly on retrieved content - do not use external knowledge. diff --git a/haiku_rag_slim/haiku/rag/graph/deep_qa/prompts.py b/haiku_rag_slim/haiku/rag/graph/deep_qa/prompts.py index 56d4d4d9..3d638358 100644 --- a/haiku_rag_slim/haiku/rag/graph/deep_qa/prompts.py +++ b/haiku_rag_slim/haiku/rag/graph/deep_qa/prompts.py @@ -10,7 +10,7 @@ Task: Output format: - 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: - Start directly with the answer - no preamble like "Based on the research..." @@ -30,7 +30,7 @@ Task: Output format: - is_sufficient: Boolean indicating if we can answer the question comprehensively - 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: - Be strict but reasonable in your assessment diff --git a/haiku_rag_slim/haiku/rag/graph/research/prompts.py b/haiku_rag_slim/haiku/rag/graph/research/prompts.py index 540019ee..70dfbb22 100644 --- a/haiku_rag_slim/haiku/rag/graph/research/prompts.py +++ b/haiku_rag_slim/haiku/rag/graph/research/prompts.py @@ -16,19 +16,20 @@ Tasks: Output format (map directly to fields): - highlights: list of insights with fields {summary, status, supporting_sources, 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, resolved, resolved_by, supporting_sources, notes}. Severity must be one of - {low, medium, high}. resolved_by may reference related insight summaries if no - stable identifier yet. -- resolved_gaps: list of identifiers or descriptions for gaps now closed. -- new_questions: up to 3 standalone, specific sub-questions (no duplicates with - existing ones). + {low, medium, high}. resolved_by and supporting_sources must be lists of plain strings. +- resolved_gaps: list of plain strings (identifiers or descriptions for gaps now closed). +- new_questions: list of plain strings, up to 3 standalone questions (no duplicates). - commentary: 1–3 sentences summarizing what changed this round. +All list fields must contain plain strings only, not objects. + Guidance: - Be concise and avoid repeating previously recorded information unless it 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. - When marking a gap as resolved, ensure the rationale is clear via resolved_by or notes.""" @@ -58,15 +59,15 @@ Strictness: - Treat unresolved high-severity or blocking gaps as a hard stop. Output fields must line up with EvaluationResult: -- key_insights: concise bullet-ready statements of the most decision-relevant - insights (cite status if helpful). -- new_questions: follow-up sub-questions (max 3) meeting the specificity rules. -- gaps: list remaining blockers; reuse wording from the tracked gaps when - possible to aid downstream reconciliation. +- key_insights: list of plain strings, concise bullet-ready statements. +- new_questions: list of plain strings, follow-up sub-questions (max 3). +- gaps: list of plain strings, remaining blockers (reuse wording from tracked gaps). - confidence_score: numeric in [0,1]. - is_sufficient: true only when no blocking gaps remain. - 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 introducing new terminology.""" @@ -82,16 +83,13 @@ Goals: Report guidelines (map to output fields): - title: concise (5–12 words), informative. - executive_summary: 3–5 sentences summarizing the overall answer. -- main_findings: 4–8 one‑sentence bullets; each reflects evidence from the - research (do not include inline citations or snippet text). -- conclusions: 2–4 bullets that follow logically from findings. -- recommendations: 2–5 actionable bullets tied to findings. -- limitations: 1–3 bullets describing key constraints or uncertainties. -- sources_summary: List specific sources used with document paths, page numbers, - and section headings where available. Format each as: - "- /path/to/document.pdf (p. 5, Section: Introduction)" or - "- /path/to/file.md (Section: Getting Started)" - Include one bullet per distinct source document. +- main_findings: list of plain strings, 4–8 one‑sentence bullets reflecting evidence. +- conclusions: list of plain strings, 2–4 bullets following logically from findings. +- recommendations: list of plain strings, 2–5 actionable bullets tied to findings. +- limitations: list of plain strings, 1–3 bullets describing constraints or uncertainties. +- sources_summary: single string listing sources with document paths and page numbers. + +All list fields must contain plain strings only, not objects. Style: - Base all content solely on the collected evidence.