AI for builders is an advanced set of tools for those who want to build their own AI functionality in Tana. Note: This Tana Labs experiment feature was replaced by Tana AI in June 2024.
The Tana Labs feature AI for Builders was the first generation of AI functionality in Tana. It introduced a modular toolkit to build AI workflows and embed AI processing into Tana actions. This included things like command line actions, command nodes, the prompt workbench, Autofill, Autotag, generate image and much more.
With the introduction of Tana AI, AI for Builders will graduate from being an experimental project to being an integral feature in Tana, and will therefore cease to exist as a Tana Labs option moving forward.
AI work will be powered by Tana AI and not through OpenAI API keys brought by the user (BYOK), with the exception of one general purpose command called Ask AI commandthat will accept BYOK.
The advanced tools that were introduced under the AI for Builders feature will remain mostly the same. You do not need to fix or change anything once this change is in effect.
All AI functionality that previously worked with your own API key will now be powered by Tana AI. For more on how Tana AI works, see Tana AI.
Any functionality that was created as part of AI for builders will continue to exist until further notice. This page will be integrated into the main Tana AI page eventually.
Start a node with ai:, and add your prompt. You'll see an Ask AI button pop up. Press it, and this generates the AI response for you.
You can also do the same through the command line, either pre-writing your prompt in a node and running Ask AI, or taking an existing node with content and running Ask AI to → and type out your prompt in the command line.
The plug-and-play AI commands will let you:
📝 quickly query GPT, or 🎨 generate art with DALL-E, using your nodes as prompts.
🗃️ cluster/sort your nodes using AI.
🗣️ transcribe audio files into text.
There are seven standard commands that are accessible via the command line:
AI fields are super-powered fields: through GPT, they can be automatically filled in with useful data, based on what the AI can see of the field and its context.
Turn it on by going to Field configuration, and turn on ✨AI-enhanced field. An ✨AI button will appear next to the name of the field. To autofill the fields, click it.
By default, the AI looks at the node the field is attached to plus the node's children, other fields and description.
This is packaged into a prompt and sent to the AI, with the task Decide a value for the field: [field name]. The AI then does its best to answer.
For more advanced implementations of AI, we have created a highly modular set of building blocks which are covered below. It is a higher threshold of entry, but allows for customizations that are not possible anywhere else.
The Custom Prompt is the window where you feed your own prompt into the AI function you are configuring.
Prompt expressions in Tana are built like Title expressions, with some extra functionality:
To get the name of the node that you are targeting, use ${name}
To reference field values, use ${field label}.
To reference the entire node context with all fields and children in Tana Paste format, use ${sys:context}
To return a node's supertags, use ${sys:tags}
To show a node's children (excluding content inherited from supertag), use ${sys:content}
To insert the current date/date and time, use ${sys:currentDate} and ${sys:currentDateTime} respectively. Keep in mind that GPT doesn't know the current date or time natively.
To return the URL and ID of the node, use ${sys:nodeURL} and ${sys:nodeId} respectively.
All of the normal title expressions are also available.
To get the full context of a field's content, use the field definition.
To get the field definition, put your cursor on the name of a field, Cmd/Ctrl+C to copy, put your cursor inside the prompt and Cmd/Ctrl+V to paste a reference to the field definition
The video shows the difference between the title expression pointing to a field versus the field definition in terms of what gets sent in the prompt:
You can also use dynamic content in your prompts: use a reference to a node directly in your prompt (including search nodes), or create search nodes in the prompt.
All output from the AI is parsed with Tana Paste before being inserted into Tana. For smaller texts, this should make no difference for you, but it does offer the possibility of teaching the AI to generate rich Tana data structures.
For example, you can tell it to generate a list of cities, and tag each as city, with the population as a field. Providing examples are really helpful:
- Rio de Janeiro #city - Population:: 4M
Other useful tricks you can tell AI to do to output in a more Tana Paste friendly format:
“Output as Markdown table”
“Output as Markdown code block”
“Output as hierarchical Markdown, and use indentation instead of # for headers”
“use - [ ] for tasks”
You can even make it generate search nodes. For more on that, read up on Tana Paste.
The expanded prompt section shows what is being sent to the OpenAI API. To see what is being sent from and to Tana when you're using AI, use the GPT Log Monitor.
If you frequently get unsatisfying responses that start with "As a language model”, try turning the temperature up for your prompt. Increasing the model's creativity seems to often get it to loosen up a bit.
A rule of thumb:
If you are generating new content, use a high temperature.
If you are restructuring your existing data, use a low temperature.
Autotag is an AI Command that is designed to help users sort and organize their content. Autotag uses AI to analyze different items, recognize what they are, and apply the relevant tags.
Set up the command Autotag with parameter Tag candidates, list a few supertag candidates in the configuration, and now run this custom command on a list of nodes.
Once supertags have been assigned, you can use Autofill to fill in fields based on the contents of the name. For example, AI can provide suggestions to fill fields, such as deadline, topic, even follow-up task, based on what it finds. You can also set it to auto-generate a new title and description. You can also exclude fields from the action, and choose to run on GPT-4 for different results. All of this can be switched on in the Supertag configuration as AI-enhanced tag.
All interactions with the APIs require you to connect your own OpenAI API key. To get it, go to OpenAI's API Key page.
Once you have your API key at hand, 1️⃣ open the command line and run the "Set OpenAI API Key" command. Then 2️⃣ paste your key in the field and you're good to go.
❗️IMPORTANT: Since you are using your own API key, you will be responsible for your own Pricing.
When experimenting, it can be easy to use a lot of tokens (AI in Tana is a lot of fun 🤖). We strongly recommend setting Usage limits in your OpenAI API.
❗Note: if you are a trial user of OpenAI you are likely to be hit with rate limiting. Entering a payment method (credit card information) will improve this.
I already pay [insert AI provider] for access, can I use that to run AI in Tana?
May 07, 2025
No, this is not possible.
Tana AI uses a mix of AI providers, not just OpenAI, which is why our paid plans have AI credits included in them which can be used towards any AI model you use.
With a Tana paid subscription, you get AI credits that are part of the plan, along with the option to use the Ask AI and Ask AI (non-streaming) command nodes with your own OpenAI API key.
With other features like AI Chat, Meeting agent and most integrated AI tools in Tana, we will use the Tana AI credits because we have to fine-tune the models for these features to work as expected.
What do the AI error messages Out of budget and 0/1 left mean?
Sep 26, 2024
This writeup is from community member Theo Koster outlining a detailed walkthrough on how to set up your OpenAI account so you can use it with AI for Builders. It covers several errors like out of budget, 0/1 left, and rate limit for this api key has been hit. Here's Theo:
There is no new information in this post, just a handy list of actions that I needed to assemble from different posts. If you get error messages using AI functionality, here is how I solved these.
First: you've got to understand that Tana uses the OpenAI API. This is a different product than the OpenAI chatbot ChatGPT. So even if you have a paid account with the OpenAI ChatGPT, this is of no use to using the OpenAI API.
Second: you have a limited amount of free queries available with the OpenAI API. This is why you run into error messages after a week of using the AI facilities in Tana. So you've got to pay extra. If you don't want to do that, fine, but face the limits. The good news here is that you can limit your credit to ± $5 and you can limit your maximum spend per month. My burn rate on my first day on a paid plan was 32 cents.
How I got it all working:
Enable AI in Tana (settings -> Tana Labs -> AI for builders: check)
Get your API key at https://platform.openai.com/api-keys (fourth item in the left menu with the key lock-icon). You should copy your API-key immediately.
Go to Tana and past your fresh API key in settings -> API-tokens (hit the [Create] button)
Can I retrieve the prompt I used for an AI request?
Sep 26, 2024
Yes, use the open GPT log monitor via the command line. Once open, click on one of the jobs to open it. This shows you the raw inputs and output from OpenAI, including the prompt you used.