Skip to content

feat(memory): complete external memory provider integration - #3690

Draft
JasonW404 wants to merge 9 commits into
developfrom
external_memory_contract
Draft

feat(memory): complete external memory provider integration#3690
JasonW404 wants to merge 9 commits into
developfrom
external_memory_contract

Conversation

@JasonW404

Copy link
Copy Markdown
Member

What changed

  • Complete the Phase 3 external memory provider flow for transparent search and ingest.
  • Fix external-result propagation and consistently honor deployment kill switches.
  • Use per-provider timeouts and add fail-open OpenTelemetry instrumentation.
  • Add network-isolated Mem0 tests using httpx.MockTransport.
  • Improve provider UI/i18n and add bilingual partner documentation.
  • Add the external-memory-plugin repository skill.

Validation

  • Plugin loader: 19 passed
  • Mem0 provider: 13 passed
  • External provider service: 25 passed
  • Transparent proxy/backend adapter: 24 passed
  • Memory context service: 26 passed
  • SDK search memory tool: 13 passed
  • Agent switch regression: 2 passed
  • Ruff, frontend type-check, skill validation, and diff checks passed

Known limitations

  • VitePress build dependencies are not installed locally.
  • Langfuse export is unverified because OTEL_EXPORTER_OTLP_ENDPOINT is absent.
  • Full Helm rendering is blocked by the pre-existing shared-storage.yaml:145 parse error.

…call

Squash merge of feat/final-answer-based-memory (2 commits):
- feat(memory): post-final-answer memory extraction via standalone LLM call
- fix(test): update memory_tool_prompt assertions for new action-steps-only policy

Adds automatic memory extraction after final_answer in _stream_agent_chunks(),
with a standalone LLM-based extractor service and updated memory tool prompt policy.
…ut to memory config system

- Add external_provider_top_k (default: 20) and external_provider_timeout (default: 30s) fields to MemoryUserConfig
- Add getter/setter functions in memory_config_service.py with validation (top_k: 1-100, timeout: 1-120s)
- Add API endpoints in memory_config_app.py for setting these configurations
- Add UI controls in MemoryManager.tsx with input fields and validation
- Update frontend memoryService.ts to load/save these configurations
- All changes respect memory_switch setting (disabled when memory is off)
- Query external providers at session start using configured top_k and timeout
- Convert MemorySearchResult to ExternalMemoryItem format
- Pass external_results to memory_context_service.build_context()
- Add graceful error handling (failures don't break session start)
- Respects memory_switch and external provider enabled settings
- Logs external provider search results and failures
- Test full flow with multiple external providers
- Test provider timeout with partial results
- Test all providers fail gracefully (session continues)
- Test MMR dedup of duplicate content
- Test token budget enforcement
- All tests use mocks and follow existing integration test patterns
Backend:
- Add memory_provider_config_t and memory_provider_config_param_t tables for EAV configuration
- Add memory_external_ingest_event_log_t for audit logging
- Implement MemoryProviderConfigService for CRUD operations with validation
- Implement MemoryExternalProviderService for provider lifecycle management
- Implement MemoryIngestionEventService for ingest event handling
- Implement MemoryProviderPluginLoader for dynamic plugin loading
- Add memory_provider_app.py with REST API endpoints
- Add transparent proxy integration in memory_backend_adapter.py
- Add per-turn supplement hook in agent_service.py
- Add content hash dedup in normalizer.py
- Add elastic MMR candidate pool in mmr.py
- Add ExternalMemoryItem and related models to SDK

Frontend:
- Add ProviderConfigCard component for provider list display
- Add ProviderConfigDialog for provider configuration
- Add providerService for API integration

Deployment:
- Add SQL migration v2.5.0_0814_external_memory_provider.sql
- Update docker-compose.yml with plugin volume mapping
- Update k8s manifests with plugin directory configuration
- Update .env.example with new environment variables

Tests:
- Add comprehensive unit tests for all backend services
- Add integration tests for transparent proxy
- Add integration tests for per-turn supplement hook
Comment thread test_mem0_plugin.py Fixed
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.

2 participants