I’m working with an AIP Agent that gets triggered when I select an issue and click a button. Currently, the agent starts as expected, but I’d like to pass the issue details—like Issue ID, Issue Name, and other relevant fields—automatically without requiring any user prompts.
Is there a way to bind these variables directly when triggering the agent so that the system prompt receives this data seamlessly? Any guidance on how to configure this in Palantir AIP would be really helpful.
I’ve attached a screenshot showing how the current flow works for better context.
Without knowing your exact use case, here’s a few ideas:
If you want to use the chat interface, you can set these variables as input variables for your agent, and then derive these variables in Workshop from your selected object.
E.g. you’d have a string-variable called “Selected Issue Name” that takes the Issue ID property from the object you’ve selected in the Workshop.
You can then use these input variables to give your agent the relevant context.
If you want some prompt to run automatically whenever you select an object, without the user doing anything else than click the button, you might need to use AIP Logic instead.
The logic function outputs can back Workshop variables, and the function can be set to run automatically when the input variables change. These variables can then be used in various widgets (Metrics, Markdown, etc.).
Someone might have a better answer than me - in a quick poke around I agree that I don’t see a way to do this. (NVM see the answer above)
If you just want to give a suggested prompt that the user can optionally copy/paste or use as a starting point, here’s what I might do:
Consider is creating a new variable transform-backed string variable and creating a “default prompt suggestion” by using the concatenation transform to “template” a default prompt. If you concatenate three backticks at the start and end like this to format the whole thing as a code block and then put it in a Markdown widget just above or below the Agent widget, you can make it really easy for the user to copy/paste that default suggestion.
I created an AIP Logic with variables, and the output looks good. However, how can I modify the logic to automatically populate the AIP agent without requiring any user interaction, except for clicking a button?
If you want to use the AIP Agent, @lrhyne 's proposal works.
If you want it in a more automated fashion, you can add a text/markdown widget to Workshop, which takes the output of your AIP Logic function. This can be set up to run every time the user selects a new object or every time they select an object and clicks a button.
A middle ground would be to have your agent take the selected object and it’s relevant properties as input parameters. This still requires the user to interact with the prompt, but will ensure that the conversation is centered around the selected object.
You could also layer this: The automated AIP logic function runs first, and if the user wants to know more they can interact with the agent.
If you want to pass the context automatically into the Agent, which is what @jakehop is referring to, you can add Application state configuration to your Agent and then populate those with Workshop variables when configuring the agent in your app.