Gems can be arranged in your gem frame to modify many statistics
and weapon/item behaviors in the game. You're limited by the
available space in your gem frame (which expands through various
quests in the game), and the orientation of that space within the
frame (i.e. if you have 2 empty spaces you may be able to put in a
2x1 gem but not a 1x2 gem, depending on the arrangement of the
current gems in the frame).

Some gems are found or purchased throughout the game (or won as
quest rewards), while others must be fused from other gems. Some
gems can be created with more than one formula, and when known this
should be indicated in the tables below. Costs listed may be the
cost of fusion or the cost to purchase from the vendor, depending
on availability.

The number of gems you can carry (besides those in your gem
frame) is determined by the type of knapsack you have, and is the
same as the number of any other type of item you can carry (8 to
24). Therefore, if you have the basic knapsack you start the game
with, you can carry 8 of each type of gem (individual gem types,
not just 8 within each color of gem).