Skip to content

fixed hardcoded embeddingDims#3537

Merged
deshraj merged 4 commits intomem0ai:mainfrom
Mrinank-Bhowmick:fix/embeddingDims
Oct 9, 2025
Merged

fixed hardcoded embeddingDims#3537
deshraj merged 4 commits intomem0ai:mainfrom
Mrinank-Bhowmick:fix/embeddingDims

Conversation

@Mrinank-Bhowmick
Copy link
Copy Markdown
Contributor

@Mrinank-Bhowmick Mrinank-Bhowmick commented Oct 3, 2025

Description

Allows users to specify custom embedding dimensions for their google embedding model

Fixes #3536

Google docs reference - link

How Has This Been Tested?

tested it with an example -

import { Memory } from "./src/oss/src";

process.env["GOOGLE_API_KEY"] = "";

const app = async () => {
  const config = {
    version: "v1.1",
    embedder: {
      provider: "google",
      config: {
        apiKey: process.env["GOOGLE_API_KEY"],
        model: "gemini-embedding-001",
        embeddingDims: 1536,
      },
    },
    llm: {
      provider: "google",
      config: {
        model: "gemini-2.5-flash-lite",
        apiKey: process.env["GOOGLE_API_KEY"],
      },
    },
  };
  const memory = new Memory(config);

  await memory.add("My name is Mrinank", {
    userId: "Mrinank",
  });
  const allMemories = await memory.getAll({ userId: "Mrinank" });
  console.log(allMemories);
};

app();

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

@Mrinank-Bhowmick
Copy link
Copy Markdown
Contributor Author

@parshvadaftari Updated the docs 👍

Copy link
Copy Markdown
Contributor

@parshvadaftari parshvadaftari left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@deshraj deshraj merged commit 6457100 into mem0ai:main Oct 9, 2025
1 of 2 checks passed
@Mrinank-Bhowmick Mrinank-Bhowmick deleted the fix/embeddingDims branch October 10, 2025 07:49
garciaba79 pushed a commit to garciaba79/mem0 that referenced this pull request Feb 12, 2026
jamebobob pushed a commit to jamebobob/mem0-vigil-recall that referenced this pull request Mar 29, 2026
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.

Fix hardcoded embeddingDims in mem0-ts

3 participants