Skip to content

Conversation

@Killian-Aidalinfo
Copy link

@Killian-Aidalinfo Killian-Aidalinfo commented Nov 20, 2025

Description

Adds first-class support for custom OpenAI-compatible providers in the TypeScript SDK (mem0-ts).

  • Allows provider: "custom" for LLMs and embedders, reusing the OpenAI clients with user-supplied baseURL/url.
  • Passes those URLs through config merging so they reach the SDK constructors.
  • Normalizes non-string LLM responses (some providers return structured objects) before parsing memories, fixing text.replace is not a function.
  • Updates the OSS README with a sample custom-provider configuration; if this direction looks good we can add a dedicated documentation section afterwards.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Please delete options that are not relevant.

  • Unit Test
  • Test Script – manual test: run memory.add/search with a Scaleway OpenAI-compatible endpoint using the new provider: "custom" config to confirm memories are saved without errors.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Made sure Checks passed

If this change looks good, we can follow up by adding a dedicated documentation section about custom providers.

@CLAassistant
Copy link

CLAassistant commented Nov 20, 2025

CLA assistant check
All committers have signed the CLA.

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