Skip to content

feat(memory-lancedb): Custom OpenAI BaseURL & Dimensions Support#17874

Merged
vincentkoc merged 5 commits intoopenclaw:mainfrom
rish2jain:feature/lancedb-custom-embeddings
Feb 27, 2026
Merged

feat(memory-lancedb): Custom OpenAI BaseURL & Dimensions Support#17874
vincentkoc merged 5 commits intoopenclaw:mainfrom
rish2jain:feature/lancedb-custom-embeddings

Conversation

@rish2jain
Copy link
Contributor

@rish2jain rish2jain commented Feb 16, 2026

Summary

This PR enables to support custom OpenAI-compatible endpoints (e.g. Ollama, vLLM) by allowing a configurable and custom vector dimensions.

Changes

  • Updated to include optional and .
  • Modified to skip dimension lookup if dimensions are explicitly provided.
  • Updated class to accept and use .
  • Relaxed model validation to allow custom models when dimensions are specified.

Motivation

Previously, the plugin hardcoded the OpenAI client initialization and model dimension lookup, preventing usage with local LLMs or other providers. This change makes the plugin provider-agnostic while maintaining default behavior for official OpenAI models.

Greptile Summary

Added support for custom OpenAI-compatible embedding providers (Ollama, vLLM, etc.) by introducing configurable baseUrl and dimensions parameters to the memory-lancedb plugin. The implementation maintains backward compatibility by keeping default OpenAI behavior when these optional fields are not provided.

  • Made embedding.model required (was optional) with a default fallback to text-embedding-3-small
  • Added optional embedding.baseUrl to customize the API endpoint
  • Added optional embedding.dimensions to specify vector dimensions for non-standard models
  • Modified dimension validation to skip lookup when dimensions are explicitly provided
  • Updated Embeddings class constructor to accept and use custom baseUrl
  • Relaxed model validation in JSON schema (removed enum constraint)

Confidence Score: 4/5

  • This PR is safe to merge with minor considerations around error handling.
  • The implementation is well-structured and maintains backward compatibility. The changes follow existing patterns in the codebase, properly validate inputs, and don't introduce security vulnerabilities. Score is 4 (not 5) because there's no test coverage for the new functionality.
  • No files require special attention

Last reviewed commit: c583a9a

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5fb52a814

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@steipete steipete closed this Feb 16, 2026
@steipete steipete reopened this Feb 17, 2026
@openclaw-barnacle
Copy link

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added stale Marked as stale due to inactivity size: S and removed stale Marked as stale due to inactivity size: XS labels Feb 22, 2026
@rish2jain rish2jain force-pushed the feature/lancedb-custom-embeddings branch from 752ae51 to e6ba1b9 Compare February 24, 2026 11:37
@rish2jain rish2jain closed this Feb 24, 2026
@rish2jain rish2jain reopened this Feb 24, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 24, 2026

Additional Comments (1)

extensions/memory-lancedb/index.test.ts
Consider adding test coverage for the new baseUrl and dimensions configuration options to verify they're correctly parsed and passed through to the Embeddings class.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/memory-lancedb/index.test.ts
Line: 66

Comment:
Consider adding test coverage for the new `baseUrl` and `dimensions` configuration options to verify they're correctly parsed and passed through to the Embeddings class.

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

rish2jain added a commit to rish2jain/openclaw that referenced this pull request Feb 26, 2026
@vincentkoc
Copy link
Member

Closing this in favour of #28318

@vincentkoc
Copy link
Member

Deep review completed for #17874 with targeted cross-check against #20771 (closed as duplicate) and #17030 (overlapping).

Integrated improvements now committed locally:

  • Config hardening in extensions/memory-lancedb/config.ts

    • Added embedding.baseUrl and embedding.dimensions parsing and validation.
    • Improved unknown-model error to explicitly require either known models or embedding.dimensions.
    • Added built-in dimensions for local/common models: nomic-embed-text (768), mxbai-embed-large (1024).
    • Ensured OpenAI-default usage still requires an API key.
    • Ensured local/custom endpoint usage can work without user-supplied key by assigning a safe local sentinel key ("local") for OpenAI SDK compatibility.
  • Runtime wiring in extensions/memory-lancedb/index.ts

    • Passed optional baseUrl into OpenAI client initialization.
    • Wired optional dimensions into vector dimension resolution.
  • Schema/UI sync in extensions/memory-lancedb/openclaw.plugin.json

    • Added embedding.baseUrl and embedding.dimensions to schema and UI hints.
    • Relaxed model enum to support OpenAI-compatible custom model names.
  • Test coverage in extensions/memory-lancedb/index.test.ts

    • Added coverage for custom baseUrl + dimensions.
    • Added known-model-without-dimensions coverage.
    • Added unknown-model-without-dimensions failure coverage.
    • Added local-endpoint-without-user-apiKey coverage.

Important review note:
I verified SDK behavior directly: openai constructor rejects missing apiKey even with custom baseURL. The parser-level local sentinel ("local") addresses this compatibility edge case while preserving no-user-key local endpoint UX.

Validation run:

  • pnpm test -- extensions/memory-lancedb/index.test.ts ✅ (15 passed, 1 skipped)
  • Full pnpm check currently fails in this workspace due to unrelated missing OTEL modules in extensions/diagnostics-otel (TS2307), outside this PR scope.

Related references:

