Chasm

A generative interactive fiction text adventure

Chasm is a text adventure engine in a world you specify. It uses generative artificial intelligence to generate scenes and characters as you play.

Unlike simply role-playing with a chatbot, important state persists (locations, characters, dialogue, events) between sessions. Each world is a directory of markdown files that a language model reads and writes through the pi harness.

See example gameplay for what a session looks like.

How it works

The narrator reads world state from markdown files, interprets your commands, and writes the story back. Places, characters, items, and events are all persisted as files with git. State auto-saves after every turn.

The player begins with amnesia — no name, no memory, just sensory impressions. As you explore, the narrator creates places and characters, and the world grows around you.

To play, install Chasm and create a world.

In-game commands

Type natural language to act in the world. The narrator interprets your commands and responds in second-person prose.

Command What it does
Ctrl+L Switch models mid-session
Ctrl+O Expand/collapse tool output
/save Force a save of the game state
/sync Force the narrator to re-read and persist state (use if the model forgets)
/compact Compact the context (use if the model’s beginning to forget its instructions, or getting confused)

Problems / bugs

The previous version was a byzantine client-server architecture of ~7,000 lines of Hy. The rewrite is ~1,000 lines of code, mostly prompts. Because it delegates the difficult work to pi, maintenance is much simpler.

Still, Chasm is new and in testing. Please report bugs on the GitHub issues page, checking first if the issue already exists.

Disclaimer

There is no good way to moderate the actions and writing of language models. Chasm could offend you, embarrass you in front of your mother-in law, execute rm -rf ~ or even execute your kitten. You must check prompts that other people provide for such instructions. No guarantees thereof are offered.

About

Chasm is written by Ati Sharma and is MIT-licenced.

Chasm stands for Character State Manager.