TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

144 pointsby herol3oyabout 1 month ago

23 comments

skeptruneabout 1 month ago
I tried &quot;The Wise Man&#x27;s Fear&quot; 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&#x27;ish, but still not great[2].<p>My primary interest would be using these relational graphs to generate better structured summaries of stories in a structured JSON object for improved search&#x2F;recommendations.<p>- [1]<a href="https:&#x2F;&#x2F;austen.pages.dev&#x2F;ecbc2d49-c10d-4e49-ac68-0d37a819b526" rel="nofollow">https:&#x2F;&#x2F;austen.pages.dev&#x2F;ecbc2d49-c10d-4e49-ac68-0d37a819b52...</a><p>- [2]<a href="https:&#x2F;&#x2F;austen.pages.dev&#x2F;ace16c1d-c74e-4737-a98d-5401047a1cdb" rel="nofollow">https:&#x2F;&#x2F;austen.pages.dev&#x2F;ace16c1d-c74e-4737-a98d-5401047a1cd...</a>
评论 #43634744 未加载
eterpsabout 1 month ago
The system prompt can be found here:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;herol3oy&#x2F;austen&#x2F;blob&#x2F;main&#x2F;src&#x2F;server&#x2F;routes&#x2F;v1&#x2F;getMermaidSyntax.ts">https:&#x2F;&#x2F;github.com&#x2F;herol3oy&#x2F;austen&#x2F;blob&#x2F;main&#x2F;src&#x2F;server&#x2F;rout...</a><p>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.<p>I wouldn&#x27;t be surprised if it all could be done with a script using aichat[1] and rendering the diagram using graphviz.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;sigoden&#x2F;aichat">https:&#x2F;&#x2F;github.com&#x2F;sigoden&#x2F;aichat</a>
评论 #43637224 未加载
memholeabout 1 month ago
For anyone vibe checking the results:<p><a href="https:&#x2F;&#x2F;novelchallenge.github.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;novelchallenge.github.io&#x2F;</a><p>At best you’re looking at 60% or so accuracy
评论 #43635939 未加载
kacesensitiveabout 1 month ago
I did Dungeon Crawler Carl - hilariously wrong<p>graph TD A[Carl] --&gt;|Pet| B[Princess Donut] A --&gt;|Enemy| C[Mordecai] A --&gt;|Allies| D[Ellie] A --&gt;|Allies| E[Katia] A --&gt;|Enemy| F[The System] B --&gt;|Rival| G[Bea] D --&gt;|Friend| E E --&gt;|Friend| A
评论 #43635377 未加载
评论 #43636958 未加载
herol3oyabout 1 month 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&#x27;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.
评论 #43642821 未加载
aitchnyuabout 1 month 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.
knowitnoneabout 1 month 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.
评论 #43636647 未加载
mmoustafaabout 1 month 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?<p>I had the same problem with <a href="https:&#x2F;&#x2F;timelines.0xmmo.co" rel="nofollow">https:&#x2F;&#x2F;timelines.0xmmo.co</a> where I had to ground it in Wikipedia articles.
评论 #43641622 未加载
maxwellgabout 1 month ago
Neat! Putting in reference books gives you a nice overview of the book&#x27;s contents. Fun to think of database transactions as a character with relationships.<p><a href="https:&#x2F;&#x2F;austen.pages.dev&#x2F;c2276990-1f2a-40e6-bd26-0cabb55d7132" rel="nofollow">https:&#x2F;&#x2F;austen.pages.dev&#x2F;c2276990-1f2a-40e6-bd26-0cabb55d713...</a>
blancotechabout 1 month ago
Nice idea but the results weren&#x27;t comprehensive for the book I tested. I find that chatgpt with web search enabled does a better job with the simple prompt &quot;Create a relationship diagram for the characters in &lt;BOOK TITLE&gt; using mermaidjs. Include the relationships between people.&quot;
IncreasePostsabout 1 month 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 &quot;What are the character relationships - I&#x27;m on chapter 7 right now&quot;?
kretaceousabout 1 month ago
I tried Circe.<p>It said Circe --Daughter--&gt; Helios. So I thought oh it&#x27;s supposed to be &quot;Circe is Helios&#x27; daughter&quot; but then it had Circe --Brother--&gt; Aeetes and Circe --Mentor--&gt;Hermes.
评论 #43640489 未加载
febedabout 1 month 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.
评论 #43641266 未加载
atoavabout 1 month 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.
ozimabout 1 month ago
I was thinking JIRA stories, well corporate dev dirty mind.
评论 #43633653 未加载
评论 #43633934 未加载
rmnclmntabout 1 month 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
wduquetteabout 1 month ago
Are story relationship diagrams of this kind a common thing that the OP&#x27;s tool produces automatically, or did he devise both the tool and the diagram?
napoleonglabout 1 month 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!
评论 #43636720 未加载
MarcelOlszabout 1 month ago
<a href="https:&#x2F;&#x2F;gitdiagram.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gitdiagram.com&#x2F;</a> does something similar.
WillAdamsabout 1 month ago
How do typos get fixed?<p>The entry for _The Book of Jhereg_ has &quot;Morio&quot; which is not found in the text (conflation of Morollan and Mario?)
aardvark179about 1 month ago
Tried Book of the New Sun. Apparently Terminus Est (a sword) is Severian’s companion, and it completely fails to mention Dorcas.<p>Oh well.
评论 #43636158 未加载
hofoabout 1 month ago
Dorothy is the “enemy” of the Wizard?
iddanabout 1 month ago
could be cool to have pride and prejudice in the examples in the main page
评论 #43640948 未加载