Show HN: I built an app to generate story relationships using Mermaidjs
45 comments
·April 9, 2025skeptrune
tshaddox
The thought of The Kingkiller Chronicle hasn't crossed my mind in many years, and now I have renewed sadness that the story will never be finished. :'(
WorldMaker
Pat Rothfuss is still working on it, last I heard.
DavidPiper
This is one of those sentences whose meaning subtly changes depending on which word you put the emphasis on :-)
eterps
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.
herol3oy
Oh, this is a great idea. I'd love to try it and maybe I could add this feature to the current one! Thank you.
memhole
For anyone vibe checking the results:
https://novelchallenge.github.io/
At best you’re looking at 60% or so accuracy
skeptrune
Actually incredibly good benchmark site, thanks for sharing!
kacesensitive
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
arkensaw
i'm suffering some frequency illusion right now because I only heard about Dungeon Crawler Carl for the first time, literally yesterday and today here it is in a comment
kacesensitive
It's by far my favorite series. Def pick it up if you have time!
kinow
Mine too. I was disappointed I was going to be left with nothing exciting to read after The Wandering Inn, but this series is amazing. +1 on the suggestion!
kinow
I am reading it right now and thought what would be the outcome of doing the same!
Bea being Donut's rival… sounds interesting. Depending how you interpret it, it's not entirely wrong?
Carl being enemy of Mordecai looks really wrong though.
As for Carl being an enemy of the System (I assume the AI), that's also debatable.
And if the friend of a friend rule applied here, I think Carl would be a friend of Ellie too, since Carl is a friend of Katia, and Ellie is a friend of Katia too. And they are all allies. Weird.
herol3oy
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.
ttw44
It's impressive you're able to have decent results from free tiers and open source models.
aitchnyu
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.
mmoustafa
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.
herol3oy
I love the timeline! Are we limited to search for some keywords? I tried some countries but couldn’t find them in the results!
knowitnone
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.
herol3oy
That was exactly what I struggled with—and still do!
maxwellg
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...
blancotech
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."
IncreasePosts
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"?
kretaceous
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.
banku_brougham
Yup those Greek gods were nothing but drama and problems.
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...