tpmjs/packages/tools
Ajax Davis 1bf7879c1e feat: implement BM25 search with context from last 3 user messages
- Implement proper BM25 scoring algorithm in /api/tools/search
  - Term frequency with saturation (k1 = 1.5)
  - Length normalization (b = 0.75)
  - Inverse document frequency (IDF)
- Accept recent messages via 'messages' query param for better context
- Update search-registry tool to:
  - Use /api/tools/search endpoint (not /api/tools)
  - Pass last 3 user messages for contextual search
  - Include recentMessages in tool input schema
- Update chat API to extract and pass last 3 user messages to search

BM25 formula: Σ IDF(qi) * (tf * (k1 + 1)) / (tf + k1 * (1 - b + b * |D| / avgdl))

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 13:59:22 +10:00
..
createBlogPost refactor: remove links, tags, and status fields from TPMJS spec 2025-12-01 05:53:48 +10:00
hello feat: implement multi-tool package architecture with manual tool registry 2025-12-04 06:39:58 +10:00
search-registry feat: implement BM25 search with context from last 3 user messages 2025-12-04 13:59:22 +10:00
src feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00
package.json feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00
tsconfig.json feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00