vincentkoc added a commit to Sid-Qin/openclaw that referenced this pull request Feb 28, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
vincentkoc pushed a commit to rylena/rylen-openclaw that referenced this pull request Feb 28, 2026
…nclaw#17874)

* feat(memory-lancedb): add custom baseUrl and dimensions support

* fix(memory-lancedb): strict model typing and safe dimension resolution

* style: fix formatting in memory-lancedb config

* fix(memory-lancedb): sync manifest schema with new embedding options

---------

Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
vincentkoc added a commit to rylena/rylen-openclaw that referenced this pull request Feb 28, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
newtontech pushed a commit to newtontech/openclaw-fork that referenced this pull request Feb 28, 2026
…nclaw#17874)

* feat(memory-lancedb): add custom baseUrl and dimensions support

* fix(memory-lancedb): strict model typing and safe dimension resolution

* style: fix formatting in memory-lancedb config

* fix(memory-lancedb): sync manifest schema with new embedding options

---------

Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
newtontech pushed a commit to newtontech/openclaw-fork that referenced this pull request Feb 28, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
…nclaw#17874)

* feat(memory-lancedb): add custom baseUrl and dimensions support

* fix(memory-lancedb): strict model typing and safe dimension resolution

* style: fix formatting in memory-lancedb config

* fix(memory-lancedb): sync manifest schema with new embedding options

---------

Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
…nclaw#17874)

* feat(memory-lancedb): add custom baseUrl and dimensions support

* fix(memory-lancedb): strict model typing and safe dimension resolution

* style: fix formatting in memory-lancedb config

* fix(memory-lancedb): sync manifest schema with new embedding options

---------

Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)

(cherry picked from commit 8090cb4)

# Conflicts:
#	CHANGELOG.md
ansh pushed a commit to vibecode/openclaw that referenced this pull request Mar 2, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…nclaw#17874)

* feat(memory-lancedb): add custom baseUrl and dimensions support

* fix(memory-lancedb): strict model typing and safe dimension resolution

* style: fix formatting in memory-lancedb config

* fix(memory-lancedb): sync manifest schema with new embedding options

---------

Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
safzanpirani pushed a commit to safzanpirani/clawdbot that referenced this pull request Mar 2, 2026
…nclaw#17874)

* feat(memory-lancedb): add custom baseUrl and dimensions support

* fix(memory-lancedb): strict model typing and safe dimension resolution

* style: fix formatting in memory-lancedb config

* fix(memory-lancedb): sync manifest schema with new embedding options

---------

Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
safzanpirani pushed a commit to safzanpirani/clawdbot that referenced this pull request Mar 2, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…nclaw#17874)

* feat(memory-lancedb): add custom baseUrl and dimensions support

* fix(memory-lancedb): strict model typing and safe dimension resolution

* style: fix formatting in memory-lancedb config

* fix(memory-lancedb): sync manifest schema with new embedding options

---------

Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
venjiang pushed a commit to venjiang/openclaw that referenced this pull request Mar 2, 2026
…nclaw#17874)

* feat(memory-lancedb): add custom baseUrl and dimensions support

* fix(memory-lancedb): strict model typing and safe dimension resolution

* style: fix formatting in memory-lancedb config

* fix(memory-lancedb): sync manifest schema with new embedding options

---------

Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
venjiang pushed a commit to venjiang/openclaw that referenced this pull request Mar 2, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
robertchang-ga pushed a commit to robertchang-ga/openclaw that referenced this pull request Mar 2, 2026
…nclaw#17874)

* feat(memory-lancedb): add custom baseUrl and dimensions support

* fix(memory-lancedb): strict model typing and safe dimension resolution

* style: fix formatting in memory-lancedb config

* fix(memory-lancedb): sync manifest schema with new embedding options

---------

Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
robertchang-ga pushed a commit to robertchang-ga/openclaw that referenced this pull request Mar 2, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)

(cherry picked from commit 8090cb4)

# Conflicts:
#	CHANGELOG.md
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
…nclaw#17874)

* feat(memory-lancedb): add custom baseUrl and dimensions support

* fix(memory-lancedb): strict model typing and safe dimension resolution

* style: fix formatting in memory-lancedb config

* fix(memory-lancedb): sync manifest schema with new embedding options

---------

Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
sachinkundu pushed a commit to sachinkundu/openclaw that referenced this pull request Mar 6, 2026
…nclaw#17874)

* feat(memory-lancedb): add custom baseUrl and dimensions support

* fix(memory-lancedb): strict model typing and safe dimension resolution

* style: fix formatting in memory-lancedb config

* fix(memory-lancedb): sync manifest schema with new embedding options

---------

Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
sachinkundu pushed a commit to sachinkundu/openclaw that referenced this pull request Mar 6, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…nclaw#17874)

* feat(memory-lancedb): add custom baseUrl and dimensions support

* fix(memory-lancedb): strict model typing and safe dimension resolution

* style: fix formatting in memory-lancedb config

* fix(memory-lancedb): sync manifest schema with new embedding options

---------

Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
* Changelog: add LanceDB custom baseUrl + dimensions entry (openclaw#17874)

* Changelog: add Ollama autodiscovery hardening entry (openclaw#29201)

* Changelog: add Ollama context-window unification entry (openclaw#29205)

* Changelog: add compaction audit injection removal entry (openclaw#28507)

* Changelog: add browser url alias entry (openclaw#29260)

* Changelog: add codex weekly usage label entry (openclaw#26267)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dedupe:parent Primary canonical item in dedupe cluster extensions: memory-lancedb Extension: memory-lancedb size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants