# Generate endless Roblox quests with AI (and cache them so it's cheap)

> Source: <https://dev.to/korvus228/generate-endless-roblox-quests-with-ai-and-cache-them-so-its-cheap-3cj6>
> Published: 2026-08-23 12:17:03+00:00

Hand-written quests run out. Players finish your content faster than you can write it, and the tenth "collect 10 wolf pelts" quest feels like filler. You can generate quests on the fly instead — tuned to the player and the place.

``` js
local Cortex = require(game.ServerStorage.Cortex)
local ai = Cortex.new("YOUR_KEY")

local quest = ai:ask(
    "Give one short side-quest for a forest zone, player level 5. One sentence.",
    "player just entered the forest"
)
print(quest)
--> "Find the woodcutter who vanished near the old mill before nightfall."
```

Same pattern generates item names, descriptions, and lore.

World-gen content (an item's description, a location's lore) is generated **once** and then it's fixed — so cache it and never pay for it again. With [Cortex](https://cortex-rbx.github.io), cached repeats are free and you're billed on output tokens only, so a world full of generated flavor text costs almost nothing. Pay in Robux, key stays server-side.

Free beta + open-source kit: [https://github.com/cortex-rbx/roblox-ai-kit](https://github.com/cortex-rbx/roblox-ai-kit) · demo: [https://cortex-rbx.github.io](https://cortex-rbx.github.io)
