AI Chat Agents
Overview
AI chat agents allows you to make AI chat in Tana much more powerful, by letting you customize look and feel, “personality”, how conversations start, and what the user can do with chat content.
You can build your own agents (advanced use, requires knowledge of command nodes and AI commands), or install an agent built by someone else as a template.
Basics
If you want to build your own, AI chat agents has four aspects that can be tailored:
- Presentational: name, description, icon (when zoomed in), banner image
- “Personality”: AI model, temperature, system prompt
- Startup mode: What happens when the agent is invoked? A combination of
initial prompt
andchat greeting
leads to three different scenarios:- Only
chat greeting
: A message is displayed to the user, without sending anything to AI, and the chat waits for user input Chat greeting
andinitial prompt
: Greeting is displayed, but initial prompt is immediately run in the background, thus you will end up with two messages from the agent (the greeting, and the response to the prompt), and then we wait for input.- Only
initial prompt
: When opening chat the initial prompt is immediately run without any greeting message, the result of the query is shown, and then we wait for user input.
- Only
- Commands: Any commands added in the command field of an agent will show up at the bottom of the chat.
- The context of the commands is the node that the chat was run from (currently we don’t show the commands if the chat was launched from the AI chat page).
- That means that any node filter on the command will reference the context node of the chat, not the chat itself, and any commands will output into that node.
- However, you can include the contents of the chat in the prompt using ${sys:chat}, and the contents of the chat is automatically included if you run th Autofill command. See prompt expressions.
There are two ways to start a chat with an agent:
- In Cmd/Ctrl+K menu: Commands you create in nodes (outside configuration panels) are automatically added to the command line (type
Name of your command
)- As all commands, this will also respecting the node filter that defines when the command should appear (read more in XXX.
- As a button on selected nodes: The command can then be added to appear as a button on e.g. nodes with a supertag, allowing you to start a chat with this agent directly from the node.
- Open tag config.
Detail
How to build AI chat agents
You can now create your own AI chat agent, that you can work with in AI chat.
To create an agent:
- Create a new node with the name of your command to start a chat with the agent (e.g. "Chat with Manager coach")
- Create a command node (
Ctrl/Cmd+K
>Convert to command node)
- Type @ and select the Start AI chat command node
- Click Add configuration
- Type > and type "Agent", select the Agent parameter that appears
6. Type the name of the agent into the field (you can also create agents outside the command by doing do Ctrl/Cmd+K
>Convert to agent
on a node, and paste a reference in here)
7. You'll now see a new command node, that let's you fill in parameters to tailor your agent. For more details on how to use parameters, see AI commands.
- The
System prompt
will be the basis for how the agent will respond, it should contain the main prompt that defines the personality of the agent. It can be short or long. - Prompts can refer to specific parts of the content by using prompt expressions.
Chat greeting
is how the agent will respond when you start a chat with it- Initial prompt
Model to use
lets you select which AI model to use.
Now you can start a chat with your new agent by doing Ctrl/Cmd+K
>Chat with (agent name)
, and a new AI chat with the agent will open.
Show agent commands as buttons
If you want an AI chat agent to appear as a button on certain nodes, you can add it in the Compact or Full menu:
- Open the configuration panel for the supertag you want to add the button to
- Go to the "AI and Commmands" section
- Do
Ctrl/Cmd+C
with your cursor on the agent command - Do
Ctrl/Cmd+V
into the Compact or Full menu fields- Compact menu will make the button appear on tagged items both collapsed and expanded/zoomed.
- Full menu will make the button appear only when you expand or zoom into nodes.
If you want to see what others are building or get help, join our community on Slack, with a dedicated #ai-for-builders channel 🛠️
Related release notes
- ImprovedUsers will get a message now when the event system gets disabled with more details and it will tell them they will have to refresh ()
- InfoWe have renamed the command node "Ask AI" to "Ask AI (non-streaming)", and the "Generic AI Query" to "Ask AI", to make the difference more clear. Mostly you should be using "Ask AI", since it's streaming. It has fewer parameters than "Ask AI (non-streaming)" but most of those are not useful anymore (let us know if there are any that are important to you). (Nothing will change with the commands you've already configured, or what happens when you hit Cmd+K Ask AI. ) ()
- ImprovedAsk AI command (streaming) now supports the prompt workbench ()
- ImprovedWe added a new parameter to Ask AI command nodes, to request output to be opened in new panel. (See Draft Panel) ()
- FixedMade sure that prompt workbench uses the same default AI model as the AI command nodes ()
- FixedWe fixed a bug when running command nodes in parallel ()
- ImprovedNew prompt expressions for source (like raw transcript of voice memo): ${sys:source} for the source, and ${sys:sourceOrContent} will insert the source, or content (node children) if there is no source node. ()