Show HN: I built an app to generate story relationships using Mermaidjs

herol3oy | 141 points

I tried "The Wise Man's Fear" and the results were not so great[1]. It got a good number of the characters, but only showed them being related to Kvothe. Harry potter worked better'ish, but still not great[2].

My primary interest would be using these relational graphs to generate better structured summaries of stories in a structured JSON object for improved search/recommendations.

- [1]https://austen.pages.dev/ecbc2d49-c10d-4e49-ac68-0d37a819b52...

- [2]https://austen.pages.dev/ace16c1d-c74e-4737-a98d-5401047a1cd...

skeptrune | 3 days ago

The system prompt can be found here:

https://github.com/herol3oy/austen/blob/main/src/server/rout...

It would be more interesting if the graph could be generated by sourcing an arbitrary epub file into a RAG and have it figure out character relations without reading the whole book.

I wouldn't be surprised if it all could be done with a script using aichat[1] and rendering the diagram using graphviz.

[1] https://github.com/sigoden/aichat

eterps | 3 days ago

For anyone vibe checking the results:

https://novelchallenge.github.io/

At best you’re looking at 60% or so accuracy

memhole | 3 days ago

I did Dungeon Crawler Carl - hilariously wrong

graph TD A[Carl] -->|Pet| B[Princess Donut] A -->|Enemy| C[Mordecai] A -->|Allies| D[Ellie] A -->|Allies| E[Katia] A -->|Enemy| F[The System] B -->|Rival| G[Bea] D -->|Friend| E E -->|Friend| A

kacesensitive | 3 days ago

Hi, I created the app. I appreciate all of your comments. I know some may find the result of a book not concise or accurate. One issue was that I couldn't afford the price of a better LM service. At first, I tried a free tier of Gemini, but its results were disappointing. Later, I switched to DeepSeek and got better results.

herol3oy | 3 days ago

I tried One Hundred Years of Solitude, which has a family tree before main text. Wish the app mentioned the 17 illegitimate sons, all with same name Aureliano.

aitchnyu | 3 days ago

Cool idea, but from my tests it seems like the LLM needs more grounding since it misses lots of characters. Maybe a list of the actual characters in the story?

I had the same problem with https://timelines.0xmmo.co where I had to ground it in Wikipedia articles.

mmoustafa | 3 days ago

Neat! Putting in reference books gives you a nice overview of the book's contents. Fun to think of database transactions as a character with relationships.

https://austen.pages.dev/c2276990-1f2a-40e6-bd26-0cabb55d713...

maxwellg | 3 days ago

This is handy. When I read, sometimes I have to go back and figure out who a character is so this is definitely right up my alley.

knowitnone | 3 days ago

Nice idea but the results weren't comprehensive for the book I tested. I find that chatgpt with web search enabled does a better job with the simple prompt "Create a relationship diagram for the characters in <BOOK TITLE> using mermaidjs. Include the relationships between people."

blancotech | 3 days ago

It would be neat if this could handle spoilers. Imagine a friend becomes an enemy 75% of the way through the book. Would there be some way to say "What are the character relationships - I'm on chapter 7 right now"?

IncreasePosts | 3 days ago

I tried Circe.

It said Circe --Daughter--> Helios. So I thought oh it's supposed to be "Circe is Helios' daughter" but then it had Circe --Brother--> Aeetes and Circe --Mentor-->Hermes.

kretaceous | 3 days ago

LLMs make it really trivial to work with MermaidJS. Just yesterday I used it to sketch out some business logic. Seeing the whole flowchart like that helped me catch some corner cases.

febed | 3 days ago

How does that deal with the important fact that a lot of stories are about relationships changing over time? A enemy can become a friend and vice versa.

atoav | 3 days ago

Just tried with « Time out of joint » from Philip K Dick, and it got it right… but only the first half of the story! Guess, there is no spoiler then

rmnclmnt | 3 days ago

Are story relationship diagrams of this kind a common thing that the OP's tool produces automatically, or did he devise both the tool and the diagram?

wduquette | 3 days ago

I was thinking JIRA stories, well corporate dev dirty mind.

ozim | 3 days ago

Wild that I was daydreaming earlier today about generating some diagrams with mermaid to show the plot and characters over the lifetime of a tv series!

napoleongl | 3 days ago

https://gitdiagram.com/ does something similar.

MarcelOlsz | 3 days ago

How do typos get fixed?

The entry for _The Book of Jhereg_ has "Morio" which is not found in the text (conflation of Morollan and Mario?)

WillAdams | 3 days ago

Tried Book of the New Sun. Apparently Terminus Est (a sword) is Severian’s companion, and it completely fails to mention Dorcas.

Oh well.

aardvark179 | 3 days ago

Dorothy is the “enemy” of the Wizard?

hofo | 3 days ago

could be cool to have pride and prejudice in the examples in the main page

iddan | 3 days ago

[dead]

curtisszmania | 3 days ago

[flagged]

01115944268 | 2 days ago