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:
- Agent decides what to remember: simpler flow, but risks re-saving recalled memories or storing temporary preferences as durable facts
- Separate extractor agent: sees only the new user message and decides what's worth storing — cleaner write path, but adds a model call
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?
More from coding & agent
- Monid ranks agent tools by real usage: TinyFish leads with 754K weekly transactions — HeyAmit_ · 2026-10-23
- Claude cut a 2.6-hour video export to 20 minutes — but only after being told to rebuild the server — byhewar · 2026-10-23
- OpenJet claims Qwen3.8-27B coding runs 1.9x faster than llama.cpp on one RTX 3090 — JeremyCMorgan · 2026-10-23
- Building an autonomous SEO agent in Hermes with three skills: programmatic pages, Keywords Everywhere, DataForSEO — EXM7777 · 2026-10-23
- Building a sports betting AI agent with onchain execution and human approval by default: architecture and lessons — Dry-Comfortable-2678 · 2026-10-23
- Capy 0.5.0 lets Claude Pro/Max subscribers reuse their plan quota, adds OIDC cloud access — garrytan · 2026-10-23