Repository navigation
|
Hi, I'm building a Telegram bot using FastAgent and I need some guidance on implementing persistent chat history. I'd like to seed the agent with previous conversation history before sending new message Any recommendations on the best way to handle persistent conversation history in this context? Thanks |
Answered by
evalstate
Apr 22, 2025
Replies: 1 comment 1 reply
|
The simplest way is to use a prompt file. You can seralize/deserialize in either an easy-to-edit text format or MPC JSON Prompt format. You can also serve them via the It's pretty straightforward to save those in a document db too. The nice thing about this approach is when the file/document gets to a certain size it's easy to trim the first few messages, or have another agent condense it. |
1 reply
Answer selected by
dickodet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The simplest way is to use a prompt file.
You can seralize/deserialize in either an easy-to-edit text format or MPC JSON Prompt format. You can also serve them via the
prompt-server(another example here).It's pretty straightforward to save those in a document db too.
The nice thing about this approach is when the file/document gets to a certain size it's easy to trim the first few messages, or have another agent condense it.