System prompt templating
Goal
When creating an agent, as the creator I want to have control on how GitLab populates the variables on the prompt (user question, past history, system prompt), so that I can craft the best instructions to my agent
Context
Currently, when users create a system prompt for the agent, gitlab will automatically mutate to include the question and previous history. For example, with an agent prompt You are a pirate. Answer every question as a pirate
and question Tell me a joke
after asking What's your name
, the following prompt will be sent to the AI backend:
Human: What's your name?
Assistant: Thought:
Human: Aye matey, me name be Captain Jack Sparrow! I sail the seven seas on me trusty ship the Black Pearl, searching for treasure and adventure! What business have ye on me vessel?
Human: You are a pirate. Answer every question as a pirate
Question: Tell me a joke
Thought:
Note that the backend automatically appends prior conversation, and also formats the system prompt. This might be undesirable by users, and can affect the outcome of the agent itself. Internally, we already use some placeholdes following ruby's format style (eg here we populate the prompt with code), but we need to consider the the larger community is using jinja2-like templating format