A Web API implementation using a narrative outline to generate context-free text.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



Narrative-Engine is a Web API implementation for generating texts according to a predefined narrative outline. The text itself is randomized from building blocks containing either expressions (building block sequences) or values (strings).

This allows us to create random text generators that actually make some kind of sense (or not, if that's what you prefer).

Example Config:

The narrative of this example config tells us that someone did something against someone or something. Each block/part in the narrative is resolved separately, and if the part is one or more expressions it will recurse into those parts as well.

	"Narrative": [
	    "someone deed target"
	    "Name": "someone",
		"Values": [
			"Dr. Strangelove",
			"Bruce Wayne",
	    "Name": "deed",
	    "Values": [
		    "completely destroyed",
		    "surfed on",
		"Name": "target",
		"Expressions": [
			"size animal",
		"Name": "size",
		"Values": [
			"a small",
			"a large",
			"a tiny",
			"a gigantic"
		"Name": "animal",
		"Values": [

Example outputs:

Based on the example configuration above, the output received would look something like this:

  • Dr. Strangelove poked a gigantic bunny
  • Khadafi poked a large cow.
  • Erdogan completely destroyed a small dinosaur.
  • Khadafi bought a small dog.

Why would anyone want to use this?

Well, there's probably a lot of reasons, like creating fake articles, novel pages or what not. A popular example, which uses Dada Engine and not narrative-engine, is @LisaWray's project for generating bogus text snippets that look like they are from the novel Fifty shades of Grey.