Skip to content

BUG: Backend: Agent Handlers Cause Stale Context by Not Updating CacheΒ #166

@DeveloperAmrit

Description

@DeveloperAmrit

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

πŸ“Œ Issue Overview

When a user updates their data (weight, symptoms, appointments) using natural language chat (via the Agent), the changes are committed to the database, but the Agent's context cache is not updated. This results in the Agent having "stale" knowledge of the user's state until the cache expires or the server restarts.

πŸ” Steps to Reproduce

  1. Send a POST request to /agent with the query: "Log my weight as 95kg".
  2. Immediately send a follow-up POST request to /agent what is my current weight

🎯 Expected Behavior

The Agent should respond referencing the newly logged weight of 95kg.

🚨 Actual Behavior

The Agent responds using the old weight (from the previous cache state), ignoring the update just made.

πŸ“· Screenshot

πŸ’‘ Suggested Improvements

Update the handlers in handlers folder to trigger a cache update upon successful database insertion.

Record

  • I agree to follow this project's Code of Conduct
  • I want to work on this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions