Chemical equilibrium has proven extremely useful for predicting the chemical composition of AGB atmospheres. Here we use a recently developed code and an updated thermochemical database that includes gaseous and condensed species involving 34 elements to compute the chemical equilibrium composition of AGB atmospheres of M-, S-, and C-type stars. We include for the first time Ti x C y clusters, with x = 1-4 and y = 1-4, and selected larger clusters ranging up to Ti13C22, for which thermochemical data are obtained from quantum-chemical calculations. Our main aims are to systematically survey the main reservoirs of each element in AGB atmospheres, review the successes and failures of chemical equilibrium by comparing it with the latest observational data, identify potentially detectable molecules that have not yet been observed, and diagnose the most likely gas-phase precursors of dust and determine which clusters might act as building blocks of dust grains. We find that in general, chemical equilibrium reproduces the observed abundances of parent molecules in circumstellar envelopes of AGB stars well. There are, however, severe discrepancies of several orders of magnitude for some parent molecules that are observed to be anomalously overabundant with respect to the predictions of chemical equilibrium. These are HCN, CS, NH3, and SO2 in M-type stars, H2O and NH3 in S-type stars, and the hydrides H2O, NH3, SiH4, and PH3 in C-type stars. Several molecules have not yet been observed in AGB atmospheres but are predicted with non-negligible abundances and are good candidates for detection with observatories such as ALMA. The most interesting ones are SiC5, SiNH, SiCl, PS, HBO, and the metal-containing molecules MgS, CaS, CaOH, CaCl, CaF, ScO, ZrO, VO, FeS, CoH, and NiS. In agreement with previous studies, the first condensates predicted to appear in C-rich atmospheres are found to be carbon, TiC, and SiC, while Al2O3 is the first major condensate expected in O-rich outflows. According to our chemical equilibrium calculations, the gas-phase precursors of carbon dust are probably acetylene, atomic carbon, and/or C3, while for silicon carbide dust, the most likely precursors are the molecules SiC2 and Si2C. In the case of titanium carbide dust, atomic Ti is the major reservoir of this element in the inner regions of AGB atmospheres, and therefore it is probably the main supplier of titanium during the formation of TiC dust. However, chemical equilibrium predicts that large titanium-carbon clusters such as Ti8C12 and Ti13C22 become the major reservoirs of titanium at the expense of atomic Ti in the region where condensation of TiC is expected to occur. This suggests that the assembly of large Ti x C y clusters might be related to the formation of the first condensation nuclei of TiC. In the case of Al2O3 dust, chemical equilibrium indicates that atomic Al and the carriers of Al-O bonds AlOH, AlO, and Al2O are the most likely gas-phase precursors.