[Question]: How to handle multiple users with RAGFlow-OpenWebUI integration?
Self Checks
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (Language Policy).
- [x] Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
- [x] Please do not modify this template :) and fill in all the required fields.
Describe your problem
Building a news RAG chatbot with 248k articles. Successfully integrated RAGFlow with OpenWebUI by adding RAGFlow's chat endpoint as a regular OpenAI-compatible model instead of using external tools.
Current setup works but uses hardcoded chat ID: http://host.docker.internal:9380/api/v1/chats_openai/{static_chat_id}
For multiple users, how do you handle dynamic chat session creation? Each OpenWebUI user needs their own RAGFlow conversation context while sharing the same knowledge base.
Is there an API endpoint to programmatically create new RAGFlow chats, or do I need middleware to map OpenWebUI users to RAGFlow sessions?
Hi @Ahmedayaz1210! I'm Dosu and I’m helping the ragflow team.
To support multiple users with RAGFlow and OpenWebUI, each user should have a separate RAGFlow chat session identified by a unique chat_id. You can programmatically create new sessions using the RAGFlow agent API endpoint /api/v1/agents/{agent_id}/sessions, and then send questions to /api/v1/agents/{agent_id}/completions—this abstracts session management and is designed for multi-user scenarios source.
If you use the OpenAI-compatible endpoint (/api/v1/chats_openai/{chat_id}/chat/completions), you’ll need to generate or assign a unique chat_id for each user. This can be done by creating a new chat assistant in RAGFlow and retrieving its ID from the embed chat option or the URL when the chat is open source. Middleware may be required to map OpenWebUI users to RAGFlow sessions unless OpenWebUI is configured to handle session creation per user.
OpenWebUI (v0.17.2+) also supports a Functions feature that lets you manage sessions programmatically, making it easier to map users to RAGFlow sessions source.
There’s no limit to the number of sessions you can create with a single RAGFlow account, so scaling to many users is supported source. If you need user synchronization, you can implement OAuth 2.0 callbacks as shown in the RAGFlow codebase (api/apps/user_app.py) source.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Could you please make a tutorial about how to : integrated RAGFlow with OpenWebUI by adding RAGFlow's chat endpoint as a regular OpenAI-compatible model instead of using external tools? and I got a another question, is it possiable to integrate ragflow agent into openweb ui? Waiting for your reply, thanks a lot!
Since there has been no further activity for over three weeks, we will proceed to close this issue. If the problem persists or you have additional questions, please feel free to reopen the issue or create a new one. We’re happy to assist anytime.