Skip to content

fix: include user question in chunk extraction prompts - #1171

Open
AmeyaBadve wants to merge 2 commits into
ScrapeGraphAI:mainfrom
AmeyaBadve:fix/missing-question-in-chunk-prompts
Open

AmeyaBadve wants to merge 2 commits into
ScrapeGraphAI:mainfrom
AmeyaBadve:fix/missing-question-in-chunk-prompts

Conversation

@AmeyaBadve

@AmeyaBadve AmeyaBadve commented Oct 14, 2026 •

Copy link
Copy Markdown

Problem

The Markdown and HTML chunk extraction prompts omit the user's question, even though the standard GenerateAnswerNode passes it as an input variable.

Consequently, the LLM processes webpage content without knowing what information the user requested, potentially returning incorrect or irrelevant results.

The K-level answer node also uses these shared templates but previously passed the user prompt through format_instructions rather than question. Adding {question} to the templates therefore requires updating the K-level node as well.

Fix

  • Include USER QUESTION: {question} in both Markdown and HTML chunk extraction templates.
  • Update GenerateAnswerNodeKLevel to pass the user prompt through question.
  • Supply the actual JSON formatting instructions through format_instructions in the K-level node.
  • Add regression tests covering both templates and K-level chunk processing.

Testing

  • All three regression tests pass locally (3 passed).
  • Verified successful extraction using Ollama with Qwen3:8B.
  • Confirmed that the K-level chunk prompt receives both the user question and JSON formatting instructions.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant