Source: Out of the Abyss

Wondrous item, rarity varies (attunement optional)

A spell gem can contain one spell from any class's spell list. You become aware of the spell when you learn the gems properties. While holding the gem. you can cast the spell from it as an action if you know the spell or if the spell is on your class spell list. Doing so doesn‘t require any components and doesn't require attunement. The spell then disappears from the gem.

If the spell is of a higher level than you can normally cast. you must make an ability check using your spellcasting ability to determine whether you cast it successfully. The DC equals 10 + the spell's level. On a failed check. the spell disappears from the gem with no other effect.

Each spell gem has a maximum level for the spell it can store. The spell level determines the gems rarity and the stored spell's saving throw DC and attack bonus. as shown in the Spell Gem table.

You can imbue the gem with a spell if you're attuned to it and it's empty. To do so, you cast the spell while holding the gem. The spell is stored in the gem instead of having any effect. Casting the spell must require either 1 action or 1 minute or longer, and the spell’s level must be no higher than the gems maximum. If the spell belongs to the school of abjuration and requires material components that are consumed. you must provide them. but they can be worth half as much as normal.

Once imbued with a spell. the gem can't be imbued again until the next dawn.

Deep gnomes created these magic gemstones and keep the creation process a secret.

Spell Gem
Max. Spell Level Gemstone Rarity Save DC Attack Bonus
Cantrip Obsidian Uncommon 13 +5
1st Lapis lazuli Uncommon 13 +5
2nd Quartz Rare 13 +5
3rd Bloodstone Rare 15 +7
4th Amber Very rare 15 +9
5th Jade Very rare 17 +9
6th Topaz Very rare 17 +10
7th Star ruby Legendary 18 +10
8th Ruby Legendary 18 +10
9th Diamond Legendary 19 +11