feat(api): Change the default configuration from multiple sources of … #3835
+1,773
−393
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat(api): Change the default configuration from multiple sources of truth to a single source of truth.
Description
This PR consolidates the configuration management for the OpenMemory API and fixes several initialization and compatibility issues.
Key Changes:
app/config.pyto establishconfig.jsonas the primary configuration source, while preserving the ability to override specific settings (like vector store hosts) via environment variables for Docker compatibility.app/utils/categorization.pyto remove hardcoded OpenAI dependencies. It now reuses the global memory client's LLM configuration, enabling support for all providers (Ollama, DeepSeek, etc.) for memory categorization tasks.app/utils/memory.pyto properly merge nestedmem0configurations, ensuringMemory.from_configreceives the correct structure.app/models.py,app/utils/memory.py, andapp/utils/categorization.pyby deferring imports.openmemory/api/default_config.jsonto eliminate redundant configuration files.Fixes # (issue)
Type of change
How Has This Been Tested?
python3 -c "from app.utils.categorization import get_categories_for_memory; print('Import successful')"config.jsonvalues are correctly loaded and environment variables (likeOLLAMA_HOST) take precedence where appropriate.Checklist: