A new open-source project dropped on GitHub that treats prompt engineering like code. Five lines. Full fantasy world context. No paragraphs of instructions.
It’s called dragonruntime. And if you build AI-driven games, interactive fiction, or just want a cleaner way to structure complex prompts, it’s worth ten minutes of your attention.
What it is
dragonruntime is a minimalist schema language for declaring AI prompt context. Instead of writing walls of natural language instructions, you define entities, query parameters, and execution modes in tight shorthand.
Think of it as a config file for your AI’s world. Compact, readable, version-controllable. Where a typical prompt file might run 300 words of prose explaining roles, rules, and relationships, a dragonruntime schema covers the same ground in a dozen structured lines. No redundancy, no ambiguity baked into sentence structure, no guessing whether the model actually parsed your third “remember to” the way you intended.
The project lives in the runtime folder of the lumixdeee/dragi repository and is early enough that the core pattern is more valuable than the tooling around it. That’s not a knock. That’s how good primitives start.
The twist
Most prompt engineers still write prompts like emails. Long, conversational, full of “please do X and also remember Y.” dragonruntime flips that entirely. It borrows from programming language design: typed parameters, entity declarations, named modes.
The result is prompts that diff cleanly in git, reload fast across sessions, and stay consistent at scale. That’s something no paragraph-style prompt can promise.
Here’s a concrete illustration. A typical fantasy AI prompt might say: “You are a dungeon master. The player is in a forest. There is a goblin named Gruk nearby who is hostile. The player is a human named Aldric who is hungry. Track their hunger and the goblin’s behavior across the conversation.” Fine for a one-off. Now imagine maintaining 40 encounter types, sharing them across a team, and debugging why Gruk stopped being hostile three sessions ago. The paragraph prompt gives you nothing. A typed schema with named entities and versioned configs gives you everything.
How to use it 🗺️
Step 1: Define your query schema with qs:(param1, param2, ...). This tells the runtime what inputs to expect per interaction. For the example: eat, loc, ID, eater. Every turn the AI processes, these params are explicitly scoped. No fuzzy inference about what “the current state” means.
Step 2: Declare your entity types with foe:(TYPE_A, TYPE_B)=CATEGORY. These are the named actors the AI will track and reason about. Grouping entities by category means you can swap out an entire class of enemies or NPCs without rewriting your context logic. 🐉
Step 3: Set context layers with cont:(param1, param2, ...). This shapes the rules and environmental state your AI holds across turns. Think of it as your world’s physics. Hunger mechanics, faction allegiances, time of day, weather conditions. Anything the AI needs to reason about consistently goes here, declared once, referenced everywhere.
Step 4: Set mode:production when you’re running live. Swap to a dev mode during testing to avoid unintended behavior in live environments. The mode flag is a small detail that pays off fast when you’re iterating on encounter logic and don’t want test runs bleeding into a real session.
Pro tips ⚡
- Treat each dragonruntime config as a module. One file per scene or encounter type. Swap them as the narrative shifts. This is where the programming-language framing really delivers: you end up with a library of reusable world states instead of a graveyard of copy-pasted prompt blocks.
- The compact syntax makes git diffs useful. You’ll spot a changed entity or context param at a glance instead of hunting through paragraphs. When something breaks mid-campaign or mid-session, you can bisect the config history the same way you’d debug code. That alone is worth the setup cost.
- Don’t limit it to gaming. The schema pattern works for any multi-entity, stateful AI interaction: support bots, educational sims, complex workflow assistants. Any time you need an AI to track multiple named actors and persist state across a conversation, this pattern beats prose prompting. Legal research tools, medical intake flows, customer onboarding bots. The name is fantasy-flavored; the pattern is universal.
Check it out 🔗
The project is early-stage, documentation is thin. But the core pattern is clean and the direction is solid. If you’re building anything that needs structured AI behavior across sessions, dragonruntime is worth studying even if you don’t adopt it wholesale.
Find it on GitHub under lumixdeee/dragi in the runtime folder. The prompt engineering community rarely ships things this minimal and this reusable at the same time. Most tools in this space go wide fast, adding features before the foundation is proven. This one went narrow on purpose. That restraint is exactly what makes it interesting.
this could be useful for actual heros, adventurers, dragonworkers etc
by u/decofan in PromptEngineering