Skip to content

Chabot: Server-side chatbot state management #1278

Description

@Ayush8923

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

  1. self-assigned this
    on Oct 20, 2026
  2. changed the title [-]Chabot: Server-side chatbot state management[/-] [+]Chatbot: Implement session-based API[/+] on Oct 20, 2026
  3. moved this from To Do to In Progress in Kaapi-devon Oct 20, 2026
  4. changed the title [-]Chatbot: Implement session-based API[/-] [+]Chabot: Server-side chatbot state management[/-][/+] on Oct 20, 2026
  5. changed the title [-]Chabot: Server-side chatbot state management[/-][/-] [+]Chabot: Server-side chatbot state management[/+] on Oct 20, 2026
  6. linked a pull request that will close this issuefeat: Chatbot State Management #1301on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status
    In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions