Frontmatter
| id | 7474 |
| title | Improve AI Query Scoring to Boost Content Matches |
| state | Closed |
| labels | enhancementhelp wantedgood first issuehacktoberfestai |
| assignees | tobiu |
| createdAt | Oct 13, 2025, 11:20 AM |
| updatedAt | Nov 2, 2025, 10:29 AM |
| githubUrl | https://github.com/neomjs/neo/issues/7474 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 7296 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Nov 2, 2025, 10:29 AM |
Improve AI Query Scoring to Boost Content Matches
tobiu assigned to @tobiu on Oct 13, 2025, 11:20 AM
tobiu added parent issue #7296 on Oct 13, 2025, 11:20 AM

tobiu
Oct 13, 2025, 11:22 AM
I am reserving this ticket for @SarthakBorude for 7 days.
tobiu cross-referenced by #7467 on Oct 13, 2025, 11:34 AM
tobiu closed this issue on Nov 2, 2025, 10:29 AM
The AI query system (
queryKnowledgeBase.mjs) currently uses a hybrid approach of semantic vector search followed by a keyword-based scoring boost. However, the keyword boosting logic has a significant flaw: it only checks for keywords in a chunk's metadata (e.g., filename, title, path) and completely ignores the chunk's actualcontent.This leads to counter-intuitive results. For example, a query for the word "Tron" correctly identifies the blog post
ai-native-platform-answers-questions.md(which contains the word in its content) through semantic search. However, it ranks it lower than other articles that are semantically related but do not contain the word at all. This is because those other articles get higher initial semantic scores, and the target article gets no keyword boost to compensate, as the current logic doesn't reward it for having a literal match in its content.This ticket is to fix the scoring algorithm to give a significant boost to any chunk where the search term is found directly in the content.
Acceptance Criteria
queryKnowledgeBase.mjsscript must be modified.queryWords.forEach), a new condition must be added.keywordSingularexists within the chunk'scontent(e.g.,metadata.content.toLowerCase().includes(keywordSingular)).score += 100) should be applied. This boost should be high enough to ensure a literal content match is prioritized over a purely semantic one.npm run ai:query -- -q "Tron" -t blogmust rank/Users/Shared/github/neomjs/neo/learn/blog/ai-native-platform-answers-questions.mdas the top result.