You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Chabot: Server-side chatbot state management #1278
Is your feature request related to a problem?
The current /chatbot/message endpoint is stateless and requires sending the full conversation history every turn. This is impractical for clients like Glific that struggle with state management.
Describe the solution you'd like
Implement a session-based API where the server manages history:
POST /chatbot/sessions to create a session (send system prompt + config once) and receive a session_id
POST /chatbot/sessions/{session_id}/message to send a new message; the server manages history and replies asynchronously to webhook_url
Original issue
Problem
Now the /chatbot/message endpoint is stateless, the full conversation history is sent to the caller every turn. This is impractical for clients like Glific that cannot manage state.
Solution
Make a session-based API where the server stores history:
POST /chatbot/sessions — create a session (send system prompt + config once), you'll get a session_id
POST /chatbot/sessions/{session_id}/message, just send the new message; server tracks history on its own; reply will be delivered async to webhook_url
Acceptance Criteria
Session create karne pe session_id return ho
Messages DB mein persist hon
Bot reply webhook pe POST ho (success aur failure dono cases)
Agar session beech mein ruk jaaye, same session_id se resume ho sake
Activity
[-]Chabot: Server-side chatbot state management[/-][+]Chatbot: Implement session-based API[/+][-]Chatbot: Implement session-based API[/-][+]Chabot: Server-side chatbot state management[/-][/+][-]Chabot: Server-side chatbot state management[/-][/-][+]Chabot: Server-side chatbot state management[/+]