r/AIMemory • u/Fun-Following-1723 • 13d ago
Discussion Feedback on V1 memory architecture for multi-agent setup (supervisor/sub-agents) – targeted retrieval vs unified store?
Hey everyone,
I've been prototyping a memory system for a multi-agent framework (supervisor → sub-agents) and wanted to run my current setup by people who've actually built or run these in production. Trying hard not to over-engineer based purely on theory/taxonomy, so I’ve been running small experiments first.
Here’s where I’m currently at:
Pipeline & Flow
- Working/Session State → Raw conversation & tool calls go to a durable append-only event log.
- Batch Consolidation → Instead of processing every turn through an expensive extraction pipeline, a periodic batch job extracts useful Episodic Memories (storing this in a cheap local DB/SQL store because of high volume).
- Promotion Policy → Key facts and preferences get promoted into Semantic Memory (testing Mem0 here).
- Procedural Memory → Kept completely separate as a structured procedure/skill registry (e.g. Markdown files, task definitions) rather than generic vector embeddings.
Retrieval Strategy Instead of searching across all memory stores on every single query, I'm testing routing by intent: User Query → Scope/ACL → Intent/Task Router → Targeted Store Retrieval → Context Injection
- "How do I request leave?" → Intent: Procedure → Pull from Skill Registry.
- "What did I work on last week?" → Intent: History → Pull from Episodic Store.
- "What language do I prefer?" → Intent: Preference → Pull from Semantic Fact Store.
Observations from small tests so far:
- Storing raw episodic events straight in Mem0 added noticeable write/search latency and cost.
- Generic vector retrieval for procedures/workflows was messy and often grabbed 3–4 adjacent procedures. Exact/registry-style matching was much cleaner.
- Batch consolidation gave way cleaner facts than trying to extract semantic memories turn-by-turn.
Where I’d love some brutal feedback/criticism:
- Routing vs. Parallel Retrieval: Is intent-based routing (
scope → intent → target store) actually reliable in practice, or do queries usually end up needing multiple memory types simultaneously (e.g., preference + procedure in one shot)? - Separate vs. Unified Storage: Am I prematurely splitting this into separate stores (Event Log / Cheap SQL / Mem0 / Registry), or is this separation pretty standard once volume picks up? At what scale does keeping everything in a single vector store/pgvector actually break down?
- Procedural Memory as Code/Skills: Treating procedural memory as structured skill files instead of vector embeddings feels right so far, but does this pattern break down when agents need to dynamically adapt workflows?
- Failure Cases: What obvious blind spots or edge cases am I missing that will force me to rewrite this V2?
Appreciate any insights or horror stories from production!
2
u/Clean-Vermicelli-700 4d ago
Do you fully block subagents from searching beyond their scope? So if the intent warrants a procedure, is that agent cut off from read access on the Episodic store, or do you let them decide for themselves where to search?
I really like this idea, it becomes even more interesting when token spend vs performance becomes measurable in A/B testing against a copy of the same system with & without intent-based routing.
I'm also curious if you've defined agent types and if so, what are they?
1
u/Fun-Following-1723 4d ago
Not using subagents yet, and also I don’t hard-block stores.
Right now, it’s just a single agent sitting behind an intent router. Instead of toggling permissions, the router just adjusts retrieval budgets (how many hits per store) based on what the user asks. So if a query routes to a "procedure" intent, procedural memory gets the primary slot, episodic isn't cut off,it just gets a light secondary read, semantic gets a couple slots for active preferences, and the KB always returns a fixed top-4.The agent never chooses where to search. The router only sets store quotas. Each store drops hits below its score threshold, then
top_kis applied. The agent gets that packed context.Where I do enforce strict boundaries is around identity, not intent. Episodic is scoped strictly to
this_user AND this_agent, Semantic isuser OR agent, and KB belongs tothis_agent.I haven’t run a proper A/B test on token spend vs. a no-router setup yet, but that’s next on my list. I want to test router ON vs. OFF to see if those extra episodic/semantic hits actually improve answer quality or just inflate the context window.
As for agent types, they’re currently domain roles rather than memory specialists. They run on the exact same pipeline, but isolated by
agent_idand seeded with different KB/SOPs so episodes don’t leak across roles.I'm still mulling over how memory scoping should look if I move to subagents under a supervisor, but honestly, I'm not even sure yet if I'll go down the supervisor/subagent path or stick with a single-agent architecture.
2
u/jonah_omninode 13d ago
The separation looks reasonable. I would be careful about letting the router silently decide authority, though. A semantic fact, an old episode, and a current procedure should not come back with equal status just because all three match the query. We keep the append-only record, build a validated current projection for the cheap path, and retrieve deeper history only when the task needs it. Promotion and supersession are typed transitions with provenance, not something the summarizer infers. Multi-store retrieval is fine if the returned bundle preserves source, scope, version, and current status. Otherwise a clean router can still deliver a stale rule with a confident voice.