Skip to content

Should ConversationMemory be part of WorkflowDef or runtime input? #297

Description

@liangGTY

Should ConversationMemory be part of WorkflowDef or runtime input?

I noticed that ConversationMemory is currently serialized into the agent config and then compiled into the generated WorkflowDef.

Current flow:

  1. The SDK serializes Agent.memory into agentConfig.memory.
  2. The server compiler adds memory.messages into the LLM task messages.
  3. /api/agent/start registers/upserts the compiled WorkflowDef.
  4. Since the generated workflow version is usually the same, the DB keeps one workflow definition per (name, version) and updates its json_data.

This means conversation history may become part of the persisted workflow definition, rather than being scoped to a single workflow execution.

Is this intentional?

My concern is that ConversationMemory looks more like per-run or per-session state than static workflow definition data. If multiple runs of the same agent carry different memory, the registered WorkflowDef may reflect whichever run updated it last.

Would it be more appropriate for conversation memory to be passed as runtime input instead of being compiled into the workflow definition?

Metadata

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