One instance, many agents
The simplest architecture is a single SDK instance and SQLite file. Agents differ only by the agent string on write.
When to isolate
- Use
filter.agentfor private recalls - Omit the filter for organization-wide shared search
- Use separate
organizationvalues for hard tenancy
Example
typescripttypescript
await ctx.remember({
agent: "researcher",
content: { text: "Customer prefers monthly invoices." },
});
await ctx.remember({
agent: "support",
content: { text: "Escalations should include invoice IDs." },
});
// Shared across agents
const shared = await ctx.recall({ query: "invoices", topK: 5 });
// Support-only
const supportOnly = await ctx.recall({
query: "escalations",
filter: { agent: "support" },
});