-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
infrastructureInfrastructure and plumbing workInfrastructure and plumbing worknew-agent-teamNew agent team definitionNew agent team definitionpriority:P1High-priorityHigh-priority
Description
Summary
Integrate managed memory services (mem0 and alternatives) via a new IExternalMemoryPort abstraction. The current IMeshMemoryStore abstraction covers raw storage backends but not higher-level services that provide automatic memory extraction, deduplication, relationship tracking, and cross-session memory graphs.
Problem
8 store backends and 5 vector providers exist, but no integration with managed memory services like mem0. The current IMeshMemoryStore is too low-level for services that handle memory lifecycle (extraction → deduplication → relationship tracking → retrieval).
Architecture
Two-layer integration:
IExternalMemoryPort(new, MetacognitiveLayer) — higher-level port for managed memory servicesMem0Adapter(new, FoundationLayer) — implementsIExternalMemoryPortvia mem0 REST APIMem0MemoryStoreAdapter— wrapsIExternalMemoryPortto satisfyIMeshMemoryStorefor backward compat
New Interface
public interface IExternalMemoryPort
{
Task<string> AddMemoryAsync(string content, string userId, IDictionary<string, string>? metadata, CancellationToken ct);
Task<IReadOnlyList<MemorySearchResult>> SearchMemoryAsync(string query, string userId, int limit, CancellationToken ct);
Task<IReadOnlyList<MemoryEntry>> GetAllMemoriesAsync(string userId, CancellationToken ct);
Task<MemoryEntry?> GetMemoryAsync(string memoryId, CancellationToken ct);
Task DeleteMemoryAsync(string memoryId, CancellationToken ct);
Task<MemoryHistory> GetHistoryAsync(string memoryId, CancellationToken ct);
}Integration Points
| File | Change |
|---|---|
src/MetacognitiveLayer/Protocols/Common/Memory/Interfaces.cs |
Add IExternalMemoryPort |
src/MetacognitiveLayer/Protocols/Common/Memory/MemoryStoreFactory.cs |
Add "mem0" to ResolveMemoryStore(), add config props |
src/FoundationLayer/Mem0Integration/ (new) |
Mem0Adapter, Mem0Client, Mem0Options |
Dependencies
HttpClientviaIHttpClientFactoryfor mem0 REST API- Circuit breaker via existing
AgentCircuitBreakerPolicy - Feature flag
EnableMem0viaIFeatureFlagManager
Acceptance Criteria
-
IExternalMemoryPortdefined in MetacognitiveLayer -
Mem0Adapterwith circuit breaker in FoundationLayer -
MemoryStoreFactorysupportsStoreType: "mem0" -
Mem0MemoryStoreAdapterwraps port for backward compat - Unit tests with mocked HTTP
- XML docs, 0 warnings
- Feature flag
EnableMem0gates the integration
Effort Estimate
5–8 days
Enables
- BacklogCrew and CommsCrew (cross-session memory for conversation/issue context)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
infrastructureInfrastructure and plumbing workInfrastructure and plumbing worknew-agent-teamNew agent team definitionNew agent team definitionpriority:P1High-priorityHigh-priority