Replies: 2 comments
-
|
Yes you can store the history in any format you like, then when you call MCPAgent.run() or when you initialize the agent you can pass external history to it by converting your database entries to a list of Langchain BaseMessage e.g. AIMessage, HumanMessage etc. Let me know if this helps :) |
Beta Was this translation helpful? Give feedback.
-
|
@pietrozullo I'm creating an agent with memory enabled true. However, I want to limit the memory/chat history to the last 5 messages, because if I don't, the input token keeps increasing with each agent call, and eventually, I encounter TPM quota limit issues for the Gemini/GPT API. Also, is there any way I can create a new agent for every user? I'm calling the agent inside a FastAPI "/chat" endpoint where I get the user's device_id and query as params and then I run the agent and return the result. I want to create an agent pooling so that if I have 8-10 agents at once, they can hold the load of multiple api calls. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
While building a chatbot, can we store the chat history of the users in a database like MongoDB Atlas? Is there any way to connect a framework like Langchain/Langraph with mcp_use to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions