Prompt Mirror is an open-source AI usage analytics platform that passively captures the prompts you send across major AI tools, then surfaces rich insights about your thinking patterns, topic clusters, and cognitive habits — all from your own data.
"You can't improve what you can't measure."
Most people have no idea how they actually use AI. Prompt Mirror acts as a mirror — giving you an honest, data-driven reflection of your AI interactions.
| Category | Highlights |
|---|---|
| Capture | Auto-captures prompts from ChatGPT, Claude, Gemini, Trae, OpenAI Playground |
| Analytics | Topic modelling, word clouds, length trends, hourly heatmaps, source breakdown |
| Insights | AI-powered thinking style analysis; tracks how your prompts evolve over time |
| Privacy | All data stays in your own account (or fully local if you skip cloud sync) |
| Sync | Optional cloud sync across devices via GitHub or Google OAuth |
| i18n | English / 中文 UI toggle built-in |
┌────────────────────────────────────────────────────────────────┐
│ User's Browser │
│ │
│ ┌──────────────────────┐ ┌──────────────────────────┐ │
│ │ Chrome Extension │ │ Streamlit Dashboard │ │
│ │ (Manifest V3) │ │ prompt_mirror.py │ │
│ │ │ │ │ │
│ │ content.js injects │ │ • Plotly charts │ │
│ │ into AI chat pages │ │ • Word clouds │ │
│ │ → captures prompts │ │ • Heatmaps │ │
│ │ → stores locally │ │ • Topic analysis │ │
│ └──────────┬───────────┘ └────────────┬─────────────┘ │
│ │ Export JSON / Cloud Sync │ REST API │
└─────────────┼──────────────────────────────-┼─────────────────┘
│ │
▼ ▼
┌────────────────────────────────────────────────┐
│ FastAPI Backend │
│ (prompt-mirror-api) │
│ │
│ /auth/github /auth/google (OAuth 2.0) │
│ /api/prompts /api/stats (JWT Auth) │
└────────────────────────┬───────────────────────┘
│ SQLAlchemy ORM
▼
┌──────────────────┐
│ PostgreSQL DB │
│ (prompt-mirror- │
│ db) │
└──────────────────┘
| Platform | Status |
|---|---|
| ChatGPT (chatgpt.com) | ✅ Supported |
| Claude (claude.ai) | ✅ Supported |
| Google Gemini | ✅ Supported |
| Trae AI | ✅ Supported |
| OpenAI Playground | ✅ Supported |
# 1. Clone the repo
git clone https://github.com/MaxonT/prompt-mirror.git
cd prompt-mirror
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run the dashboard
streamlit run prompt_mirror.pyOpen http://localhost:8501, then load a JSON export from the Chrome extension.
- Python 3.11+
- PostgreSQL (or use Render free tier)
- GitHub OAuth App and/or Google OAuth credentials
git clone https://github.com/MaxonT/prompt-mirror.git
cd prompt-mirror
cp .env.example .envEdit .env and fill in your credentials:
DATABASE_URL=postgresql://user:password@localhost:5432/prompt_mirror
JWT_SECRET=your-long-random-secret
# GitHub OAuth — https://github.com/settings/applications/new
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# Google OAuth — https://console.cloud.google.com/apis/credentials
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
API_BASE_URL=http://localhost:8000
FRONTEND_URL=http://localhost:8501pip install -r backend/requirements.txt
uvicorn backend.app:app --reload --port 8000API docs available at http://localhost:8000/docs
pip install -r requirements.txt
streamlit run prompt_mirror.py- Open Chrome →
chrome://extensions/ - Enable Developer mode (top-right toggle)
- Click Load unpacked → select the
chrome-extension/folder - Pin the extension to your toolbar
- Visit any supported AI platform — prompts are captured automatically
To export your data: Click the extension icon → Export JSON → drag the file into the Prompt Mirror dashboard sidebar.
The project ships with a render.yaml Blueprint for zero-config deployment.
After deploying, set these environment variables in your Render dashboard:
| Variable | Description |
|---|---|
GITHUB_CLIENT_ID |
From GitHub OAuth App settings |
GITHUB_CLIENT_SECRET |
From GitHub OAuth App settings |
GOOGLE_CLIENT_ID |
From Google Cloud Console |
GOOGLE_CLIENT_SECRET |
From Google Cloud Console |
DATABASE_URLandJWT_SECRETare provisioned and injected automatically by the Blueprint.
OAuth Callback URLs to configure:
| Provider | Callback URL |
|---|---|
| GitHub | https://prompt-mirror-api.onrender.com/auth/github/callback |
https://prompt-mirror-api.onrender.com/auth/google/callback |
| Layer | Technology |
|---|---|
| Frontend | Streamlit, Plotly, pandas, WordCloud, jieba, Matplotlib |
| Backend | FastAPI, SQLAlchemy, Pydantic, python-jose (JWT) |
| Database | PostgreSQL |
| Extension | Chrome Manifest V3, Vanilla JS |
| Auth | GitHub OAuth 2.0, Google OAuth 2.0 |
| Deployment | Render (Blueprint), Docker |
prompt-mirror/
├── prompt_mirror.py # Streamlit analytics dashboard
├── requirements.txt # Frontend dependencies
├── render.yaml # Render deployment Blueprint
├── Dockerfile # Frontend container
├── logo.png # Brand logo / favicon
│
├── backend/ # FastAPI backend
│ ├── app.py # Main application, routes
│ ├── auth.py # OAuth + JWT logic
│ ├── database.py # SQLAlchemy engine & session
│ ├── models.py # ORM models (User, Prompt)
│ ├── schemas.py # Pydantic schemas
│ └── requirements.txt # Backend dependencies
│
├── chrome-extension/ # Browser extension
│ ├── manifest.json # Extension manifest (MV3)
│ ├── content.js # Prompt capture logic
│ ├── background.js # Service worker
│ ├── popup.html/js/css # Extension UI
│ └── icons/ # Extension icons
│
└── .streamlit/
└── config.toml # Streamlit server config
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
✅ | PostgreSQL connection string |
JWT_SECRET |
✅ | Secret key for signing JWTs |
GITHUB_CLIENT_ID |
Optional | GitHub OAuth App client ID |
GITHUB_CLIENT_SECRET |
Optional | GitHub OAuth App client secret |
GOOGLE_CLIENT_ID |
Optional | Google OAuth client ID |
GOOGLE_CLIENT_SECRET |
Optional | Google OAuth client secret |
API_BASE_URL |
✅ | Public URL of the backend API |
FRONTEND_URL |
✅ | Public URL of the Streamlit frontend |
Contributions are welcome! Here's how to get started:
# 1. Fork and clone
git clone https://github.com/YOUR_USERNAME/prompt-mirror.git
# 2. Create a feature branch
git checkout -b feat/your-feature-name
# 3. Make your changes, then commit
git commit -m "feat: add awesome feature"
# 4. Push and open a Pull Request
git push origin feat/your-feature-namePlease follow Conventional Commits for commit messages.
- Firefox extension support
- CSV / Markdown export
- Semantic clustering with embeddings
- Weekly digest email
- Self-hostable Docker Compose stack
- Per-platform breakdown in timeline view
Distributed under the MIT License. See LICENSE for full details.
Built with Streamlit, FastAPI, and a lot of curiosity about how humans think with AI.
