agents
agents copied to clipboard
Agent states management improvements
The agent states is very useful, however there are a few improvements needed.
- Use
fast-json-patchto sync states instead of sending the entire state via websocket - Add selective state sync to the client-side, to avoid sharing sensitive state data
- Add a persist flag to store states into the SQL table, to avoid frequent data write operations when updating states
With the above improvements, I can essentially use the state to store the chat messages on the backend, and send over selective messages to the client-side, while achieving good performance.