You cannot normally have a chat with Coda AI inside your workflows. When you set a column in a table to use Coda AI, you can provide a formula that provides the prompt, but it does not remember any of the previous prompts or responses - so it has no context to help it understand the current prompt better.
When you click the AI Refresh button or execute the RefreshAssistant()
formula, the AI has no ‘memory’ of the previous exchanges - and so loses all that context.
But is is possible to give that context to the AI engine. The convention used by LLMs is to provide the previous prompt/response pairs in the current prompt. You label the queries with “USER:” and the responses with “BOT:” and the LLM understands this to be a complete conversation to be used to provide the context for the query.
In the example above, you will notice that each question assumes the AI remembers all the previous exchanges. So references to “this”, “there”, “that monastery”, are understood. When it is asked “And the ecomony?” it understands from the context that it is the economy of Greece that is being refered-to.
To achieve this, there is a hidden column called Prompt
that is the actual prompt given to Coda AI for each row. That column has a formula that gathers all the previous exchanges and labels tham with “USER:” and “BOT:” and this ‘reminds’ the LLM of the conversation that is to be used to provide context for the questions.
This results in this Prompt
for the last question from the example above;
The AI settings for the Response
column is set as follows. By setting the length to a single sentence, a better conversation ensues. Longer responses would contain many repetitions of previously provided information.
Note how the queries are short, simple and direct, but the responses are germaine and to-the-point.
The button simply does RefreshAssistant(Response)
and adds a row if its the last row of the table.
This approach provides Coda users with a form of AI interaction they will be very familiar with from ChatGPT and other chat-based AI platforms.
Max