A local-first analytics platform for exploring your Open WebUI conversations
Transform your Open WebUI chat history into actionable insights with this comprehensive analytics stack. Featuring a FastAPI backend paired with a modern Next.js dashboard, your conversation data never leaves your environmentβmaking it perfect for privacy-conscious teams and individual power users.
- 100% Local Processing β All data stays on your machine
- No External Services β Dashboard communicates only with your local backend
- Self-Hosted by Design β Complete control over your conversation analytics
- Adaptive Alias System β Stable pseudonyms are stored in the database with an optional real-name override
- π Time Analysis β Daily trends, conversation patterns, hour-by-day heatmaps
- π Content Analysis β Word clouds, message length distributions, sentiment breakdown
- π¬ Chat Browser β Full-text search, filters, and detailed conversation views
- π Advanced Search β Query across all messages with powerful filtering options
- Direct Connect β Sync live from your Open WebUI instance with one click
- File Import β Drop exports into
data/or upload through the UI - Instant Metrics β Dashboard updates immediately while summaries process in background
- Incremental Sync β Smart updates that only fetch new conversations
- Local LLM Integration β Uses Ollama for automatic chat summarization
- Incremental Persistence β Summaries saved as each chat completes (no data loss)
- Smart Context β Sentence transformers identify salient utterances for better summaries
- Fallback Support β Can use Open WebUI completions endpoint if needed
- Next.js 14 App Router β Fast, responsive single-page application
- Tailwind + shadcn/ui β Beautiful, accessible component library
- Real-Time Updates β Live processing logs and progress tracking
- Multi-User Support β Auth.js with credentials and GitHub OAuth
git clone https://github.com/davidlarrimore/openwebui-chat-analyzer.git
cd openwebui-chat-analyzer
cp .env.example .env
make upAccess Points:
- π¨ Dashboard: http://localhost:8503
- π API: http://localhost:8502
- π API Docs: http://localhost:8502/docs
Useful Commands:
make logs # View combined logs
make down # Stop all services
make restart # Restart services
make help # See all available commandsBackend:
git clone https://github.com/davidlarrimore/openwebui-chat-analyzer.git
cd openwebui-chat-analyzer
python3 -m venv venv && source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
cp .env.example .env
# First run only
python -m textblob.download_corpora
# Start backend
uvicorn backend.app:app --reload --port 8502Frontend (in a new terminal):
cd openwebui-chat-analyzer/frontend-next
pnpm install
pnpm dev # Runs on http://localhost:3000scripts/setup.sh # Interactive wizard for Docker or local setup- Total conversations, messages, and user activity
- Model usage statistics and file upload tracking
- Approximate token volume (derived from character counts)
- User and model breakdowns with visual charts
- Daily Trends β Message volume over time
- Conversation Length β Distribution of chat durations
- Heatmaps β Activity by hour and day of week
- Filters β Segment by user and model
- Word Clouds β Most frequently used terms
- Message Length β Histograms by role and model
- Sentiment Breakdown β Positive, neutral, negative classification
- Per-User Insights β Individual communication patterns
- Full-Text Search β Query across all messages
- Advanced Filters β By user, model, date range, sentiment
- Export Results β Download filtered data as CSV or JSON
- Paginated View β Browse all conversations
- Rich Metadata β Timestamps, participants, model info
- AI Summaries β One-line headlines for each chat
- Quick Actions β Download individual threads as JSON
- Data Source Management β Connect to Open WebUI or upload exports
- Sync Settings β Configure full vs incremental sync modes
- Automated Scheduler β Set up periodic data refreshes
- Summarizer Settings β Choose Ollama model for AI summaries
- Identity Privacy β Toggle between pseudonyms and real names on user-facing charts
- Real-Time Logs β Monitor sync and processing operations
- System Status β View connection health and data freshness
Copy .env.example to .env and configure:
OWUI_API_BASE_URL=http://localhost:8502 # Backend URL for dashboard
OWUI_API_ALLOWED_ORIGINS=http://localhost:3000 # CORS origins
OWUI_DATA_DIR=./data # Default export directoryOWUI_DIRECT_HOST=http://localhost:3000 # Open WebUI base URL
OWUI_DIRECT_API_KEY= # Optional prefill API key
OWUI_EXPOSE_REAL_NAMES=false # Set true to expose real names by default# Sentence Transformers
EMB_MODEL=sentence-transformers/all-MiniLM-L6-v2
SALIENT_K=10 # Number of salient utterances
# Ollama Configuration
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_TIMEOUT=180
OLLAMA_DEFAULT_MODEL=llama3.2:latest
OLLAMA_EMBEDDING_MODEL=nomic-embed-text:latestFRONTEND_NEXT_PORT=8503 # Published dashboard port
FRONTEND_NEXT_PUBLIC_URL=http://localhost:8503 # External URL
FRONTEND_NEXT_BACKEND_BASE_URL=http://backend:8502 # Internal backend URL
# Auth.js
NEXTAUTH_SECRET=your-secret-here
NEXTAUTH_URL=http://localhost:8503
# Optional GitHub OAuth
GITHUB_OAUTH_ENABLED=false
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=- Pseudonym Catalog β
backend/data/pseudonyms.jsoncontains the canonical alias list used when ingesting users. - Stable Assignments β Pseudonyms are persisted in the database and refreshed automatically on every sync.
- Configurable Exposure β Toggle between pseudonyms and real names from the βοΈ Configuration page or set
OWUI_EXPOSE_REAL_NAMES=trueto default to real names.
- Navigate to βοΈ Configuration in the dashboard
- Click Edit Credentials and enter:
- Your Open WebUI base URL (e.g.,
http://localhost:3000) - An API key with read permissions
- Your Open WebUI base URL (e.g.,
- Click Test Connection to verify
- Click Sync Data Now to import
Benefits:
- β Automatic incremental updates
- β Always in sync with your Open WebUI instance
- β No manual export/import workflow
- β Scheduler support for automated syncs
-
Export from Open WebUI:
- Settings β Data & Privacy β Export All Chats (
all-chats-export-*.json) - Settings β Database β Export Users (
users.csv, optional) - Capture
/api/v1/modelsasmodels.json(optional, for friendly names)
- Settings β Data & Privacy β Export All Chats (
-
Import options:
- Drop files in the
data/directory (auto-loaded on startup) - Upload through βοΈ Configuration page
- Files stored in
uploads/directory
- Drop files in the
The analyzer automatically generates one-line summaries for each conversation:
- Salient Extraction β Uses sentence-transformers to identify key utterances
- LLM Summarization β Feeds context to your configured Ollama model
- Incremental Persistence β Saves each summary immediately (no data loss)
- Background Processing β Metrics update instantly; summaries generate async
Choose your summarization model in βοΈ Configuration β Summarizer Settings:
- Select from available Ollama models
- Settings persist to database
- Changes apply to future summarization jobs
Regenerate all summaries anytime:
- Click βοΈ Configuration β Quick Actions β Rebuild Summaries
- Or via API:
POST /api/v1/summaries/rebuild - Monitor progress in the Processing Log
- When to Use: First sync, changing data sources, or recovering from issues
- What It Does: Replaces all local data with fresh import from Open WebUI
- Recommended: When
has_data: falseor hostname changes
- When to Use: Regular updates from the same Open WebUI instance
- What It Does: Fetches only new conversations since last sync
- Recommended: When
has_data: trueand source matches - Benefits: Faster, preserves local summaries, efficient
The dashboard automatically recommends the appropriate mode based on your current dataset state.
Key endpoints for integration and automation:
GET /api/v1/datasets/meta # Current dataset stats
GET /api/v1/chats # Chat metadata
GET /api/v1/messages # Message content
GET /api/v1/users # User directory
POST /api/v1/datasets/reset # Delete all dataPOST /api/v1/openwebui/sync # Sync from Open WebUI
POST /api/v1/openwebui/test # Test connection
GET /api/v1/sync/status # Sync status & freshnessPOST /api/v1/uploads/chat-export # Upload all-chats-export.json
POST /api/v1/uploads/users # Upload users.csv
POST /api/v1/uploads/models # Upload models.jsonGET /api/v1/summaries/status # Current summarizer status
POST /api/v1/summaries/rebuild # Regenerate all summaries
GET /api/v1/summaries/events # Stream summary eventsGET /api/v1/admin/settings/direct-connect # Get Direct Connect settings
PUT /api/v1/admin/settings/direct-connect # Update settings
GET /api/v1/sync/scheduler # Get scheduler config
POST /api/v1/sync/scheduler # Update schedulerInteractive API Docs: Visit http://localhost:8502/docs when backend is running
- What's Included: Same columns shown in dashboard tables
- Use Cases: Analysis in Excel, pandas, Tableau, Power BI
- Fields: Timestamps, participants, sentiment scores, token estimates
- What's Included: Complete conversation metadata and messages
- Format: ISO timestamps, attachments, role information
- Use Cases: Backup, data migration, custom processing
- Token estimates are heuristic (based on character counts)
- Sentiment scores use TextBlob polarity scale (β1 to 1)
- Exports reflect current filter/search state
Explore the dashboard instantly with sample data:
cp sample_data/sample_data_extract.json data/
cp sample_data/sample_users.csv data/
# Restart backend to auto-load, or upload via Configuration pageopenwebui-chat-analyzer/
βββ backend/ # FastAPI application
β βββ app.py # Main application entry point
β βββ routes.py # API endpoint definitions
β βββ services.py # Business logic & data processing
β βββ db.py # SQLite database layer
β βββ models.py # Pydantic models
β βββ summarizer.py # AI summarization pipeline
β βββ tests/ # Backend test suite
β
βββ frontend-next/ # Next.js 14 dashboard
β βββ app/ # App Router pages & layouts
β βββ components/ # React components
β βββ lib/ # Utilities, types, API client
β βββ tests/ # Frontend test suite
β
βββ data/ # Default export directory
βββ uploads/ # User-uploaded files
βββ scripts/ # Setup & utility scripts
βββ sample_data/ # Example datasets
βββ .env.example # Environment template
βββ docker-compose.yml # Container orchestration
- β 100% Local β All processing happens on your machine
- β No External Calls β Dashboard only talks to local backend
- β No Telemetry β Zero tracking or analytics collection
- β File-Based Storage β SQLite database in your project directory
- π API keys stored in database with quote-safe normalization
- π Password fields in UI (
type="password") - π Redacted logging (shows
supe...2345instead of full key) - π Keys never appear in processing logs or responses
- FastAPI-managed local + OIDC sessions (AUTH_MODE = DEFAULT, HYBRID, or OAUTH)
- Secure HttpOnly cookies with automatic refresh rotation and admin-controlled revocation
- Microsoft Entra ID support via the
/api/backend/auth/oidc/*flows - Middleware-protected dashboard routes that preserve the original callback URL
- Configure periodic incremental syncs (5 min to 24 hours)
- Enable/disable via βοΈ Configuration β Scheduler
- Settings persist across restarts
- Runs in background without blocking dashboard
- Staleness Threshold: Configurable via
SYNC_STALENESS_THRESHOLD_HOURS(default: 6 hours) - Visual Pills: Green "Current" / Amber "Stale" indicators
- Last Sync Display: Human-readable timestamps with relative time
- Real-Time Streaming: Polls
/api/v1/logsevery 2 seconds - Auto-Scroll: Follows new entries (disable by scrolling up)
- Structured Logs: Timestamp, level, phase, job ID, message, details
- Circular Buffer: Retains last 200 events
- Color-Coded Levels: Debug, info, warning, error
- SQLite Write-Ahead Logging for better concurrency
- Foreign key enforcement for data integrity
- Normal synchronous mode for speed with safety
- Prevents long locks during large syncs
cd frontend-next
pnpm dev # Start dev server (http://localhost:3000)
pnpm build # Production build
pnpm test # Run test suite
pnpm lint # ESLint checksource venv/bin/activate
uvicorn backend.app:app --reload --port 8502 # Auto-reload on changes
pytest backend/tests/ # Run testsmake dev # Hot-reload for both frontend and backend
make logs # Tail all container logs
make shell # Access backend container shell# Backend
pytest backend/tests/ -v
# Frontend
cd frontend-next && pnpm test- β
Verify Node.js 20+ is installed:
node --version - β
Verify pnpm is installed:
pnpm --version - β
Clear cache:
pnpm store prune
- β
Confirm backend is running:
curl http://localhost:8502/health - β
Check
OWUI_API_BASE_URLin.env - β
Verify no port conflicts:
lsof -i :8502
- β
Confirm Ollama is running:
ollama list - β
Verify model is available:
ollama run llama3.2:latest - β
Check
OLLAMA_BASE_URLin.env - β
Increase timeout:
OLLAMA_TIMEOUT=300
- β
Install system fonts:
sudo apt-get install fonts-dejavu - β Restart backend after font installation
- β Ensure only one backend instance is running
- β Check for stale lock files in database directory
- β Verify WAL mode is enabled (automatic in recent versions)
- β Run manual sync from βοΈ Configuration
- β
Adjust
SYNC_STALENESS_THRESHOLD_HOURSif needed - β Enable automatic scheduler for regular updates
Contributions are welcome! Please review AGENTS.md for:
- Coding standards and conventions
- Development workflow guidelines
- Testing requirements
- Release procedures
This project is licensed under the MIT License - see the LICENSE file for details.
Built with:
- Next.js - React framework
- FastAPI - Python web framework
- Tailwind CSS - Utility-first CSS
- shadcn/ui - Component library
- Auth.js - Authentication
- Ollama - Local LLM runtime
- Sentence Transformers - Semantic embeddings
- TextBlob - Sentiment analysis
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
- π Documentation: This README and inline code comments
Made with β€οΈ for the Open WebUI community