Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

102 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thread Chat

Thread Chat is a branch-conversation workspace for following an idea without losing the conversation that led to it. Select text in a response, branch from that context, and compare or navigate the resulting threads in columns or on a canvas.

中文文档

What it does

  • Start a new branch from any point in a response (with context). Select a phrase, claim, example, or question to open a focused conversation that inherits everything up to that point. The branch can develop independently without cluttering or changing the original thread, and it can split again whenever another idea deserves its own path.
  • Navigate the whole conversation as a tree. Keep important threads open side by side in resizable columns, use breadcrumbs and search to move between them, or zoom out to the canvas to see how every conversation connects and return to any branch.

Status and roadmap

Thread Chat is under active development. The current repository includes authenticated chat, persisted branch trees, column and canvas workspaces, Markdown artifacts, optional attachments, deep research, account flows, and billing integrations. Interfaces and operational integrations may continue to evolve before a stable release.

Current directions include strengthening automated coverage, improving deployment and configuration guidance, and refining the branch-workspace experience across screen sizes. Treat the issue tracker and accepted OpenSpec changes as the source of truth for planned work.

Roadmap

Organized by theme. Priority tag: P0 = highest priority.

P0 · High priority

  • Inherited-context compression - Compress inherited branch context to lower multi-column conversation cost.
  • Project workspace - Project-level goals and shared documents.
  • In-product memory - Long-term memory geared toward project research.

Core features

  • Summarize & index - Summarize a column or topic, with indexing and retention.
  • Multi-tenant & multi-user - User isolation, with memory scoped per user/project.
  • Web search - Bring web search into the conversation.
  • DeepResearch - Add deep-research capability.
  • Skill system - Web-based Skills and a built-in Skill Creator.
  • Sub-agent - Create, monitor, and aggregate multiple Sub-agents.

Interactive Preview

  • Interactive Preview - Render interactive visual artifacts within generated content.

Markdown & content rendering

  • Markdown rendering enhancements - Refine rendering and essentials, including Mermaid.
  • Code-block highlighting - Improve the code-block highlighting experience.
  • Markdown artifact display - Refine panel placement and information density.
  • HTML generation & preview - Support HTML generation and preview.

UI / UX interaction

  • Text-selection toolbar - Quick action bubble on text selection.
  • Chat TOC - Side directory navigation per conversation.
  • Scroll-to-bottom button - Refine placement and appearance threshold.
  • Simplify input area - Streamline the bottom input styling.
  • Overall UI micro-polish - Fine-tune UI elements and interaction effects.

Quick start

Prerequisites

  • Node.js >=20.9.0 and pnpm (this repository declares pnpm@10.32.1)
  • A PostgreSQL database
  • Credentials for at least one supported model provider; the default model uses MiniMax

Clone the repository and install dependencies:

git clone https://github.com/hifizz/thread-chatbot.git
cd thread-chatbot
pnpm install
cp .env.example .env.local

For the default minimum local setup, set these values in .env.local:

DATABASE_URL=postgres://...
DIRECT_URL=postgres://...
BETTER_AUTH_SECRET=replace-with-a-high-entropy-secret
BETTER_AUTH_URL=http://localhost:3000
MINIMAX_API_KEY=...

DATABASE_URL is required by the running application. pnpm db:migrate uses DIRECT_URL when present and otherwise falls back to DATABASE_URL; use a direct database URL for migrations when your runtime URL is a transaction-pooler connection. MINIMAX_BASE_URL and LLM_MODEL_ID have defaults in .env.example, so they are not required for the default setup. A different configured model provider may be used instead of MiniMax, but the default model selection expects MINIMAX_API_KEY.

Apply migrations and start the development server:

pnpm db:migrate
pnpm dev

Open http://localhost:3000/thread-chat to enter the Thread Chat workspace. Sign in when prompted; the bare route resumes the most recently opened tree when available, while a tree URL such as /thread-chat/{treeId} identifies a specific persisted conversation.

Optional integrations

The following features are opt-in and are not required for the quick start:

  • Deep research: SEARCH_API_KEY (and optionally SEARCH_BASE_URL)
  • Attachments and PDF processing: Cloudflare R2 variables (R2_ACCOUNT_ID, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, R2_BUCKET)
  • Large-document vector retrieval: EMBEDDINGS_BASE_URL, EMBEDDINGS_API_KEY, and EMBEDDINGS_MODEL, plus PostgreSQL pgvector
  • Additional model providers and gateways: provider keys, Cloudflare AI Gateway, or Vercel AI Gateway variables documented in .env.example
  • Email verification, Turnstile, Google sign-in, billing, and Creem payments: their feature-specific variables in .env.example

Do not commit .env.local or credentials.

Architecture

The project is a Next.js 16 App Router application using React, TypeScript, Tailwind CSS, Base UI-backed shadcn components, assistant-ui, AI SDK, Drizzle ORM, and PostgreSQL.

Boundary Location Responsibility
Core app/thread-chat/core/ Tree state, selectors, and the branch-conversation store
Branching app/thread-chat/branching/ Text selection, anchors, contextual branches, and branch-aware chat rendering
Orchestration app/thread-chat/orchestration/ Column workspace, tree canvas, switching, artifacts, and workbench controls
Network app/thread-chat/net/ Tree loading, sanitization, debounced persistence, prompts, and streaming UI events
Server app/api/ and lib/chat/ Authentication, model streaming, tool handling, branch-tree APIs, attachments, and research tools

Detailed design material is available in the repository:

Contributing

Issues and pull requests are welcome. Please read CONTRIBUTING.md for the pnpm workflow, validation commands, and contribution terms.

License

Copyright © 2026 hifizz.

Thread Chat is licensed under GNU Affero General Public License v3.0 only (AGPL-3.0-only). This project license does not replace the licenses or notices that apply to third-party dependencies, assets, or separately attributed code.

About

Chat with AI in human way.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages