惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
H
Help Net Security
Jina AI
Jina AI
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
博客园 - 叶小钗
Y
Y Combinator Blog
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
C
Check Point Blog
Recent Announcements
Recent Announcements
IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
B
Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I Built an AI Reading Companion with Tree-Structured Conv...
Shuo Wu · 2026-06-24 · via DEV Community

AI makes you productive where you already understand. It confuses you where you don't.

I've been reading non-fiction with AI assistants for a while, and I kept hitting the same wall: 30 messages into a conversation about a dense book chapter, the AI starts losing the thread. I'd branch into a tangent — "how does this connect to what Kahneman said about System 1?" — and suddenly the entire chat context is polluted. No way to get back to where I was.

So I built pi-tree — a self-hosted AI reading companion where the conversation is the reading experience. The key insight: conversations should be trees, not threads.

Router demo — natural language navigation across sources

Why Trees?

When you think through complex material, your mind doesn't work linearly. You branch — "wait, how does this relate to X?" — explore for a bit, then come back. But every AI chat tool forces you into a flat thread where everything piles up.

Tree-structured conversations fix this at the architecture level:

  • Focused context — Each branch carries only its path from root to current node. Less noise → more accurate responses.
  • Token savings — A 50-message linear chat sends all 50 every turn. A tree with 5 branches of 10 sends only ~10. Lower cost, faster responses.
  • Less hallucination — Context pollution is a primary cause of hallucination in long conversations. Isolated branches keep the model grounded.

Here's what a reading session looks like:

📖 Reading: Thinking, Fast and Slow (Kahneman)

Root
├── What is System 1 vs System 2?
│   ├── How does this relate to cognitive biases?
│   │   └── Anchoring bias deep-dive
│   └── Real-world examples in decision making
├── Chapter 3: The Lazy Controller
│   └── Why do we avoid effortful thinking?
└── Comparison with Nassim Taleb's ideas
    ├── Black Swan connection
    └── Antifragility and heuristics

And here's the actual UI — tree sidebar on the left, conversation in the center, table of contents on the right:

Book reading session — tree navigation, AI response, chapter TOC

Agentic, Not RAG

Most "chat with your documents" tools use RAG — chunk your content into embeddings, then retrieve what seems relevant. The problem: retrieval is approximate. The AI gets semantically similar chunks, not necessarily the right context.

Pi-tree takes an agentic approach: the AI has tools that give it precise, on-demand access to your content — more like grep than vector search. It can look up a specific chapter, fetch a paper's methodology section, or scan today's RSS feeds. The context is exact, structural, and requested when needed — not pre-computed and hoped for.

Each source type gets purpose-built tools:

  • Booksprocess_book parses EPUB/MOBI/PDF, extracts chapter structure, builds a navigable outline
  • News feedsget_latest_rss, search_rss crawl your feeds, find trends across sources
  • Paperssearch_papers, get_paper_info query arXiv, fetch and contextualize research
  • YouTubeget_youtube_transcript extracts transcripts for segment-level discussion

The AI's behavior is then shaped by skills — markdown instruction files that define how to read, not just what to retrieve.

Here's a news session — the AI scanned RSS feeds and produced a digest with trends:

News session — AI-powered RSS digest with feed categories

The Plugin System

Everything is customizable at three levels:

1. Skills (Markdown files) — Change how the AI reads by editing a .md file. No code.

2. Session Profiles (YAML) — Map source types to different skills, extensions, and models:

name: book.reading
skills:
  - interactive-reading
extensions:
  - book
exclude_tools:
  - bash
  - edit

3. Full Plugins (TypeScript) — Build new source types with the plugin SDK:

import { definePiTreeExtension } from "@pi-tree/plugin-sdk";

export default definePiTreeExtension((pi, services) => {
  pi.registerTool({
    name: "my_custom_tool",
    description: "Does something useful",
    execute: async (args) => {
      const source = await services.sources.get(args.sourceId);
      // your logic here
    }
  });
});

There's also an MCP bridge — connect external MCP servers (web search, academic databases, translation APIs) by dropping a JSON config file. Same format as Claude Desktop.

Quick Start (Docker)

cp .env.example .env   # add your API key

docker run -d --name pi-tree \
  --env-file .env \
  -p 3847:3847 \
  -v ~/.local/share/pi-tree:/data \
  ghcr.io/shuowu/pi-tree:latest

Open http://localhost:3847. That's it.

Works with any OpenAI-compatible API — cloud providers (DeepSeek, Gemini, Claude, OpenAI) or fully offline with Ollama / LM Studio. Reading doesn't need frontier models — a 12B parameter model works well.

How It Compares

Pi-tree ChatGPT / Claude NotebookLM Obsidian + AI
Focus Comprehension & exploration General-purpose Q&A Document Q&A Note-taking
Conversations 🌳 Tree — branch, explore, return Linear chat Linear chat Linear chat
AI approach Agentic — tools & skills over local data Prompt + context window RAG over uploads Plugins over local vault
Sources Books, papers, news feeds, YouTube File uploads, web Multi-doc notebooks Markdown vault
Extensibility Skills, plugins, MCP bridge GPTs (cloud-hosted) None Community plugins
Model choice BYOK — any provider or local Vendor-locked Google only Plugin-dependent
Data Local-first, self-hosted Cloud Cloud Local

Who Is This For?

  • Nonfiction readers — you're reading a dense chapter and AI summaries skip the part you actually don't understand. Pi-tree stays in that gap with you until you do.
  • Researchers & students — you're outside your subfield and every paper assumes background you lack. Branch into what you don't know, then return to the argument.
  • News followers — you read the headline but can't evaluate the claim. Turn feeds into conversations where you build context over time.
  • Developers — you're in an unfamiliar domain. Build custom plugins to explore anything conversationally.

Links

License: AGPL-3.0 — fully open source.

I'd love feedback on:

  • Does the tree-structured approach resonate with how you read/research?
  • What source types would you want beyond books, news, papers, and YouTube?
  • If you self-host LLMs, what models are working well for reading tasks?

Built on the Pi SDK for tree-structured agent sessions.