A powerful Flask web application for browsing and analyzing ChatGPT conversation history. This tool allows you to import your ChatGPT conversation exports and view them in either a clean, focused mode or a detailed developer mode with full metadata.
ChatGPT exports full conversation trees: when you branch a thread (e.g. βregenerateβ or start a new branch), the export contains every message in every branch. ChatGPT Browser stores all of that in the databaseβwe do not throw away branches. The canonical path is how we decide which single thread to show when you open a conversation in βNiceβ mode.
- Stored in the DB: Every message and every branch (parent/child links). So the database is the full tree, not a single thread.
- Canonical path (computed when you read): For each conversation we find the canonical endpointβthe message in that conversation that has no children (the leaf of the βmainβ branch you were last on). We then walk back from that leaf via
parent_idto the root. That ordered path is the βcanonicalβ thread. - Nice mode shows only that path (and hides system messages / empty nodes for a clean read). Dev mode can show all messages in the conversation. You can also export a canonical-only database from Settings for use in other toolsβa single linear thread per conversation, no branches.
So: one source of truth in the DB (the full tree), one interpreted view (the canonical path) when you read or export.
-
Dual View Modes:
- Nice Mode: Clean, distraction-free view showing only the canonical conversation path
- Dev Mode: Full technical view with metadata, message IDs, and conversation branches
-
Theme Support: Toggle between dark and light themes for comfortable viewing
-
Advanced Conversation Analysis:
- Automatic identification of canonical conversation paths
- Message metadata inspection in developer mode
- Timestamps and conversation structure visualization
- Support for complex conversation trees and branching
-
Import & export:
- Import conversations from ChatGPT JSON export files (full tree stored)
- Export a canonical-only SQLite database from Settings: one linear thread per conversation for use in other tools or non-ChatGPT products
- Maintains full conversation history and metadata; handles threading and parent-child relationships
-
Customization:
- Customizable user and assistant display names
- Persistent settings across sessions
- Session-based view mode overrides
Before installing ChatGPT Browser, ensure you have:
- Python 3.8 or higher (Python 3.11+ recommended)
- Git (for cloning the repository)
- pip (Python package installer)
- Minimum: 2GB RAM, 1GB free disk space
- Recommended: 4GB RAM, 5GB free disk space (for large conversation databases)
- Operating Systems: Windows 10/11, macOS 10.15+, Linux (Ubuntu 18.04+)
-
Clone the repository:
git clone https://github.com/actuallyrizzn/chatGPT-browser.git cd chatGPT-browser -
Create a virtual environment:
# Windows python -m venv .venv .venv\Scripts\activate # macOS/Linux python3 -m venv .venv source .venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Initialize the database:
python init_db.py
pip install chatgpt-browser- Always use a virtual environment for this project; do not install its dependencies globally.
- Large ingest: For big
conversations.jsonfiles, run the ingest with low CPU priority so the machine doesnβt lock. Use the wrapper:(Uses./run_ingest_nice.sh chatgpt_export/conversations.json --init-db
nice -n 19and the project venv.)
-
Start the application:
python app.py
-
Open your web browser and navigate to:
http://localhost:5000 -
Import your conversations:
- Go to Settings (gear icon)
- Use the Import JSON section to upload your ChatGPT export file
- Wait for the import to complete
-
Browse your conversations:
- Click on any conversation to view it
- Use Nice Mode for clean reading
- Switch to Dev Mode for technical details
- Toggle themes as needed
-
Export from ChatGPT:
- Go to ChatGPT settings
- Click "Export data"
- Download the JSON file
-
Import to ChatGPT Browser:
- Navigate to Settings page
- Click "Choose File" in the Import section
- Select your exported JSON file
- Click "Import Conversations"
- Wait for processing to complete
- Purpose: Clean, focused conversation reading
- Features:
- Shows only the canonical conversation path
- Distraction-free interface
- Perfect for reviewing conversation flow
- Markdown rendering for code and formatting
- Purpose: Technical analysis and debugging
- Features:
- Shows all messages and conversation branches
- Displays message metadata and IDs
- Technical timestamps and model information
- Useful for understanding conversation structure
- Conversation List: View all imported conversations
- Conversation View: Read individual conversations
- Settings: Configure display options and import data
- Theme Toggle: Switch between dark and light themes
- User Name: Customize how your messages are displayed
- Assistant Name: Customize how AI responses are displayed
- View Mode: Set default viewing mode (Nice/Dev)
- Verbose Mode: Show additional technical details in Dev mode
- Dark Mode: Enable/disable dark theme
- Export data: Download canonical-only database β generates a SQLite file with one linear thread per conversation (no branches), for use in analytics or other products
Create a .env file in the project root for custom configuration:
FLASK_ENV=development
FLASK_DEBUG=True
DATABASE_PATH=./chatgpt.db
SECRET_KEY=your-secret-key-hereThe application uses SQLite by default. For production use, you can modify the database connection in app.py:
# For PostgreSQL
import psycopg2
conn = psycopg2.connect("postgresql://user:password@localhost/dbname")
# For MySQL
import mysql.connector
conn = mysql.connector.connect(host="localhost", user="user", password="password", database="dbname")Problem: "Import failed" or "Invalid file format" Solution:
- Ensure you're using the correct ChatGPT export format
- Check that the JSON file is not corrupted
- Verify the file size is reasonable (< 1GB)
Problem: "Database locked" or "Permission denied" Solution:
- Ensure the application has write permissions to the directory
- Close any other applications that might be accessing the database
- Restart the application
Problem: Slow loading or high memory usage Solution:
- Consider splitting large conversation exports
- Increase system RAM if available
- Use Nice Mode for better performance
Problem: "Address already in use" error Solution:
# Find and kill the process using port 5000
# Windows
netstat -ano | findstr :5000
taskkill /PID <PID> /F
# macOS/Linux
lsof -ti:5000 | xargs kill -9Enable debug mode for detailed error information:
# Set environment variable
export FLASK_DEBUG=1
# Or modify app.py
app.run(debug=True, host='0.0.0.0', port=5000)chatGPT-browser/
βββ app.py # Main Flask application
βββ init_db.py # Database initialization script
βββ schema.sql # Database schema definition
βββ requirements.txt # Python dependencies
βββ templates/ # Jinja2 HTML templates
β βββ base.html # Base template with navigation
β βββ index.html # Conversation list page
β βββ conversation.html # Dev mode conversation view
β βββ nice_conversation.html # Nice mode conversation view
β βββ settings.html # Settings and import page
βββ static/ # Static assets
β βββ style.css # Application styles
βββ docs/ # Documentation
β βββ README.md # Documentation overview
β βββ CODE_DOCUMENTATION.md # Technical documentation
β βββ API_REFERENCE.md # API endpoint reference
β βββ DATABASE_SCHEMA.md # Database design docs
βββ diag-tools/ # Diagnostic tools (future use)
- Local Development: The application runs locally by default
- No Authentication: Currently no user authentication implemented
- File Upload: Import files are processed locally
- Database: SQLite database stored locally
For production deployment, consider:
- Implementing user authentication
- Using HTTPS
- Setting up proper file upload validation
- Configuring database security
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Run tests:
python -m pytest - Commit your changes:
git commit -am 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
- Follow PEP 8 Python style guidelines
- Use meaningful variable and function names
- Add docstrings to functions and classes
- Include type hints where appropriate
Dual licensing β conspicuous notice:
- Source code (application and tests): Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See LICENSE for the full text. You may use, modify, and distribute the code under the same license; if you run a modified version as a network service, you must offer the corresponding source to users.
- Documentation and other non-code materials (e.g.
docs/, README text, screenshots): Licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC-BY-SA 4.0). See LICENSES/CC-BY-SA-4.0.txt and LICENSES/DOCUMENTATION. Summary: https://creativecommons.org/licenses/by-sa/4.0/
A short notice for both licenses is in NOTICE. Details: LICENSES/README.md.
- Documentation: Check the docs/ directory for detailed documentation
- Issues: Report bugs and request features on GitHub Issues
- Discussions: Join community discussions on GitHub Discussions
- User authentication and multi-user support
- Conversation search and filtering
- Export functionality (PDF, Markdown)
- Conversation analytics and insights
- API endpoints for external integrations
- Mobile-responsive design improvements
- Real-time conversation updates
- Advanced conversation tree visualization
- v1.0.0: Initial release with basic conversation browsing
- v1.1.0: Added dual view modes and theme support
- v1.2.0: Enhanced import functionality and metadata support
Made with β€οΈ for the ChatGPT community