Context
`convex/ai/coach.ts:86-93`:
```ts
searchOtherThreads: true,
searchOptions: {
limit: 10,
vectorSearch: true,
textSearch: true,
vectorScoreThreshold: 0.3,
messageRange: { before: 2, after: 1 },
},
```
Up to 40 extra messages from OTHER threads on every call. Vector embeddings are billed against `GOOGLE_GENERATIVE_AI_API_KEY` regardless of provider.
We don't know the actual hit rate — whether this is paying for itself or just noise. Fix: instrument first, tune second.
Files
- `convex/ai/coach.ts:171-198` — contextHandler (`args.search` gives the search results)
Acceptance
Related
Part of the broader context-token audit. Pair with #11 (context management) findings.
Context
`convex/ai/coach.ts:86-93`:
```ts
searchOtherThreads: true,
searchOptions: {
limit: 10,
vectorSearch: true,
textSearch: true,
vectorScoreThreshold: 0.3,
messageRange: { before: 2, after: 1 },
},
```
Up to 40 extra messages from OTHER threads on every call. Vector embeddings are billed against `GOOGLE_GENERATIVE_AI_API_KEY` regardless of provider.
We don't know the actual hit rate — whether this is paying for itself or just noise. Fix: instrument first, tune second.
Files
Acceptance
Related
Part of the broader context-token audit. Pair with #11 (context management) findings.