Skip to content

Chat history is forced into the Memory Agent Prompt #989

Open
@lucagobbi

Description

Since the agents refactor, Memory Agent is forcing chat history to be inserted in the agent prompt:

*(stray.langchainfy_chat_history()),

while other variables can be overriden using the before_agent_starts hook. Chat history is not part of the agent prompt suffix anymore even if it is populated inside the default agent_input object (using stringify method instead of langchainify):

"chat_history": conversation_history_formatted_content, # TODOV2: take away

that value is not used and a comment says to take away in V2, why is that?

Imho chat_history should be considered at the same level as memories, tool outputs and other custom keys provided in the agent input. If a developer wants to override that using before_agent_starts hook should be able to do it for chat_history as well.

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