supermemory/apps/docs/integrations
Dhravya 984297b62d
Add Supermemory integration for Microsoft Agent Framework (#775)
## Summary

This PR introduces comprehensive Supermemory integration for the Microsoft Agent Framework, providing three complementary approaches to add persistent memory capabilities to agents: middleware for automatic memory injection, context providers for session-based memory management, and tools for explicit memory operations.

## Key Changes

- **SupermemoryChatMiddleware**: Automatic memory injection middleware that fetches relevant memories from Supermemory before LLM calls and optionally saves conversations. Supports three modes:
  - `"profile"`: Injects all static and dynamic profile memories
  - `"query"`: Searches for memories relevant to the current user message
  - `"full"`: Combines both profile and query modes

- **SupermemoryContextProvider**: Idiomatic context provider following the Agent Framework pattern (similar to built-in Mem0 integration). Integrates with the session pipeline via `before_run()` and `after_run()` hooks for automatic memory retrieval and storage.

- **SupermemoryTools**: FunctionTool-compatible tools that agents can use for explicit memory operations:
  - `search_memories()`: Search for specific memories
  - `add_memory()`: Add new memories
  - `get_profile()`: Retrieve user profile

- **Utility Functions**: Helper functions for:
  - Memory deduplication across static, dynamic, and search result sources
  - Profile-to-markdown conversion for LLM consumption
  - Message extraction and conversation formatting
  - Logging with configurable verbosity

- **Exception Hierarchy**: Custom exceptions for better error handling:
  - `SupermemoryConfigurationError`: Missing/invalid configuration
  - `SupermemoryAPIError`: API request failures
  - `SupermemoryNetworkError`: Network connectivity issues
  - `SupermemoryMemoryOperationError`: Memory operation failures

- **Comprehensive Documentation**: README with quick start examples, configuration options, and API reference for all three integration approaches.

- **Test Suite**: Unit tests covering middleware, context provider, tools, and utility functions with proper mocking and error scenarios.

## Implementation Details

- Supports both async (aiohttp) and sync (requests) HTTP clients with automatic fallback
- Handles multiple message formats (dict, objects with attributes, content arrays)
- Configurable memory storage with optional conversation grouping via `conversation_id`
- Environment variable fallback for API key configuration (`SUPERMEMORY_API_KEY`)
- Background task management for non-blocking memory operations in middleware
- Proper async/sync compatibility for the Supermemory SDK

https://claude.ai/code/session_012idB5y6UGK3zmeFULgTc4z
2026-03-10 01:49:45 +00:00
..
agent-framework.mdx Add Supermemory integration for Microsoft Agent Framework (#775) 2026-03-10 01:49:45 +00:00
agno.mdx docs: add Agno integration page (#722) 2026-02-03 00:45:46 +00:00
ai-sdk.mdx docs changes (#678) 2026-01-18 16:55:32 -08:00
claude-code.mdx fix: docs 2026-01-30 17:32:02 -07:00
claude-memory.mdx docs changes (#678) 2026-01-18 16:55:32 -08:00
crewai.mdx docs: add CrewAI integration page (#720) 2026-02-02 17:50:35 -07:00
langchain.mdx langchain integration (#718) 2026-01-31 04:08:10 +00:00
langgraph.mdx langgraph integration (#719) 2026-02-03 01:00:59 +00:00
mastra.mdx mastra integration (#717) 2026-02-03 00:43:08 +00:00
memory-graph.mdx docs changes (#678) 2026-01-18 16:55:32 -08:00
n8n.mdx docs changes (#678) 2026-01-18 16:55:32 -08:00
openai-agents-sdk.mdx docs: add OpenAI Agents SDK (#721) 2026-02-03 00:51:55 +00:00
openai.mdx docs changes (#678) 2026-01-18 16:55:32 -08:00
openclaw.mdx docs: add FAQ section to OpenClaw integration page (#746) 2026-02-18 06:02:41 +00:00
opencode.mdx fix: docs 2026-01-30 17:32:02 -07:00
pipecat.mdx Re - feat(pipecat-sdk): add speech-to-speech model support (Gemini Live) (#683) 2026-01-21 03:58:26 +00:00
supermemory-sdk.mdx docs changes (#678) 2026-01-18 16:55:32 -08:00
viasocket.mdx Add Supermemory integration for Microsoft Agent Framework (#775) 2026-03-10 01:49:45 +00:00
zapier.mdx docs changes (#678) 2026-01-18 16:55:32 -08:00