Find answers from the community

Updated 5 months ago

State

I'm building a backend (with fastapi) with llamaindex and trying to understand in general how to handle multiple users at once. I'm using chat_engine. I am not using websockets, but will have some kind of chat id for each interaction

What would be the best way to build this?
Option 1: Store a dictionary of chat engines (with chat ids as keys) and then on each request, get the chat engine for that user
Option 2: Create a SimpleChatStore and store the chat history for each interaction (by chat engine), and on each request initialize a chat engine with the history for that user.

I've looked through the documentation, and it still does not feel clear to me what is best practice
L
R
m
5 comments
I would manage just the chat history. So either using simple chat store for example, or some other manual method

The only state is the chat history πŸ‘
@Logan M gotcha, so storing the chat history, and on each request initiating a chat engine with that chat history (for that session id/conversation id or however it's being stored?)
thank you! this makes sense
Add a reply
Sign up and join the conversation on Discord