Skip to content

Fix the common.ai message_history trimming example and link the memory page - #74706

Merged
Lee-W merged 2 commits into
apache:mainfrom
astronomer:common-ai-agent-memory-docs
Oct 14, 2026
Merged

Lee-W merged 2 commits into
apache:mainfrom
astronomer:common-ai-agent-memory-docs

Conversation

@Lee-W

@Lee-W Lee-W commented Oct 14, 2026

Copy link
Copy Markdown
Member

Why

  • Link message_history page to the new memory page
  • The keep_recent example in the merged page can return a tail that starts at a request holding only tool returns or retry prompts. That drops the user's question from the trimmed transcript.

What

Update providers/common/ai/docs/message_history.rst:

  • keep_recent now skips requests holding RetryPromptPart as well as ToolReturnPart, so the trimmed history starts at a user turn.
  • The cross-session paragraph links to the memory page for agents that keep their own notes across Dag runs.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: [Claude] following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Lee-W added 2 commits October 14, 2026 09:58
The ProcessHistory example could start the trimmed history at a request
that held only a tool retry, dropping the user's question from the
stored transcript. Treat retry parts like tool returns when picking the
starting request.
Point readers who want the agent to keep its own notes across Dag runs at the memory page, next to the note that the operator has no built-in cross-session memory.
@Lee-W
Lee-W merged commit de856e4 into apache:main Oct 14, 2026
71 checks passed
@Lee-W
Lee-W deleted the common-ai-agent-memory-docs branch October 14, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants