Agent integration architecture
UnifiedMemory integrations all follow the same runtime contract: scoped key identity first, governed recall before model context, governed writeback after useful work, and Courtroom evidence for important memory.
Identity
The effective identity comes from the authenticated key or browser session:
workspace_id, integration_id, source_app, agent_id, app_id,
agent_scope, and capabilities. Request body identity fields are diagnostics
unless the key is admin/operator scoped.
Pre-turn context
Pre-turn context should retrieve the agent's own working/session memory plus approved canonical owner facts. Editor clients such as Cursor and VS Code are manual-MCP by default unless hooks or workspace instructions explicitly call the capture tools.
Post-turn writeback
Writeback stores raw evidence privately first. Durable/shared memory requires writeback admission, extraction, trust gates, and promotion. Full assistant dumps, greetings, setup noise, secrets, and test rows are residue, not memory.
Handoffs
Cross-agent handoff must be explicit. Pass summaries and allowed memory refs; do not inherit another agent's working transcript by default.