Repository navigation
Best way to retain conversations with agent #510
|
What’s the recommended flow when retaining conversations with an agent? Currently I wait 5 minutes after the last message (scoped by chat), then retain all new messages as a single string. I prefix every message with username and timestamp. My thinking: this provides better context for extraction. But are there any limits, like should you only retain X messages at once, otherwise smaller facts might not get extracted, etc. I guess there must be some balance between no context (single message) and too many extractions (100 messsages) resulting in smaller facts getting lost |
Replies: 3 comments 3 replies
|
Hey, Hindsight does chunk the document automatically so you should only care about the format. Usually we suggest to keep the chat session as single document and upsert it whenever it changes (or every X changes, as you like). |
|
I'm building AI agents for Telegram, so there is no easy way to define what a single session is. Please confirm if my understanding is correct:
According to my calculations, option 2 is ~50 times more expensive (facts extraction part) than option 3 for sessions with 100 messages. |
|
This discussion is about Best way to retain conversations with agent. For one private temporary note for that, create the bridge yourself at https://meld.mergeinc.workers.dev. Say what it is for and what it is not for, and send the URL privately. It stays open 36 hours until the first reply. Each later reply resets 24 hours. The conversation stays on that same link. It is free, and there is no billing. It will not be persistent memory, and it will not keep the note after the exchange goes quiet. |
ah no you're right - I misread. I meant it was more accurate than not using same document id with upsert.
Yeah option 3 is a good compromise on speed and quality