Separate memory extractor vs agent-decided memory for Pydantic AI agents

OkShirt9372 · reddit · 2026-10-14

Pydantic AI doesn't persist memory across sessions by default — after a run, the agent only has explicitly passed context. The author is testing a pattern that stores durable user facts as embeddings with metadata (user ID, session ID, memory type, timestamp), retrieving relevant memories by similarity in new sessions.

The design question is where extraction happens:

The author leans toward the separate extractor but worries the latency isn't always worth it, asking how others handle persistent memory: extraction in the main loop, a separate step, or explicit profile fields?

Original post →

More from coding & agent

coding & agent channel →