---
id: 7252
title: Add Ticket Archive to Knowledge Base
state: CLOSED
labels:
  - enhancement
assignees:
  - tobiu
createdAt: '2025-09-24T11:46:31Z'
updatedAt: '2025-09-24T12:59:34Z'
githubUrl: 'https://github.com/neomjs/neo/issues/7252'
author: tobiu
commentsCount: 0
parentIssue: null
subIssues: []
subIssuesCompleted: 0
subIssuesTotal: 0
blockedBy: []
blocking: []
closedAt: '2025-09-24T12:59:34Z'
---
# Add Ticket Archive to Knowledge Base

To make the context of all past work searchable, the archived tickets will be integrated into the AI Knowledge Base. This will allow developers and agents to query for the history and rationale behind previous changes.

## Scope of Work

1.  **Enhance `createKnowledgeBase.mjs`:**
    -   The script will be modified to glob for and process all markdown files within the `.github/ISSUE_ARCHIVE/` directory and its sub-directories.
    -   These files will be chunked and assigned a new content `type` of `ticket`.

2.  **Enhance `queryKnowledgeBase.mjs`:**
    -   The `--type` command-line option will be updated to accept `ticket` as a new valid value.
    -   Type-based filtering is now handled directly within the database query using a `where` clause, replacing the previous, less efficient post-query filtering in JavaScript.
    -   The scoring algorithm has been adjusted to apply a penalty to `ticket` type results in general queries (`--type all`) to reduce noise, ensuring they are discoverable only when explicitly queried via `--type ticket`.

## Timeline

- 2025-09-24T11:46:31Z @tobiu assigned to @tobiu
- 2025-09-24T11:46:33Z @tobiu added the `enhancement` label
- 2025-09-24T12:59:21Z @tobiu referenced in commit `fd4f711` - "Add Ticket Archive to Knowledge Base #7252"
- 2025-09-24T12:59:35Z @tobiu closed this issue

