@praxa/sdk/memory entrypoint.
The SDK is read-only. It receives provider clients your backend already owns,
and it requires explicit tenant and subject namespace resolution.
Prerequisites
Before you begin, prepare:- a backend-owned provider client and explicit tenant-subject namespace resolver;
- synthetic records for at least two tenants and two subjects per tenant;
- the exact @praxa/sdk memory package version and supported provider contract;
- a provider cleanup procedure plus degraded-state and timeout fixtures;
- an acceptance assertion that proves federated recall preserves source status, provenance, contradictions, bounds, and isolation.
1. Install the package
message, fact, summary,
episode, pinned_context, document, entity, and edge.
2. Create a source
- Mem0
- LangGraph
- Zep
- Graphiti
- Letta
- OpenAI Agents
Mem0 namespace filters must use positive equality with current camel-case
keys:
userId, agentId, appId, or runId.3. Combine the sources
4. Add a custom source
provenance, provide all required fields. Do not
send a partial provenance object and invent missing confidence or timestamps.
5. Test the federation engine
This Vitest test proves success plus explicit partial degradation without calling a real provider:memory.test.ts
6. Run provider-level canaries
For each real provider, seed data through that provider’s normal write API and then assert:- Subject A retrieves its known record.
- Subject B in the same tenant does not retrieve it.
- The same subject ID in tenant B does not retrieve it.
- Disabling the provider produces the expected source status.
- Matching content from two sources retains both source matches.
- Contradictory content remains separate.
- An abort stops underlying work only when the adapter advertises
supportsAbort: true.
Troubleshooting
Best practices
- Keep provider writes and lifecycle under the provider’s documented API.
- Resolve tenant and subject in trusted backend code and test 2x2 isolation.
- Preserve provenance, source matches, contradictions, and per-source status.
- Bound concurrency, result count, context bytes, and source timeout.
- Never promote checkpoint, hidden, or unverified content into portable recall.
Optimize for production
- Query only providers and record kinds relevant to the current purpose.
- Use bounded parallel recall and give each source an explicit timeout budget.
- Deduplicate normalized content while retaining every source match and contradiction.
- Measure source p50/p95 latency, partial/failed recalls, result precision, context bytes, and isolation failures.
Cleanup and next steps
- Delete synthetic provider records using the provider’s normal API.
- Hard-erase disposable hosted candidates and verify content-free receipts when used.
- Revoke test credentials and remove namespace fixtures for every tenant and subject.
- Retain only non-content source statuses, identifiers, and test results required for audit.