Branch the conversation. Keep every line of thought.
A local-first visual workspace for exploring, comparing, and exporting LLM conversation trees across OpenAI-compatible models.
🌐 中文 | English
Linear chat forces every follow-up into one timeline: explore a different assumption and the original path is pushed out of view. TreeAI turns the conversation into a canvas. Continue from any node, create parallel branches, switch model settings per branch, and preserve every route for later comparison.
All sessions and model configurations stay in the browser's IndexedDB. Requests go directly from the browser to the API endpoint you configure; TreeAI has no application backend.
One prompt, multiple independent paths. Continue any branch without overwriting the others.
| Capability | What it gives you |
|---|---|
| Branch from any node | Explore an alternative question, assumption, or answer while preserving the original conversation path. |
| Tune each branch independently | Select the model, temperature, and token budget at the node level instead of locking one configuration to the whole session. |
| Keep the workspace local | Store sessions and model profiles in browser IndexedDB with no TreeAI server in the middle. |
| Bring in text context | Add .txt and .md files as a new conversation node. |
| Export the tree | Download a FreeMind-compatible .mm file for archiving or further mind-map work. |
- Node.js 18 or newer
- npm
- An OpenAI-compatible API that supports streaming
POST /chat/completions - A provider that allows browser CORS requests from your TreeAI origin
git clone https://github.com/Anionex/treeAI.git
cd treeAI
npm ci
npm run devOpen the local URL printed by Vite, usually http://localhost:5173.
- Open Model settings from the gear button in the lower-left corner.
- Add a model name, an API base URL such as
https://api.openai.com/v1, an API key, and the provider's model identifier. - Create a conversation and edit the system-prompt node.
- Add a child node, enter a message, and send it.
- Use the + button on any node to continue that branch or start a parallel one.
Important
API keys are stored unencrypted in this browser's IndexedDB because TreeAI is a client-only application. Use restricted keys or a trusted local proxy, and do not configure secrets on a shared or untrusted device.
flowchart LR
UI["React + React Flow canvas"] --> Stores["Session and model stores"]
Stores <--> DB["Dexie / IndexedDB"]
UI --> API["Streaming chat service"]
API --> Provider["OpenAI-compatible API"]
Files["TXT / Markdown files"] --> UI
Stores --> Export["FreeMind .mm export"]
- Conversation graph: each chat node stores a
parentId, allowing the UI to reconstruct and render independent branches. - Context assembly: when a node is sent, TreeAI walks its ancestors and sends only that branch's message chain.
- Streaming: responses are consumed from Server-Sent Events and rendered incrementally in the active node.
- Persistence: sessions, node positions, and model profiles are stored locally through Dexie.
TreeAI currently targets OpenAI-style streaming Chat Completions APIs. A compatible provider must:
- expose
POST {baseUrl}/chat/completions; - accept
Authorization: Bearer ...; - return
data:Server-Sent Events with OpenAI-likechoices[0].delta.content, or one of the small fallback text shapes handled inapiService.ts; - allow direct browser requests through CORS.
TreeAI sends the configured API key directly to that provider. The repository does not include a relay server, analytics service, or cloud account system.
TreeAI is an early-stage project (0.1.0). The core branching workflow builds and runs, but the following constraints are intentional and user-visible:
- reasoning-model or provider-specific thinking streams are not supported;
- only
.txtand.mdfile text extraction is enabled; - model credentials are stored locally without encryption;
- there is no account sync, collaboration, or cross-device backup;
- automated application tests have not been added yet; CI currently verifies lint and production build;
- the production bundle is still large and would benefit from code splitting.
See todo.md and open issues for active work.
| Command | Purpose |
|---|---|
npm run dev |
Start the Vite development server. |
npm run lint |
Run ESLint across the project. |
npm run build |
Create a production bundle. |
npm run preview |
Serve the production build locally. |
The main modules are:
src/
├── components/ # Canvas, nodes, sidebar, model manager, uploads
├── context/ # Database loading boundary
├── db/ # Dexie / IndexedDB persistence
├── services/ # Streaming OpenAI-compatible requests
├── stores/ # Session and model state
└── utils/ # File extraction, notifications, mind-map export
Before opening a pull request, run:
npm ci
npm run lint
npm run build- Questions and setup help: Support guide
- Bugs and feature requests: Issue forms
- Contributions: Contributing guide
- Security reports: Security policy
- Community standards: Code of Conduct
- User-visible changes: Changelog
- Sponsorship: Funding guide
TreeAI is maintained by Anionex. If the project helps you explore LLM conversations more clearly, you can support it by starring the repository, sharing it, reporting reproducible issues, contributing focused improvements, or sponsoring continued development.
Released under the MIT License.

