agAST is an in-memory storage format for CSTML trees. You can think of agAST as being the "Document Object Model" for CSTML.
Any CSTML stream can be stored in an agAST tree and then re-emitted without changing its meaning. The re-emitted stream may not be identical to its source stream, though. The agast-helpers library provides the utilites you will need to handle trees fluently, such as treeFrom(stream) and streamFrom(tree).
Each node in an agAST tree is a javascript array. It has, at least, a node[0] the value of which is a string that can be parsed as a CSTML open tag, gap tag, or null tag.
It's worth nothing that we often use the terms "node" and "tree" interchangeably. Here is our first simple tree then: