Add a new API endpoint for the Codebase Search query
Context
In Add the Codebase Search Tool to Agentic Chat - ... (gitlab-org/modelops/applied-ml/code-suggestions/ai-assist#1287 - moved), we will add a Codebase Search Tool in Agentic Chat. This tool will need to query the codebase embeddings, which is accessible through Rails.
In this issue, we will expose a Codebase Semantic Search API in Rails. This should make use of the same ActiveContext query class currently used by Classic Chat's Codebase Search Tool executor.
References
Proposal
- In
Ai::ActiveContext::Queries::Code, makeKNN_COUNTandSEARCH_RESULTS_LIMITa configurable parameter. - Add a new GraphQL API to expose the codebase query.
- This should have the following parameters:
usersearch_term-
[{ project_ids, path (optional) }](array) -
knn- for theKNN_COUNT -
limit- for theSEARCH_RESULTS_LIMIT
- This should return an array of search results by the given
project_id|pathcombination
- This should have the following parameters:
Edited by 🤖 GitLab Bot 🤖