Skip to content

Latest commit

 

History

108 Commits

Folders and files

Repository files navigation

Time Track Narrative Graph

Live editor · Run it · Python engine · Thesis notes · 中文

The ttng editor with the Little Red Riding Hood example on three tracks.

Design a story as a graph, then let an LLM write it. ttng stands for Time Track Narrative Graph: a narrative laid out on a time-by-track grid. The repository is called narrative-graph.

A narrative is laid out on a time × track grid, where tracks are topics or entities. Nodes are story beats, edges connect beats that share an attribute, and nine reusable motifs (Linear, Arch, Ladder, EarlyTurn, LateTurn, SharpBranch, WideBranch, SharpMerge, WideMerge) describe how a plot moves between tracks.

Status: early. Three earlier projects were merged here with their git history intact and are being joined step by step (docs/REFACTOR.md). The editor's JSON file goes through the Python writer and back (python -m ttng_story); there is no button for it yet, and the writer has never been run against the live OpenAI API. See docs/MIGRATION.md for what came from where.

Layout

Path What it is Came from
apps/web Graph editor: drag motifs onto the grid, DAG and force views, undo/redo, AI graph generation through OpenRouter (React 19, Vite, Cytoscape) ttng-constructor
python Generation engine: narrative structure → aligned themes, entities and time periods → LLM writes one chapter per node gpt_storytale
legacy/gpt_storyteller Earlier pipeline. Kept only to lift cartographer, journalist and graph code into python/, then to be deleted gpt_storyteller
schema The graph, graph-file and story JSON Schemas, with the fixtures both test suites read –
examples A finished sample: Little Red Riding Hood, nine chapters on three tracks (load it from the editor's left panel) –
docs Notes, including how the code maps to the thesis –

Running the pieces today

Web editor:

cd apps/web
npm install
npm run dev    # the AI dialog asks for your own OpenRouter key; none is needed to edit

Python engine: see python/README.md.

License

MIT. The repository was called gpt_storytale until it was renamed to SonghaiFan/narrative-graph; the old address redirects.


syuze 叙仄  News Metro  ttng  VisDelta  cytocausal  Aethel

Perspectiva · Access

Frank series · Made by Songhai Fan

Frank

Releases

Packages

Contributors

Languages