Repository navigation
Document agent memory across Dag runs for common.ai - #74681
Merged
Merged
Conversation
Agents in common.ai run on Pydantic AI, so they can use pydantic-ai-harness Memory through capabilities= today. Show it for a recurring AgentOperator (SQLite) and for per-customer memory in your own agent (Postgres), and say how Strands and ADK agents use their own memory.
Every Dag in example_agent_memory.py needs pydantic-ai-harness, which only the code-mode extra installs, so in CI the file defines no Dags and the import test fails.
1 task done
vatsrahul1001
approved these changes
Oct 14, 2026
gopidesupavan
approved these changes
Oct 14, 2026
Lee-W
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The common.ai docs say nothing about memory, so it looks like the provider has none. Agents here already run on Pydantic AI, so pydantic-ai-harness's
Memorycapability works throughcapabilities=today, with no new code in the provider. This PR adds a page that shows how, and says how Strands and ADK agents use their own memory.The new page,
memory.rstunder Features, has two examples inexample_agent_memory.py:AgentOperatorwithSqliteMemoryStore. A daily triage agent keeps notes on failure causes across Dag runs.PostgresMemoryStore. A mapped task gives each customer its ownnamespace, and the database credentials come from an Airflow connection.The second example is your own agent in a
@task, notAgentOperator.PostgresMemoryStoretakes anasyncpgpool, the pool has to be awaited into existence, and it only works on the event loop that created it. A pool built in the Dag file can't be handed toAgentOperator, which runs the agent withrun_sync. The task usesasyncio.run, not anasync deftask, so the example still works on the Airflow 2.11 floor.The page leads with where the store lives. Celery and Kubernetes workers don't share a disk, so a local SQLite file or
FileStoreis gone by the next run. The store table says which store fits which deployment.Checked in breeze with pydantic-ai-harness 0.24.0, the floor the
code-modeextra already uses:<memory>block.dags testruns.acme/main/MEMORY.mdandglobex/main/MEMORY.mdfrom the mapped run.Those runs used the
testmodel, which calls every tool with generated arguments, soread_memoryfails on a made-up file name. The Dags have not been run against a real model yet.