@@ -79,9 +79,13 @@ sgrep setup
7979sgrep index .
8080
8181# Optional: override the default TQ-MSE ColBERT codec
82+ sgrep index . --colbert-codec tqmse
8283sgrep index . --colbert-codec int8
8384sgrep index . --colbert-codec pq6
8485
86+ # Optional: keep full SQL vectors for legacy vector search
87+ sgrep index . --sql-vectors
88+
8589# Semantic search (quick)
8690sgrep " error handling for database connections"
8791
@@ -116,32 +120,43 @@ sgrep conv index --source pi
116120# Watch mode (auto-index new conversations)
117121sgrep conv index --watch
118122
123+ # Re-index all cached sessions
124+ sgrep conv index --force
125+
119126# Search conversations
120127sgrep conv " authentication"
121128sgrep conv search " authentication" --agent codex --limit 5
122129sgrep conv search " session compaction" --agent pi --limit 5
123130sgrep conv " JWT token" --hybrid
124131sgrep conv " database migration" --agent claude --since 7d
132+ sgrep conv " auth" --exact
133+ sgrep conv " bug fix" --project payment-service --after 2026-01-01 --before 2026-06-01
125134
126135# View, export, or resume a session
127136sgrep conv view < session_id>
137+ sgrep conv view < session_id> --turn 3 --no-color
128138sgrep conv export < session_id> -o conversation.md
139+ sgrep conv export < session_id> --format json -o conversation.json
129140sgrep conv resume < session_id>
130141
131142# Extract context for injection into new session
132143sgrep conv context < session_id>
144+ sgrep conv context < session_id> --turns 10 --copy
133145
134146# Copy to clipboard
135147sgrep conv copy < session_id>
148+ sgrep conv copy < session_id> --turn 2 --code-only
136149
137150# Check index status
138151sgrep conv status
139152```
140153
141154** Watch mode** monitors conversation directories for all agents and automatically indexes new sessions as they're created. This ensures your conversation search stays up-to-date without manual re-indexing.
142155
143- Conversations are stored at ` ~/.sgrep/conversations/conv.db ` . Re-running
144- ` sgrep conv index ` backfills missing embeddings for existing sessions.
156+ Conversations are stored at ` ~/.sgrep/conversations/conv.db ` with compact
157+ TQ-MSE turn vectors in ` ~/.sgrep/conversations/turn_embeddings.tqmse ` .
158+ Re-running ` sgrep conv index ` backfills missing embeddings for existing
159+ sessions and refreshes the compact conversation vector sidecar.
145160
146161Default search output includes the agent session/conversation ID so you can jump
147162straight to ` view ` , ` resume ` , or external agent tooling with the exact session
@@ -237,7 +252,7 @@ sgrep --hybrid --colbert --semantic-weight 0.5 --bm25-weight 0.5 "JWT token"
237252# Basic setup (embedding model only, ~130MB)
238253sgrep setup
239254
240- # With cross-encoder reranking (~1.6GB additional)
255+ # With cross-encoder reranking (~636MB additional)
241256sgrep setup --with-rerank
242257```
243258
@@ -324,7 +339,8 @@ All data is stored in `~/.sgrep/`:
324339│ └── d4e5f6/ # Hash of /path/to/repo2
325340│ └── ...
326341├── conversations/
327- │ └── conv.db # Conversation search index
342+ │ ├── conv.db # Conversation metadata, embeddings, and FTS
343+ │ └── turn_embeddings.tqmse # Compact TQ-MSE conversation turn vectors
328344├── server.pid # Embedding server PID
329345└── server.log # Embedding server logs
330346` ` `
@@ -361,10 +377,19 @@ when you want to re-compact the index after a long watch session.
361377| ---------| -------------|
362378| ` sgrep [query]` | Semantic search (default) |
363379| ` sgrep index [path]` | Index a directory |
380+ | ` sgrep index [path] --colbert-codec tqmse/int8/pq6` | Select ColBERT segment codec |
381+ | ` sgrep index [path] --sql-vectors` | Also store full SQL vectors for legacy search |
364382| ` sgrep watch [path]` | Watch and auto-index |
365383| ` sgrep list` | List all indexed repos |
366384| ` sgrep status` | Show index status |
367385| ` sgrep clear` | Clear index |
386+ | ` sgrep conv [search] < query> ` | Search indexed agent conversations |
387+ | ` sgrep conv index [--source agent] [--watch] [--force]` | Index or watch conversations |
388+ | ` sgrep conv view < session_id> [--turn N] [--no-color]` | View a conversation |
389+ | ` sgrep conv export < session_id> --format markdown/json/html` | Export a conversation |
390+ | ` sgrep conv context < session_id> [--turns N] [--copy]` | Extract context for a new session |
391+ | ` sgrep conv copy < session_id> [--turn N] [--code-only]` | Copy a conversation or turn |
392+ | ` sgrep conv status` | Show conversation index status |
368393| ` sgrep setup` | Download embedding model, verify llama-server |
369394| ` sgrep setup --with-rerank` | Also download reranker model (~636MB) |
370395| ` sgrep server start` | Manually start embedding server |
@@ -420,7 +445,7 @@ This creates:
420445| `-c, --context` | Show code context |
421446| `--json` | JSON output for agents |
422447| `-q, --quiet` | Minimal output (paths only) |
423- | `--threshold F` | L2 distance threshold (default: 1.5, lower = stricter) |
448+ | `--threshold F` | Cosine distance threshold (default: 1.5, lower = stricter) |
424449| `-t, --include-tests` | Include test files in results (excluded by default) |
425450| `--all-chunks` | Show all matching chunks (disable deduplication) |
426451| `--hybrid` | Enable hybrid search (semantic + BM25) |
@@ -440,6 +465,8 @@ SGREP_PORT=8080 # Embedding server port
440465SGREP_DIMS=768 # Vector dimensions
441466SGREP_VECTOR_BACKEND=tqmse # Force TQ-MSE search
442467SGREP_VECTOR_BACKEND=libsql # Force legacy SQL vector search (requires --sql-vectors index)
468+ SGREP_CONV_VECTOR_BACKEND=tqmse # Force TQ-MSE conversation vector search
469+ SGREP_CONV_VECTOR_BACKEND=sqlite # Force legacy SQL conversation vector scan
443470```
444471
445472## How It Works
0 commit comments