from Hacker News

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

by herol3oy on 4/9/25, 3:34 PM with 43 comments

  • by skeptrune on 4/9/25, 5:06 PM

    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...

  • by eterps on 4/9/25, 4:44 PM

    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

  • by memhole on 4/9/25, 6:02 PM

    For anyone vibe checking the results:

    https://novelchallenge.github.io/

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

  • by kacesensitive on 4/9/25, 5:13 PM

    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

  • by herol3oy on 4/9/25, 7:55 PM

    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.
  • by aitchnyu on 4/10/25, 7:02 AM

    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.
  • by knowitnone on 4/9/25, 4:06 PM

    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.
  • by mmoustafa on 4/10/25, 7:16 AM

    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.

  • by maxwellg on 4/9/25, 11:21 PM

    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...

  • by blancotech on 4/9/25, 8:41 PM

    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."
  • by IncreasePosts on 4/9/25, 9:40 PM

    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"?
  • by kretaceous on 4/10/25, 3:17 AM

    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.

  • by febed on 4/10/25, 3:55 AM

    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.
  • by atoav on 4/10/25, 7:15 AM

    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.
  • by ozim on 4/9/25, 3:53 PM

    I was thinking JIRA stories, well corporate dev dirty mind.
  • by rmnclmnt on 4/10/25, 5:28 AM

    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
  • by wduquette on 4/9/25, 5:56 PM

    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?
  • by napoleongl on 4/9/25, 5:11 PM

    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!
  • by MarcelOlsz on 4/9/25, 5:48 PM

    https://gitdiagram.com/ does something similar.
  • by WillAdams on 4/9/25, 4:10 PM

    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?)

  • by aardvark179 on 4/9/25, 6:54 PM

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

    Oh well.

  • by hofo on 4/9/25, 8:51 PM

    Dorothy is the “enemy” of the Wizard?
  • by iddan on 4/10/25, 5:26 AM

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