Skip to content

A new chat interface built for speed and ease of use based on modelling conversation with LLMs as trees (DAGs) instead of linearly.

Notifications You must be signed in to change notification settings

LightFlow-AI/treegpt

Repository files navigation

TreeGPT Logo

A Next.js application that visualizes chat conversations with GPT in a tree-like graph structure.

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • OpenAI API key

Setup

  1. Clone the repository:
git clone https://github.com/yourusername/treegpt.git
cd treegpt
  1. Install dependencies:
npm install
# or
yarn install
  1. Create a .env file in the root directory:
OPENAI_API_KEY=your_api_key_here

Replace your_api_key_here with your actual OpenAI API key.

Running the Application

  1. Start the development server:
npm run dev
# or
yarn dev
  1. Open your browser and navigate to:
http://localhost:3000

(or the URL shown in your terminal)

What is TreeGPT?

TreeGPT (treegpt.app) is a new chat interface built for speed and ease of use, based on modeling conversations with LLMs as trees (DAGs) instead of linearly.

Problems TreeGPT Solves

  1. Tangential Conversations

    • Traditional interfaces don't allow for branching conversations
    • TreeGPT enables chat tangents with easy context control
  2. Natural Language Search

    • Search through chats using natural language descriptions
    • Uses metadata embeddings and RAG lookup for better search results
  3. Token Management

    • Real-time token usage tracking and cost estimation
    • Control over output length and context window
  4. Model Selection

    • Intelligent model routing based on heuristics and benchmarks
    • Support for multiple providers (OpenAI, Anthropic, Gemini, DeepSeek)

Key Features

  1. Interactive Tree Visualization

    • Mini-map showing the conversation tree
    • Visual "context lineage" highlighting
    • Node summaries and hover previews
  2. Vim-like Keybindings

    • Toggle between "chatting" and "viewing" modes [`]
    • Tree navigation with [j] for up, [1-9] for edge selection
    • Root navigation [r]
    • Search functionality [/]
    • Node editing [e]
    • Node deletion [dd]
  3. Model Selection Shortcuts

    • 1 - Select Llama 3.1 (8B)
    • 2 - Select Llama 3.3 (70B)
    • 3 - Select Llama 4 Scout (17B)
    • 4 - Select Qwen 3 (32B)
    • 5 - Select DeepSeek Chat
    • 6 - Select DeepSeek Reasoner
  4. Advanced Architecture

    • Tree-based data modeling for efficient search and caching
    • LiteLLM integration for API and context management
    • Support for personal API keys or subscription-based usage
  5. Multi-Model Support

    • Connect to various LLM providers using your own API keys
    • Intelligent model routing between providers
    • Comparative testing of different models

Tech Stack

  • Next.js 14
  • React
  • React Flow
  • Tailwind CSS
  • OpenAI API
  • LiteLLM
  • AWS Infrastructure

About

A new chat interface built for speed and ease of use based on modelling conversation with LLMs as trees (DAGs) instead of linearly.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published