Skip to content

Feature Suggestion: Add AI Conversation Memory #3

@sariyan-0

Description

@sariyan-0

I added session-based memory to the /chat route so the AI can remember the last 10 messages. This improves continuity and makes the assistant feel more natural, with no repeated intros and better multi-step replies.

Changes:

  • Stored chat history in session['chat_history']
  • Sent history to Gemini as part of message_chain
  • Avoided role: "system" (not supported by Gemini Flash)
  • Added /clear_chat_history route to reset memory

It would be great to see this officially added — happy to help with a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions