Spike: Integrate with Duo

Summary

There's a possibility to use GitLab Query Language (GLQL) with GitLab Duo to give quick and easy access to any resource or list of resources through Duo Chat or other Duo interfaces. Providing a GLQL "agent" would allow Duo to perform search and filtering on GitLab data, with all the usual checks and balances (security, performance, etc) included by default.

This issue is to investigate feasibility and approaches to making this work.

Possible Approaches

Prompt Injection

GLQL is a simple language and resembles other query languages. The entire schema could be injected with the prompt and still leave sufficient room in the context window for further context and instruction.

Embeddings

If injecting the schema is too costly on tokens, another option is to index the schema and pass specific parts alongside the general instruction on how to construct a query. This would especially help when passing additional context. For example, a user could have access to 1000+ labels.

Use cases

The query needn't ever be exposed to the user. Duo can use it to access and take further action on data within GitLab.

For example, the instruction:

  • Write a report summarizing the issues closed in the last 2 weeks in the "Roadmap Improvements MVC" epic.

Would be executed like this:

graph LR
    A[Duo Chat] --> |Instruction| B[GLQL Agent]
    B --> |GLQL query|B1[GLQL]
    B1 --> |Target system query| C[Executor]
    C --> |Issue Data| B
    B --> |Instruction + Data| S[Summarizing Agent]
    S --> E[Duo Chat]
Edited by John Hope