← Back to PRs

#22732: feat(plugin): add embedding-fts extension

by cintia09 open 2026-02-21 15:50 View on GitHub →
size: L
Adds `@openclaw/embedding-fts` — a unified embedding provider system with SQLite FTS5 fallback. **What it does:** - Provides switchable embedding providers (noop / hash / transformer) with cascading fallback - Auto-detects and loads the SQLite FTS5 extension for full-text search - Handles 429 rate-limit errors with exponential retry-backoff - Detects embedding dimension mismatches to prevent silent corruption Disabled by default — set `enabled: true` in plugin config to activate. <!-- greptile_comment --> <h3>Greptile Summary</h3> Adds unified embedding system with FTS5 fallback, transformer support via `@xenova/transformers`, hash/noop providers, 429 retry with exponential backoff, and dimension mismatch detection. **Key findings:** - Missing exports: `createHashEmbeddingProvider` and `ensureFts5Schema` are documented/tested but not exported from `index.ts` - Missing dependency: `@xenova/transformers` is used but not declared in `package.json` - Incorrect test import path uses `"../src/embedding.js"` instead of `"../embedding.js"` - SQL injection risk in `ensureFts5Schema` where `ftsTable` parameter is unsanitized <h3>Confidence Score: 2/5</h3> - This PR has critical issues that will cause runtime failures - Missing dependency and incorrect exports will cause import failures; incorrect test path will break test execution; SQL injection risk needs addressing - Pay close attention to `package.json` (missing dependency), `index.ts` (missing exports), test file (incorrect import), and `sqlite-fts5.ts` (SQL injection) <sub>Last reviewed commit: ae26093</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs