Frontmatter
| id | 7473 |
| title | REFACTOR: Assign `type: ''blog''` directly in `createKnowledgeBase.mjs` |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Oct 13, 2025, 10:46 AM |
| updatedAt | Oct 13, 2025, 12:02 PM |
| githubUrl | https://github.com/neomjs/neo/issues/7473 |
| author | tobiu |
| commentsCount | 2 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Oct 13, 2025, 12:02 PM |
REFACTOR: Assign type: 'blog' directly in createKnowledgeBase.mjs
tobiu assigned to @tobiu on Oct 13, 2025, 10:46 AM

tobiu
Oct 13, 2025, 12:02 PM
this one is already resolved via: https://github.com/neomjs/neo/commit/82617a3a208c3902ae64251e090a552f840b8ddf, as mentioned inside the PR comment.
tobiu closed this issue on Oct 13, 2025, 12:02 PM
This ticket is a follow-up to PR #7472, which fixed a bug where blog posts were not being found by the AI query system. The PR implemented a workaround on the query-side (
queryKnowledgeBase.mjs) to correctly find blog posts.This ticket will address the root cause of the issue by refactoring the data creation script (
buildScripts/ai/createKnowledgeBase.mjs) to assign the correcttypeto blog posts during the initial indexing process.Problem
Currently,
createKnowledgeBase.mjsprocesses all markdown files fromlearn/tree.jsonand assigns themtype: 'guide'. To differentiate blog posts, it adds a flagisBlog: true. This forces the query logic to contain a special condition to translate a search fortype: 'blog'into a search for{type: 'guide', isBlog: 'true'}.This approach is not ideal because:
Proposed Solution
The solution is to modify the data creation script to assign the correct type at the source.
In
buildScripts/ai/createKnowledgeBase.mjs:learnTreedata.parentIdis'Blog'.typeof the generated chunk to'blog'.isBlogproperty from the chunk.In
buildScripts/ai/queryKnowledgeBase.mjs:if (type === 'blog')condition that was added in PR #7472.whereClause = {type: type}will now work correctly for blog posts as well.Acceptance Criteria
createKnowledgeBase.mjsis updated to generate chunks withtype: 'blog'for all blog posts.isBlogproperty is no longer present in the generated knowledge base chunks.queryKnowledgeBase.mjsis simplified, and the workaround for blog queries is removed.npm run ai:query -- -q "<search-term>" -t blogsuccessfully returns results from blog posts.