Ask AI

Ask AI is the command which powers all other text-related AI features in Tana; AI fields, command line AI, and custom commands.

Ask AI will be familiar to anyone who has played around in other GPT-powered tools - you prompt the AI and it generates a response.

In Tana, however, the AI can be targeted to specific information using your fields and tags, letting you create incredibly precise AI tools and workflows.

Going into the configuration for the Ask AI command, you'll find a range of parameters to tinker with.

Note that only some of these configure your commands actions inside Tana; most of them are configurations directly to and from the OpenAI API. To read about these; go to the OpenAI API.

Ask AI (with its parameters)
CommandParameters
Ask AI
Prompt
Node filter
Node context
Field dependencies
Target node
Temperature
Top P
Suffix
Best of
Max tokens
Model to use
Stop sequences
Presence penalty
Frequency penalty
Insert output strategy
Combination prompt
Batch prompt context
Fill context window percentage

By default, Ask AI accesses GPT 3-5 (Turbo), but you can customise Ask AI to run on other models (such as GPT 4, if you have access through your API key).

On Tana Paste

Tana Paste:

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

Here are some other useful tricks:

  • “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 expressions. For more on Tana Paste, read here:

  • Tana Paste

    Tana Paste is a way of generating rich Tana structures like fields, tags, dates, checkboxes etc, through a simple plain text paste. It is a bit slow, and not designed for inputting large amounts of information. In the future, Tana will offer proper plugin support. See video intro: https://www.loom.com/share/6fd81ff1ab364acf9f448ffdedfeb57f.

    A Tana Paste is a plain text paste that begins with the string '%%tana%%'. The easiest way to put this on the clipboard on a Mac is to cat a text file or run a command and pipe to pbcopy, for example `node github.mjs myrepo | pbcopy`. With your cursor on the block where you want the contents inserted, simply paste, and it will be transformed into Tana data structures and inserted. Any output from external AIs or APIs are also automatically parsed by Tana Paste, and do not require '%%tana%%'.

    The syntax is loosely modeled on Markdown. Nodes are prepended by '- ', and indentation indicates children.

    Links use [[]]. This will look for a node in the Library of the current workspace matching that name. If none exists, a new node will be created and linked to. Multiple links with the same string will always point at the same node. You can also specify a node target using [[link name^uid]]. If the uid does not exist, it will fall back to using the link name. If you only supply a uid, and it does not exist, it will create a link to "undefined", which you can later rename. (Note that we do not support more than one inline reference to a given node from a given node). If you also specify the tag of the link, like so: [[John Anderson #person]], it will find a node named John Anderson and tagged #person anywhere in your graph, and link to that, or create a new node in the library with the provided tag.

    Fields use :: between the field name and the value. Fields will look up by string, but if they are nested underneath a supertag which has any fields with that name, will prefer the field from the supertag definition. Like for links, you can specify a specific field using uid, like URL^uid:: value, which will also fall back to the string value, or an undefined field if no string name has been provided. If the field has a type of option or instance, and the provided value matches perfectly with an existing option or instance, the existing option or instance will be linked even if the text in the Tana paste is not a link.

    Tags use #, and multi-word tag names can optionally be wrapped in [[]], so either #bug or #[[my ideas]]. If no tag exists, a new one will be created. If you want to specify a specific tag, use ^ (#bug^uid). It will fall back to the string name, and if no string is provided and the uid doesn't match, the tag will not be created.

    Fields with multiple values can be specified through a field name:: and then the values nested indented underneath

    Images use the syntax ![](https://image.url)

    Simple dates look like this: [[date:2021-02]]. They can also include time [[date:2021-02-01 20:30]], or only include the week [[date:2021-W02]], month [[date:2021-02]] or year [[date:2021]], or even include a duration [[date:2021-02/2021-04-05]]. We also still support the old format [[August 22nd, 2020]].

    Formatting: **bold** ^^highlighted^^ __italic__

    Checkboxes use [ ] and [x] at the beginning of a node to indicate checked or unchecked. For fields/nodes which already have a checkbox, providing the [ ] will not change anything, but for other nodes/fields it will insert a checkbox. In all cases, [x] will correctly set the checkbox as checked.

    You can find examples of scripts that output text in the Tana Paste format here https://github.com/tanainc/tana-paste-examples

    Add %%search%% to a node to make it a search node (search expression indented under)

    • In a search expression, we recognize system nodes (Set/Not set) and attributes (LINKS TO) etc.

    You can also set the view of a node, using %%view:table%% %%view:cards%%, %%view:tabs%%, or %%view:calendar%%.

    You can link to a tag using [[#tag]] (especially useful in search nodes)

    Tana Paste supports Markdown tables and code blocks.

Next up