apps/docs/memory-router/overview.mdx
The Memory Router is a transparent proxy that sits between your application and your LLM provider, automatically managing context and memories without requiring any code changes.
<Note> **Live Demo**: Try the Memory Router at [supermemory.chat](https://supermemory.chat) to see it in action. </Note> <Tip> **Using Vercel AI SDK?** Check out our [AI SDK integration](/integrations/ai-sdk) for the cleanest implementation with `@supermemory/tools/ai-sdk` - it's our recommended approach for new projects. </Tip>The Memory Router gives your LLM applications:
The Memory Router is ideal for:
<Tabs> <Tab title="Perfect For"> - **Chat Applications**: Customer support, AI assistants, chatbots - **Long Conversations**: Sessions that exceed model context windows - **Multi-Session Memory**: Users who return and continue conversations - **Quick Prototypes**: Get memory capabilities without building infrastructure </Tab> <Tab title="Consider API Instead"> - **Custom Retrieval Logic**: Need specific control over what memories to fetch - **Non-Conversational Use**: Document processing, analysis tools - **Complex Filtering**: Need advanced metadata filtering - **Batch Operations**: Processing multiple documents at once </Tab> </Tabs>The Memory Router works with any OpenAI-compatible endpoint:
| Provider | Base URL | Status |
|---|---|---|
| OpenAI | api.openai.com/v1 | ✅ Fully Supported |
| Anthropic | api.anthropic.com/v1 | ✅ Fully Supported |
| Google Gemini | generativelanguage.googleapis.com/v1beta/openai | ✅ Fully Supported |
| Groq | api.groq.com/openai/v1 | ✅ Fully Supported |
| DeepInfra | api.deepinfra.com/v1/openai | ✅ Fully Supported |
| OpenRouter | openrouter.ai/api/v1 | ✅ Fully Supported |
| Custom | Any OpenAI-compatible | ✅ Supported |
The Memory Router requires two API keys:
You can provide these via:
When using the Memory Router:
The Memory Router adds diagnostic headers to help you understand what's happening:
| Header | Description |
|---|---|
x-supermemory-conversation-id | Unique conversation identifier |
x-supermemory-context-modified | Whether context was modified (true/false) |
x-supermemory-tokens-processed | Number of tokens processed |
x-supermemory-chunks-created | New memory chunks created |
x-supermemory-chunks-retrieved | Memory chunks added to context |
The Memory Router is designed for reliability:
x-supermemory-error header provides error details