This ticket covers the implementation of the query_documents service for the AI Knowledge Base MCP server. This is the primary read operation for the server, allowing AI agents to perform semantic searches against the vector database.
The implementation will be adapted from the existing buildScripts/ai/queryKnowledgeBase.mjs script.
Acceptance Criteria
- A new
ai/mcp/server/knowledge-base/services/queryService.mjs file is created.
- The service contains a
queryDocuments function that takes a query string and an optional type filter.
- The function connects to ChromaDB, generates an embedding for the query, and retrieves the most relevant documents.
- The function applies the existing scoring algorithm to the results.
- The function returns a JSON object containing the ranked list of results, matching the
QueryResponse schema in openapi.yaml.
- The
toolService.mjs serviceMapping is updated to point the query_documents operationId to the new service function.
This ticket covers the implementation of the
query_documentsservice for the AI Knowledge Base MCP server. This is the primary read operation for the server, allowing AI agents to perform semantic searches against the vector database.The implementation will be adapted from the existing
buildScripts/ai/queryKnowledgeBase.mjsscript.Acceptance Criteria
ai/mcp/server/knowledge-base/services/queryService.mjsfile is created.queryDocumentsfunction that takes aquerystring and an optionaltypefilter.QueryResponseschema inopenapi.yaml.toolService.mjsserviceMappingis updated to point thequery_documentsoperationId to the new service function.