Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Doc-search answers are ungrounded when KB index is empty / sparse — model hallucinates plausibly wrong facts

Open
#211 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
wordpress
Domain
ai, frontend, search

Research direction

Start at the doc-search no-hits prompt and the book-button knowledge-base state described in the issue; inspect how empty indexes and no-hit results reach the model and UI. Done means the chosen fix prevents confident unsupported answers and, if implemented, gives users a clear indexing or fallback signal; verify the supplied empty or sparse-KB reproduction.

Written by the indexing model from the issue text.

Description

Context

After landing #209 Fix 1 (PR #210), the doc-search path correctly bypasses tool selection. But on an empty / unindexed knowledge base, the model answers from training data alone and confidently fabricates specifics.

Repro

  1. Book button on
  2. Knowledge base not indexed (or query has no hits)
  3. Ask: "Whats the hook that allows me to inject content in the footer?"
  4. Model answers: "The hook that allows you to inject content in the footer is `footer_init`…"

`footer_init` is not a real WordPress hook. The correct answer is `wp_footer`.

Root cause

  • Default model is Qwen 3 1.7B — knowledge gaps on specifics.
  • Doc-search path's no-hits system prompt currently says "answer from general WordPress knowledge and tell them no local docs were found." That permits free-form answering, doesn't strongly enforce "say you're unsure when uncertain."
  • No factual grounding mechanism when the KB is empty.

Proposed fixes (any subset)

  • Tighter prompt when no hits. Push the model to "only answer if you are confident; otherwise, ask the user to index docs or rephrase."
  • Surface KB state in the UI. If the KB index is empty when the user toggles the book button, show a one-time warning: "Knowledge base is empty — answers will fall back to general model knowledge."
  • Encourage indexing in onboarding. Currently you have to opt in to KB indexing manually; with the book button being prominent, a first-run nudge to index would close the loop.
  • Citations. When RAG context is used, include `path:lines` citations in the answer so users can verify (and the model is forced to ground statements in context).

Out of scope

  • Improving model accuracy on small Qwen — that's an external-provider migration concern, separate from this UX gap.

Related

  • #209 (umbrella — tool selection precision); this is a downstream UX issue from the bypass Fix 1 introduced in #210.
Dominant language
JavaScript
Stars
28
Forks
6
Avg merge
9h 16m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pluginslab/wp-agentic-admin

All issues in pluginslab/wp-agentic-admin

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.