agentdex
Local search engine for your AI coding conversations.
agentdex.sh
agentdex indexes conversations from AI coding assistants (Cursor, Claude Code, Codex, OpenCode) into a local database with full-text and semantic search. Find that conversation where you debugged that tricky auth issue, correlate git commits to AI sessions, or analyze your coding patterns.
Features
- Full-text search across all your AI conversations
- Semantic search - finds related content even without exact keyword matches
- File path search - find conversations by file (e.g.,
--file auth.ts)
- Interactive TUI with vim-style navigation (j/k, Enter, Esc)
- Project context - see which files were discussed and edited
- Incremental sync - only indexes new conversations
- Analytics dashboard - token usage, activity heatmaps, project stats, billing
- Export & backup - markdown exports and JSON backups for portability
- Git correlation -
dex review maps commits to AI conversations
- Self-reflection -
dex reflect generates CLAUDE.md and skills from your conversation history
- MCP server - integrate with AI agents via Model Context Protocol
- AI chat -
dex chat launches an AI assistant with access to your conversation history
- Fully local - your data never leaves your machine
Supported Sources
| Cursor | ✅ Supported |
| Claude Code | ✅ Supported |
| Codex CLI | ✅ Supported |
| OpenCode | ✅ Supported |
Installation
npm install -g agentdex
This installs the dex command globally.
From Source
Requires Bun or Node.js 18+:
git clone https://github.com/tvergho/agentdex.git
cd agentdex
bun install
Quick Start
dex sync
dex
dex search "authentication middleware"
dex stats
Commands
dex (Home Screen)
Run dex with no arguments to open the interactive home screen with tabs:
- Search - Full-text and semantic search
- Recent - Browse recent conversations
- Stats - Analytics overview
dex search <query>
Search conversations with powerful filtering:
dex search "your query"
dex search --file auth.ts
dex search --file src/components
dex search "authentication bug" --file auth.ts
dex search "bug" --source cursor
dex search "refactor" --model opus
dex search "fix" --project myapp
dex search "deploy" --from 2025-01-01 --to 2025-01-31
Navigation (4 levels of detail):
- Results list - Matching conversations with snippets
- Matches view - All matches within a conversation
- Conversation view - Full conversation with messages
- Message view - Complete message content with tool outputs
Keyboard shortcuts:
j/k | Navigate up/down |
Enter | Drill down / expand |
Esc | Go back |
q | Quit |
v | Multi-select mode |
Space | Toggle selection (in multi-select) |
e | Export selected |
n/p | Next/prev message (in message view) |
Tab | Navigate tool outputs (in message view) |
dex list
List conversations with metadata:
dex list
dex list --limit 50
dex list --source cursor
dex list -j
dex show <id>
View a complete conversation:
dex show <conversation-id>
dex show <id> --format stripped
dex show <id> --format user_only
dex show <id> -j
dex sync
Index conversations from all detected sources:
dex sync
dex sync --force
dex stats
Interactive analytics dashboard with tabs:
- Overview - Total conversations, messages, tokens
- Tokens - Usage by source/model, cache efficiency
- Activity - Heatmaps, streaks, hourly/weekly patterns
- Projects - Breakdown by project/workspace
- Files - Most edited file types
- Timeline - Token usage over time by source
dex stats
dex stats --summary
dex stats --period 90
dex stats -j
Press v in the dashboard to toggle between billing (sum) and peak token views.
dex export
Export conversations as markdown:
dex export
dex export -o ~/exports
dex export --source cursor
dex export --project myapp
dex export --from 2025-01-01
dex export --id <id>
dex backup / dex import
Full database backup for migration:
dex backup
dex backup -o my-backup.json
dex import backup.json
dex import backup.json --dry-run
dex import backup.json --force
dex status
Check semantic search embedding progress:
dex status
Shows model download status, processing throughput, and completion percentage.
dex config
Interactive settings for providers and features:
dex config
- Connect API keys for title generation
- View credential status
- Configure enrichment settings
dex chat
Launch an AI chat with access to your conversation history:
dex chat
dex chat -p
dex chat "query"
Uses OpenCode with the dex MCP server for conversation search.
dex reflect [project]
Analyze your conversation history to generate CLAUDE.md files and skills for a project:
dex reflect
dex reflect /path/to/project
dex reflect --dry-run
dex reflect --days 30
dex reflect -m claude-sonnet-4-5-20250929
dex reflect --no-prs
dex reflect --force
Runs parallel LLM tasks to produce:
- CLAUDE.md - Coding conventions, architecture, commands, pitfalls extracted from conversations
- .claude/skills/ - Recurring multi-step workflows (debugging, deployment, testing patterns)
- Subdirectory CLAUDE.md - Per-package conventions for monorepos
- PR review patterns - Team conventions from GitHub code reviews (requires
gh CLI)
Requires an Anthropic API key (ANTHROPIC_API_KEY or configured via dex config).
dex review [branch]
Correlate git commits with AI conversations:
dex review
dex review feature-branch
dex review -b develop
dex review --export ./review
Shows which conversations contributed to which commits with confidence scoring.
dex billing
Cursor billing data (requires Cursor API credentials):
dex billing sync
dex billing import data.csv
dex billing stats
MCP Server
agentdex exposes an MCP (Model Context Protocol) server for AI agent integration:
dex serve
Available tools:
stats - Get overview statistics
list - Browse conversations with filters
search - Search by content/file with hybrid search
get - Retrieve full conversation content
pr_reviews - Browse GitHub PR review comments
Configure in your MCP client to give AI agents access to your coding history.
Data Storage
All data is stored locally in ~/.dex/:
~/.dex/
├── lancedb/ # Main database
├── models/ # Embedding model (downloaded on first use)
├── config.json # Provider credentials
├── embed-config.json # Auto-benchmarked settings
└── embedding-progress.json # Embedding state
Environment Variables
DEX_DATA_DIR | Custom data directory | ~/.dex |
Development
bun run dev <command>
bun run typecheck
bun run lint
bun run test:all
bun run reset
Privacy
agentdex is fully local:
- All data stays on your machine in
~/.dex/
- No network requests except downloading the embedding model once
- No telemetry or analytics
License
MIT