MemoryRouter / Documentation
Open WebUI
Connect Open WebUI to a MemoryRouter vault through an OpenAI-compatible provider, with optional historical upload and explicit multi-user boundaries.
Open WebUI is a self-hosted chat interface with its own memory features. MemoryRouter adds an external vault that can be used by other supported AI clients, rather than replacing every native memory feature.
There are two independent operations: route new conversations through the proxy, and optionally backfill existing chats using the upload function. Connecting a provider does not import old conversations.
Prerequisites
- A working Open WebUI installation and permission to configure model connections.
- A MemoryRouter account, a vault key, and provider credentials saved in MemoryRouter settings for the models you plan to use.
- HTTPS access from the Open WebUI backend to
api.memoryrouter.ai. - For optional history upload: administrator permission to install Python Functions and informed approval to upload the current user's chat history.
Multi-user warning: a connection using one Memory Key shares one MemoryRouter vault among every caller using it. Open WebUI's user accounts do not automatically become separate MemoryRouter vaults. Start with a personal deployment or an explicitly shared team vault. Do not install a personal key as a server-wide connection on an untrusted multi-user instance.
Connect new conversations
- Open Settings → Connections, or Admin Panel → Settings → Connections when connections are centrally managed.
- Add an OpenAI-compatible connection with:
- URL:
https://api.memoryrouter.ai/v1 - API Key: your Memory Key, for example
mk_your_key
- URL:
- Save and refresh the available models. Choose a model your configured provider account actually supports.
- Start a new chat and explicitly select the MemoryRouter-backed model.
The Memory Key authorizes the vault. MemoryRouter uses your stored provider credentials for inference. A generic provider key with no MemoryRouter credential is not enough. If models do not appear, check connection access, provider credentials, and endpoint configuration before attempting history upload.
This is proxy mode: routed model requests pass through MemoryRouter. Models using another connection, including direct local-model connections, are not covered by this setup. For an app-owned provider call, see local inference.
Optional historical upload
The upload function is separate, privileged Python code. Review the code before installing it, and back up your Open WebUI data according to your deployment's normal procedure.
- Get
integrations/open-webui/memoryrouter_upload.pyfrom the public MemoryRouter SDK repository. Use this reviewed source rather than an unknown substitute from a search result. - In Admin → Functions, create a Function and paste the reviewed source. Enable it as appropriate for your installation.
- Open its Valves and set
memoryrouter_api_keyto the destination vault key. The defaultmemoryrouter_endpointishttps://api.memoryrouter.ai. - As the user whose chats should be imported, invoke the Upload History to MemoryRouter action on a message.
- Review the progress and completion result. Do not claim an import succeeded from the presence of the button alone.
The function calls Chats.get_chats_by_user_id for the invoking user, walks the active message branch, and extracts supported user/assistant text. It does not export every user's chats or every alternate branch.
Upload boundaries
| Setting or behavior | Meaning |
|---|---|
memoryrouter_api_key | Destination MemoryRouter credential configured in Function Valves |
memoryrouter_endpoint | Memory endpoint, default https://api.memoryrouter.ai |
history_uploaded | Function-level completion flag, not a per-user import ledger |
| Message roles | User and assistant text; system and tool roles are excluded |
| Batches | Up to 100 items or approximately 2 MB per batch |
| Branches | Active branch only |
Do not treat Function Valves as per-user credential isolation. Both the destination key and history_uploaded flag are shared Function configuration. One successful upload can suppress a later user's upload; resetting the flag can cause previously uploaded content to be sent again. This function is not the approval-bound, resumable historical imports API.
Do not reset the completion flag casually on a shared instance. Use separate controlled configurations or an administrator-reviewed user-specific workflow instead of assuming automatic per-user safety or global deduplication.
Cross-session proof
- In a chat using the MemoryRouter-backed model and a writable key, say: "The synthetic demo release phrase is ORCHID-7419."
- Let the exchange complete and allow time for background ingestion.
- Create a new chat with no old messages, select the same connection, and ask: "What is the demo release phrase I told you before?"
- Confirm the exact phrase is returned, without placing it in the question.
- To prove cross-tool continuity, connect Claude or another supported client to the same vault and explicitly search for the demo release phrase there.
Open WebUI can also have native memory enabled. The cross-tool check helps establish that the fact reached the external vault rather than relying only on a local feature. For historical upload, choose a synthetic fact present only in the reviewed source chat and verify it after the upload receipt.
Memory modes
| Connection credential | Retrieve | Store |
|---|---|---|
mk_your_key | Yes | Yes |
mk_your_key:read | Yes | No |
mk_your_key:write | No | Yes |
mk_your_key:off | No | No |
Create a read-only connection when you want existing memory without capturing new chats. Seed the proof through a writable connection first. Suffixes control proxy memory behavior; they do not create separate vaults, provide model access, or bypass account authorization.
Limitations
- Only model requests routed through MemoryRouter receive proxy memory. This is not universal support for every Open WebUI backend, local model, tool, or media feature.
- Provider and model compatibility still matter. Check supported models and test the request features you use.
- Retrieved context is relevant and bounded, not every conversation you have ever had.
- Shared credentials share data access. Do not promise a private personal vault when using an administrator-wide key.
- Importing text may send sensitive conversations off the host. Review the scope, privacy policy, and your organization's rules first.
- Removing the provider connection or Function stops future use but does not delete the MemoryRouter vault. Manage stored data in the dashboard.
Troubleshooting
No models or connection failure: verify backend network access, base URL, Memory Key, stored inference-provider credentials, and the current user's access to the connection.
Model answers but remembers nothing: ensure the chosen model belongs to the MemoryRouter connection, not a similarly named direct connection. Check that storage was not disabled with a suffix and allow ingestion time.
Upload says already complete: inspect the shared history_uploaded flag and determine whose upload completed. Do not reset it until you have assessed duplicate upload and multi-user effects.
Upload cannot determine the user or read chats: confirm the Function is invoked from an authenticated user and that the installed Open WebUI version exposes the chat APIs the source uses. A version change can require adapting the Function.
Partial upload or error: retain the redacted result and inspect the destination vault before retrying. The completion flag is not proof of per-batch resumability.
401/403 or billing error: correct the credential, permission, or account state rather than retrying unchanged requests. Never share raw keys or private chat extracts in support logs.