This ticket covers refactoring the final service for the knowledge-base server, ai/mcp/server/knowledge-base/services/queryService.mjs, into a singleton QueryService class. This service is responsible for performing semantic search against the knowledge base and includes complex logic for scoring and ranking results.
Acceptance Criteria
- The file
ai/mcp/server/knowledge-base/services/queryService.mjs is renamed to QueryService.mjs.
- The content is replaced with a
QueryService class that extends Neo.core.Base and is configured as a singleton.
- The existing
queryDocuments function is converted into a class method.
- The new class uses the
ChromaManager service to interact with the database.
- The complex scoring and ranking logic is fully preserved and functions identically to the original.
- The
ai/mcp/server/knowledge-base/services/toolService.mjs is updated to use the new QueryService class and its method.
- The
query_documents tool continues to function correctly.
This ticket covers refactoring the final service for the knowledge-base server,
ai/mcp/server/knowledge-base/services/queryService.mjs, into a singletonQueryServiceclass. This service is responsible for performing semantic search against the knowledge base and includes complex logic for scoring and ranking results.Acceptance Criteria
ai/mcp/server/knowledge-base/services/queryService.mjsis renamed toQueryService.mjs.QueryServiceclass that extendsNeo.core.Baseand is configured as a singleton.queryDocumentsfunction is converted into a class method.ChromaManagerservice to interact with the database.ai/mcp/server/knowledge-base/services/toolService.mjsis updated to use the newQueryServiceclass and its method.query_documentstool continues to function correctly.