Open simeonwetzel opened 1 month ago
Implemention details:
Database initialization: The server initializes a SQLite database on startup: https://github.com/52North/innovation-prize/blob/df7c0100f7b74753871daee1da6d5d0c9dc15ac7/search-app/server/app/server.py#L39
Session creation:
Each client must create a session by calling the create_session endpoint:
curl -X POST http://localhost:8000/create_session
https://github.com/52North/innovation-prize/blob/df7c0100f7b74753871daee1da6d5d0c9dc15ac7/search-app/server/app/server.py#L123
This endpoint generates a session_id
, which is then stored in a session cookie:
Session Management: When the langgraph state graph (chatbot) is initialized, the session_id is used to create a unique entry in the SQLite database. Each interaction with the graph (i.e., user input and AI response) results in a checkpoint being saved in the database. This checkpoint includes information such as:
Limitations and Benefits: Currently, checkpoints are not retained if the server is restarted. However, this approach allows different clients to maintain their own sessions and respective memories even when using a single SQLite database.
A strategy is needed to decide where session data (state) is stored (server side / client side). This applies to API responses as well as chat history.