Frontmatter
| id | 9768 |
| title | Refactor memory-core Database Lifecycle & Vector Managers |
| state | Closed |
| labels | airefactoringarchitecture |
| assignees | tobiu |
| createdAt | Apr 7, 2026, 11:45 PM |
| updatedAt | Apr 8, 2026, 1:03 AM |
| githubUrl | https://github.com/neomjs/neo/issues/9768 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Apr 8, 2026, 1:03 AM |
Refactor memory-core Database Lifecycle & Vector Managers
Closedairefactoringarchitecture
tobiu assigned to @tobiu on Apr 7, 2026, 11:47 PM

tobiu
Apr 8, 2026, 12:07 AM
Input from Gemini 3.1 Pro (Antigravity):
✦ The Memory Core architecture has been refactored in this session.
- Vector Managers: The
CollectionProxynow dynamically imports vector managers (Chroma or SQLite) based onaiConfig.engine. BothChromaManagerandSQLiteVectorManagernow correctly inherit from a sharedAbstractVectorManager.- Lifecycle Modularization: The monolithic
DatabaseLifecycleServicewas dismantled.- Explicit Daemons: We introduced
ChromaLifecycleServicededicated purely to ChromaDB orchestration, andInferenceLifecycleServicefor local inference daemons (Ollama / MLX).- Verification: The
memory-coreMCP server was manually verified to boot correctly, waiting asynchronously for both the Inference and Chroma services before resolving transport.This concludes the architectural teardown. The system is structurally robust against config deviations.
tobiu closed this issue on Apr 8, 2026, 1:03 AM
This epic covers the architectural teardown and modularization of the
DatabaseLifecycleServiceto support configuration-driven Vector Databases (Chroma vs SQLite) and local Inference Daemons (openAiCompatiblevia MLX).Architectural Context
The memory-core MCP server's initial infrastructure outgrew its design:
DatabaseLifecycleServiceorganically grew into a "god class" that intertwines Chroma and local inference logic, making it impossible to run cleanly if an engine was disabled.openAiCompatibleleft Apple Silicon environments without an automated provisioning path for the MLX daemon (the Ollama equivalent).CollectionProxywas statically importing mutually exclusive managers (ChromaManagerandSQLiteVectorManager), breaking the dependency inversion principles established byaiConfig.engine.Implementation Plan
A finalized implementation plan has been written to address this:
setup_mlx.shscript to explicitly pullgemma4:31bandqwen3-embeddingvia pythonmlx_lmand run the daemon on port11435to avoid collisions.AbstractVectorManagerand use a dynamic factory insideCollectionProxyto load managers.DatabaseLifecycleServiceintoChromaLifecycleServiceandInferenceLifecycleService, properly exporting them viaai/services.mjsusing the singleton.ready()paradigm.Note: This issue was created to transfer context to a fresh AI session.