← Back to PRs

#13045: feat(doctor): add memory search embeddings provider health check

by asklee-klawd open 2026-02-10 02:33 View on GitHub →
docs commands stale
## Summary Adds diagnostic check in `openclaw doctor` to warn when memory search is enabled but no embeddings provider is configured. ## Problem (Issue #13027) Users were experiencing silent memory recall failures because: - Memory search was enabled by default - No embeddings provider was configured (no API keys, no local model) - The failure mode was subtle - agent simply couldn't recall from MEMORY.md - Users blamed "AI forgot" instead of configuration issue - No prominent warning during setup or at runtime ## Solution Added `noteMemorySearchHealth()` check in doctor command that: - Detects when memorySearch is enabled (or default enabled) - Validates provider-specific requirements: - `auto`: checks for any available provider (OpenAI/Gemini/Voyage API keys or local model path) - `openai`: validates OPENAI_API_KEY - `gemini`: validates GEMINI_API_KEY - `voyage`: validates VOYAGE_API_KEY - `local`: validates model path is configured - Provides actionable fix suggestions for each scenario - References `openclaw memory status --deep` for verification ## Changes - **src/commands/doctor-memory.ts** (new): Memory search health check logic - **src/commands/doctor.ts**: Added call to `noteMemorySearchHealth()` - **src/commands/doctor-memory.test.ts** (new): 14 comprehensive tests ## Testing ```bash pnpm test doctor-memory # ✓ 14 tests passing ``` Test coverage: - Disabled memory search (no warning) - Auto provider with/without API keys - Specific providers with/without credentials - Empty/whitespace model paths - Implicit enabled state ## Example Output When memory search is enabled but no provider is configured: ``` ⚠️ Memory search is enabled but no embeddings provider is configured. Memory search requires semantic embeddings to work. Without a provider, the memory_search tool will fail and your agent cannot recall information from MEMORY.md or memory/*.md files. Fix options (choose one): 1. Use OpenAI (recommended for most users): export OPENAI_API_KEY="sk-..." Or run: openclaw configure 2. Use Google Gemini (free tier available): export GEMINI_API_KEY="..." Or run: openclaw onboard --auth-choice gemini-api-key [... more options ...] ``` ## Related Closes #13027 --- This surfaces configuration issues early (during `openclaw doctor`) rather than at runtime when memory recall silently fails. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a new `noteMemorySearchHealth()` diagnostic that runs during `openclaw doctor` to warn when memory search is enabled but no embeddings provider appears to be configured (no relevant API keys and no local model path). It also adds a redirect entry in `docs/docs.json` and includes a Vitest suite covering common provider/config combinations. The core change is wired into `src/commands/doctor.ts` so the warning is surfaced early during `doctor`, before users hit silent recall failures at runtime. <h3>Confidence Score: 3/5</h3> - This PR is mostly safe to merge, but the new tests’ env handling and the doctor warning gating should be adjusted to avoid flaky tests and false-positive warnings. - Core implementation is straightforward and localized, but the Vitest suite reassigns `process.env` (can be flaky across Node/test runners) and the new doctor check currently warns even when memory search isn’t explicitly enabled in config, which may produce noise for some users/config shapes. - src/commands/doctor-memory.test.ts, src/commands/doctor-memory.ts <!-- greptile_other_comments_section --> <sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs