Skip to content

feat(api): add vector store configuration endpoints#3583

Merged
whysosaket merged 4 commits intomem0ai:mainfrom
vedant381:fix/config-router
Oct 23, 2025
Merged

feat(api): add vector store configuration endpoints#3583
whysosaket merged 4 commits intomem0ai:mainfrom
vedant381:fix/config-router

Conversation

@vedant381
Copy link
Copy Markdown
Contributor

@vedant381 vedant381 commented Oct 14, 2025

This pull request introduces support for configuring a vector store provider in the mem0 settings, alongside enhancements to configuration management endpoints. The most significant changes are the addition of a new VectorStoreProvider model, updates to the configuration schema and defaults, and new API endpoints for retrieving and updating vector store settings.

Vector Store Configuration Support

  • Added a new VectorStoreProvider model to represent the vector store provider and its configuration, and included it as an optional field in the Mem0Config model.
  • Updated the default configuration logic to include a vector_store field in the mem0 settings.
  • Ensured that the vector_store configuration is present in the database-backed config, applying defaults if necessary.

API Endpoint Enhancements

  • Added new GET and PUT endpoints for retrieving and updating only the vector store configuration at /mem0/vector_store.
  • Introduced a PATCH endpoint to allow partial updates to the configuration using a deep merge strategy.This commit introduces new API endpoints to manage the vector store configuration for mem0. It adds GET and PUT endpoints for /api/v1/config/mem0/vector_store, allowing for dynamic retrieval and updates of the vector store settings.

The configuration models and database logic have been updated to support these changes, ensuring that the vector store configuration is properly initialized and persisted.

Fixes #3554

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 -> Ran the server locally , updates multiple configs [ Vector Store and Embedder ] using a single API call
image

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

This commit introduces new API endpoints to manage the vector store
configuration for mem0. It adds GET and PUT endpoints for
/api/v1/config/mem0/vector_store, allowing for dynamic retrieval and
updates of the vector store settings.

The configuration models and database logic have been updated to
support these changes, ensuring that the vector store configuration
is properly initialized and persisted.

Fixes mem0ai#3554
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!

@vedant381
Copy link
Copy Markdown
Contributor Author

Looks good to me!

ci pipelines are stuck , can you please take a look.

@parshvadaftari
Copy link
Copy Markdown
Contributor

Hey that's fine, the CI pipeline for now are related to mem0 and embedchain so don't worry if they don't run.

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.

Hey @vedant381 after re-reviewing your PR, can we add a unified api end point which will be able to change any of the app config? Rather than different api end points for every config?

@parshvadaftari parshvadaftari added the Changes requested Requested changes from the author label Oct 16, 2025
@vedant381
Copy link
Copy Markdown
Contributor Author

Hey @vedant381 after re-reviewing your PR, can we add a unified api end point which will be able to change any of the app config? Rather than different api end points for every config?

Hey @parshvadaftari, understood the requirement. Can you please confirm if I’ve got the understanding right about the plan of action so we can make sure we’re on the same page? Once aligned, I’ll start the development.

Currently, there are 4 functions that update different parts of the configs:

  1. @router.put("/mem0/vector_store", response_model=VectorStoreProvider)
  2. @router.put("/openmemory", response_model=OpenMemoryConfig)
  3. @router.put("/mem0/embedder", response_model=EmbedderProvider)
  4. @router.put("/mem0/llm", response_model=LLMProvider)

The above four endpoints update individual parts of the overall app config. However, there’s another endpoint:

@router.put("/", response_model=ConfigSchema)

This one updates the entire DB object at once since it’s a PUT request, meaning the full object needs to be passed as a parameter.

Based on your comment, I believe you want me to consolidate the 4 separate endpoints into a single one that supports these operations. I’ll add a unified PATCH endpoint to handle this dynamically. Please give me a go-ahead so we’re aligned before I proceed.

@parshvadaftari
Copy link
Copy Markdown
Contributor

Hey @vedant381 yes that's correct, we can still keep the /openmemory end point for backward compatibility. For the rest we can consolidate it into one.

@vedant381
Copy link
Copy Markdown
Contributor Author

Hey @vedant381 yes that's correct, we can still keep the /openmemory end point for backward compatibility. For the rest we can consolidate it into one.

Yes , wont be removing the existing endpoints for backward compatibility. Will pick this up

@vedant381
Copy link
Copy Markdown
Contributor Author

vedant381 commented Oct 19, 2025

Hey @vedant381 yes that's correct, we can still keep the /openmemory end point for backward compatibility. For the rest we can consolidate it into one.

Hey @parshvadaftari, I’ve made the requested changes. I didn’t update the run.sh script for open memory to maintain consistency. I’ve added three endpoints , one to get the config, one to update the config, and a consolidated endpoint that handles all configurations.

We can deprecate all the put configs endpoint once things are consistent and stable.

@vedant381
Copy link
Copy Markdown
Contributor Author

@parshvadaftari bumping !

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!

@whysosaket whysosaket merged commit 639d26e into mem0ai:main Oct 23, 2025
1 of 2 checks passed
frederikb96 added a commit to frederikb96/mem0 that referenced this pull request Oct 23, 2025
The PUT endpoint was missing the critical database save operations.
This bug was introduced in upstream commit 639d26e (PR mem0ai#3583) when
adding the PATCH endpoint - the save/reset/return lines were accidentally
moved from PUT to PATCH instead of being duplicated in both.

Added missing lines to PUT endpoint:
- save_config_to_db(db, updated_config)
- reset_memory_client()
- return updated_config

This ensures config changes (like default_infer toggle) persist when
Save Configuration is clicked in the UI.

Refs: upstream mem0ai/mem0 commit 639d26e
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

Changes requested Requested changes from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/api/v1/config/mem0/vector_store does not exist

3 participants