<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shuo Wu</title>
    <description>The latest articles on DEV Community by Shuo Wu (@shuo_wu_00d47f641aed077d6).</description>
    <link>https://dev.to/shuo_wu_00d47f641aed077d6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1545949%2Fe732ac6e-7bda-4001-a9b9-e5b8b1512502.png</url>
      <title>DEV Community: Shuo Wu</title>
      <link>https://dev.to/shuo_wu_00d47f641aed077d6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shuo_wu_00d47f641aed077d6"/>
    <language>en</language>
    <item>
      <title>Flat Chat Threads Suck for Reading Books. So I Built a Local-First AI Tree Companion.</title>
      <dc:creator>Shuo Wu</dc:creator>
      <pubDate>Mon, 08 Jun 2026 16:52:33 +0000</pubDate>
      <link>https://dev.to/shuo_wu_00d47f641aed077d6/flat-chat-threads-suck-for-reading-books-so-i-built-a-local-first-ai-tree-companion-3oai</link>
      <guid>https://dev.to/shuo_wu_00d47f641aed077d6/flat-chat-threads-suck-for-reading-books-so-i-built-a-local-first-ai-tree-companion-3oai</guid>
      <description>&lt;p&gt;I was reading books with &lt;a href="https://pi.dev" rel="noopener noreferrer"&gt;Pi&lt;/a&gt; in the terminal — a minimalist AI agent with tree-structured conversations — and it was genuinely the best way I'd ever read non-fiction. Branch into a tangent, explore it deeply, jump back without losing context. Every session was a map of how I actually thought about the material.&lt;/p&gt;

&lt;p&gt;But it was a terminal tool. My wife reads more books than I do. My kids are curious about everything but need something they can click around in. My parents would never open a terminal. The gap between &lt;em&gt;"this is incredible"&lt;/em&gt; and &lt;em&gt;"nobody else can use it"&lt;/em&gt; felt like a problem worth solving.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://github.com/shuowu/pi-books" rel="noopener noreferrer"&gt;pi-books&lt;/a&gt;&lt;/strong&gt; — an open-source, local-first reading companion that turns any book into a conversation you navigate like a tree.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem with Flat Chat
&lt;/h2&gt;

&lt;p&gt;Most AI tools treat books the same way they treat any prompt: paste text in, get an answer, context gone. You go on a tangent — &lt;em&gt;"wait, how does this connect to X?"&lt;/em&gt; — and now your entire thread is polluted. There's no structure, no persistence, no sense of &lt;em&gt;journey&lt;/em&gt; through the material.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Tree-Structured Conversations
&lt;/h2&gt;

&lt;p&gt;Instead of one long flat thread, pi-books structures your reading as a topic tree.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs8ddfrnjngh6l4lhf7l4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs8ddfrnjngh6l4lhf7l4.png" alt="Pi-books library — upload EPUBs, MOBIs, or PDFs" width="800" height="696"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftkgu2plyfe4ijgs3ck88.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftkgu2plyfe4ijgs3ck88.png" alt="Pi-books reading session with branching conversation tree" width="800" height="736"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Branches on semantic shifts&lt;/strong&gt; — go deeper, switch chapters, follow a tangent. Each gets its own branch with full context preserved. Jump back to the main branch anytime, zero contamination.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The chat IS the reader&lt;/strong&gt; — no separate reader and chat window. The AI surfaces book content as quotes directly in the conversation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zoom in and out&lt;/strong&gt; — dive deep on a concept, then pull back to a summary without losing your place.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every user gets their own tree&lt;/strong&gt; — multiple people (family, book club) can read the same book independently, each with their own conversation tree, glossary, and reading history.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clickable navigation&lt;/strong&gt; — side-by-side Table of Contents and Topic Tree. Click any node to jump back in time and context.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔒 100% Local-First &amp;amp; Private
&lt;/h2&gt;

&lt;p&gt;Everything runs on your machine — books, sessions, conversations, glossaries. No cloud account, no subscription.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloud APIs:&lt;/strong&gt; DeepSeek, Gemini, Claude — cheap and fast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fully offline:&lt;/strong&gt; Point it at &lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt; or &lt;a href="https://lmstudio.ai/" rel="noopener noreferrer"&gt;LM Studio&lt;/a&gt;. Zero cost, nothing leaves your network.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Book reading doesn't need frontier-class models. Smaller, faster models work great — see the &lt;a href="https://github.com/shuowu/pi-books#models" rel="noopener noreferrer"&gt;README&lt;/a&gt; for recommendations.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ The Stack
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;packages/
  shared/      — Shared TypeScript types
  extension/   — Pi SDK skills, ebook parsers, plugins
  server/      — Hono API server (tree manager + SQLite/Drizzle)
  client/      — React + Vite frontend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Built on the &lt;a href="https://pi.dev" rel="noopener noreferrer"&gt;Pi SDK&lt;/a&gt; for tree-structured agent conversations, &lt;a href="https://hono.dev/" rel="noopener noreferrer"&gt;Hono&lt;/a&gt; for a lightweight server (Electron-friendly), and SQLite with &lt;a href="https://orm.drizzle.team/" rel="noopener noreferrer"&gt;Drizzle ORM&lt;/a&gt; for metadata.&lt;/p&gt;

&lt;p&gt;One thing I'm particularly proud of: &lt;strong&gt;AI behavior is controlled entirely by Markdown files.&lt;/strong&gt; Each reading "skill" (summarize, deep-dive, quiz, etc.) is just a &lt;code&gt;.md&lt;/code&gt; file in the &lt;code&gt;extension/skills/&lt;/code&gt; folder. Want to change how the AI reads? Edit a markdown file. No code changes, no redeployment. This makes it very hackable — you can create your own reading skills in minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Getting Started
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Docker (one command):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;--name&lt;/span&gt; pi-books &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--env-file&lt;/span&gt; .env &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-p&lt;/span&gt; 3847:3847 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-v&lt;/span&gt; /path/to/your/books:/library:ro &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-v&lt;/span&gt; pi-books-data:/data &lt;span class="se"&gt;\&lt;/span&gt;
  ghcr.io/shuowu/pi-books:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Local dev:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/shuowu/pi-books.git
&lt;span class="nb"&gt;cd &lt;/span&gt;pi-books
&lt;span class="nb"&gt;cp&lt;/span&gt; .env.example .env   &lt;span class="c"&gt;# add your model config / API key&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  💬 Looking for Feedback!
&lt;/h2&gt;

&lt;p&gt;This is early-stage and I'd love your input:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What's your current workflow for reading books/papers with AI? What's broken?&lt;/li&gt;
&lt;li&gt;What custom reading "skills" would you build?&lt;/li&gt;
&lt;li&gt;Would you use this? What's missing?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;⭐ &lt;strong&gt;&lt;a href="https://github.com/shuowu/pi-books" rel="noopener noreferrer"&gt;github.com/shuowu/pi-books&lt;/a&gt;&lt;/strong&gt; — star it, try it, tell me what you think!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>ai</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
