How does SLAG work?
A semi-deep somewhat-technical dive into how SLAG's story engine works.
Human Input
The entire process begins with a human prompt; for example:
Write a hard scifi novel called Starfall: Lost Age of Giants in the style of Asimov and Haldeman.
SLAG's story engine then takes that prompt, augments it with some additional formatting guidelines (basically, how our LLM should format it's response to the user's prompt), and voilà, you have a story.
Just kidding. Anyone that has interacted with an LLM like ChatGPT or Claude knows that, while impressive, these systems begin to lose track of a conversation after it's been going on for a while, and the length of their responses, while 'long', are not short-story (and far from novel) length. So how do we get a long-form story from a single prompt?
SLAG's Story Engine
At the heart of SLAG is a story engine. The story engine can be boiled down to a bunch of logic (code) and a large language model (LLM).
LLMs are basically predictive text models. Just think of your keyboard on your iPhone or Android and how it suggests the next word. An LLM is that, just bigger, better, faster.
There are many LLMs on the market today, with Anthropic's Claude series offering arguably the best LLMs for conversational (or natural language) generation. Of the Claude models, Sonnet 3.5 was chosen as the model for SLAG's novel story-engine for it's performance, large training base, and capabilities.
RAG
Retrieval-augmented generation, or RAG, is a technique of augmenting the generation process of an LLM by integrating an external database from which information is retrieved.
Using RAG, SLAG's story engine is able to index and retrieve previous responses from Claude.
For example, Claude's response to that first prompt the user provided is indexed (stored) in SLAG's database and flagged as belonging to 'Starfall: Lost Age of Giants'. The next time Claude is prompted to give a response regarding that story, any data from our database flagged 'Starfall: Lost Age of Giants' is retrieved and provided to Claude as context.
In this way, we're able to actively manage (and grow) Claude's context to include all of its previous responses for a particular story. Side note: all of the data stored for a particular story is referred to as a 'story bible'.
Recursive Prompting
Recursive prompting is the idea of repetively prompting an LLM for more and more details on a topic. For example, try asking ChatGPT or Claude to generate a character sheet for Agent Smith, the protagonist in a thriller story called It Ends Here. It will produce a decent summary, but you're not going to get a deep, rich character profile, which is needed when writing longer-form stories. So what do you do? Recursive prompting is what you do.
You ask your LLM to expand on each category in your character sheet; then expand on each sub-category within each category. That's a lot of categories. But it's also a lot of data, and since Claude has the previous responses in his context thanks to RAG, SLAG's story engine is able to build cohesive, well-developed characters, all autonomously and from that original, single user-prompt.
Last updated
Was this helpful?