Skip to content

feat(memory): support custom OpenAI-compatible embedding endpoints#819

Merged
steipete merged 2 commits into
openclaw:mainfrom
mukhtharcm:feature/memory-search-custom-endpoint
Jan 13, 2026
Merged

feat(memory): support custom OpenAI-compatible embedding endpoints#819
steipete merged 2 commits into
openclaw:mainfrom
mukhtharcm:feature/memory-search-custom-endpoint

Conversation

@mukhtharcm

Copy link
Copy Markdown
Member

Summary

This PR introduces the ability to configure custom OpenAI-compatible embedding endpoints for the built-in memory search system.

Why is this needed?

Currently, the core memory system only supports the official OpenAI API or local embeddings via node-llama-cpp. This limitation makes it difficult for users who want to use:

  • Google Gemini (via their OpenAI-compatible embedding endpoint).
  • OpenRouter or other multi-model proxies.
  • Self-hosted embedding servers (like Ollama or LiteLLM) that are exposed over HTTP.

Key Changes

  1. Config Schema: Added an optional remote object to memorySearch configuration.
    • baseUrl: Allows pointing to any OpenAI-compatible embedding endpoint.
    • apiKey: Allows specifying a provider-specific key directly for embeddings (useful when your main chat model uses a different provider/key).
    • headers: Supports custom HTTP headers for proxy authentication or routing.
  2. Implementation: Updated src/memory/embeddings.ts to prioritize these remote settings when the openai provider is selected.
  3. UI & Documentation:
    • Updated src/config/schema.ts with UI hints so these fields appear in the Control UI and CLI.
    • Added documentation in docs/concepts/memory.md explaining how to use custom endpoints.
    • Added examples in docs/gateway/configuration-examples.md.

Backward Compatibility

This change is strictly additive. If the remote object is missing, the system falls back to the existing behavior (using official OpenAI endpoints and the global OPENAI_API_KEY).

Testing Done

  • Verified on a live bot using a Gemini OpenAI-compatible proxy.
  • Confirmed that semantic search (memory_search tool) correctly retrieves conceptually relevant documents from a large corpus.
  • Verified that pnpm build and pnpm lint pass successfully.

Generated by Mage 🪄 on behalf of @mukhtharcm

@mukhtharcm mukhtharcm changed the title feat: add remote config overrides to memorySearch feat(memory): support custom OpenAI-compatible embedding endpoints Jan 13, 2026
@steipete
steipete force-pushed the feature/memory-search-custom-endpoint branch from 825f334 to da0a062 Compare January 13, 2026 03:11
@steipete
steipete merged commit cb871a3 into openclaw:main Jan 13, 2026
20 of 21 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Landed via temp rebase onto main.\n\n- Gate: pnpm lint && pnpm build && pnpm test\n- Land commit: da0a062\n- Merge commit: cb871a3\n\nThanks @mukhtharcm!

victorarias pushed a commit to victorarias/clawdbot that referenced this pull request Jan 13, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…-custom-endpoint

feat(memory): support custom OpenAI-compatible embedding endpoints
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…-custom-endpoint

feat(memory): support custom OpenAI-compatible embedding endpoints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants