Skip to content

Document agent memory across Dag runs for common.ai - #74681

Merged
Lee-W merged 2 commits into
mainfrom
commonai-memory-docs
Oct 14, 2026
Merged

Lee-W merged 2 commits into
mainfrom
commonai-memory-docs

Conversation

@kaxil

@kaxil kaxil commented Oct 14, 2026

Copy link
Copy Markdown
Member

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 Memory capability works through capabilities= 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.rst under Features, has two examples in example_agent_memory.py:

  • A recurring AgentOperator with SqliteMemoryStore. A daily triage agent keeps notes on failure causes across Dag runs.
  • Per-customer memory with PostgresMemoryStore. A mapped task gives each customer its own namespace, and the database credentials come from an Airflow connection.

The second example is your own agent in a @task, not AgentOperator. PostgresMemoryStore takes an asyncpg pool, 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 to AgentOperator, which runs the agent with run_sync. The task uses asyncio.run, not an async def task, 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 FileStore is 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-mode extra already uses:

  • A note written in one run reaches the next run's request inside a <memory> block.
  • The SQLite file is shared across two dags test runs.
  • The Postgres table holds acme/main/MEMORY.md and globex/main/MEMORY.md from the mapped run.

Those runs used the test model, which calls every tool with generated arguments, so read_memory fails on a made-up file name. The Dags have not been run against a real model yet.

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.
@Lee-W
Lee-W merged commit 09b4b63 into main Oct 14, 2026
85 checks passed
@Lee-W
Lee-W deleted the commonai-memory-docs branch October 14, 2026 06:54
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.

4 participants