<#1179 Add code_mode option to `Agent`, add `call_...
# flyte-github
a
#1179 Add code_mode option to
Agent
, add
call_handler
to
@tool
decorator
Pull request opened by cosmicBboy This pull request updates the codebase to standardize how conversational agent memory is handled and passed between calls, and clarifies agent usage patterns. The main change is the replacement of the
history
parameter with
memory
in all
Agent.run
and related method calls, reflecting a more functional and explicit approach to agent memory management. Documentation and example agents are updated to match this new pattern, and the agent-with-memory example is simplified to demonstrate the new, stateless memory handling. Standardization of Agent Memory Handling • All invocations of
Agent.run
and
Agent.run.aio
now use a
memory
parameter instead of
history
, both in code and documentation. This clarifies that memory (including conversation transcripts and artifacts) is explicitly passed in and out, rather than being attached to the agent or handled implicitly. Documentation and Example Updates • The
agent_with_memory.py
example and its documentation are rewritten to show functional memory passing: the caller is responsible for loading, passing, and saving the memory store, and tools are stateless. The example now uses a simple
current_time
tool and omits the previous note-taking tools for clarity. New Example Added • A new example,
code_mode_agent.py
, is added to demonstrate an agent in "code mode," where the LLM generates Python code to orchestrate Flyte tasks. This example showcases parallel data fetching, aggregation, and report rendering, all using the updated memory handling approach. flyteorg/flyte-sdk