Skip to main content

Mental model

MemContext is the memory layer for your AI product. Your app sends durable context to MemContext, then retrieves relevant context before generation. Your application does not need to manage retrieval logic, duplicate memories, or memory updates manually.

Integration pattern

A typical integration follows four steps:
  1. Save durable user or project context via POST /api/memories
  2. Search before generation or decision-making via GET /api/memories/search
  3. Profile (optional) - fetch broad context in one call via GET /api/memories/profile
  4. Feedback - record retrieval quality via POST /api/memories/:id/feedback
For larger notes, POST /api/memories may return 202 Accepted. This means extraction has started and can be tracked with the returned jobId. For multi-user applications, always pass a stable end-user or tenant ID in scope. project remains a secondary grouping field inside that scope.

Example: Support bot

Good fit use cases

Ownership boundary

Keep your application logic outside MemContext. MemContext owns:
  • Saving and retrieving memory
  • Handling duplicates and updates
  • Memory history
  • Expiry and temporal filtering
  • MCP tool access
Your application owns:
  • Business-specific prompts and logic
  • UI and user experience
  • Workflow orchestration
  • Downstream actions and integrations

API integration example

If you submit a long note or transcript, check the returned status:
  • saved, updated, extended, duplicate → final synchronous result
  • accepted → asynchronous extraction in progress

TypeScript SDK example

Install the SDK:

Tips

  • Search before saving - avoid duplicates by checking if the knowledge already exists
  • Use scope for hard per-user or per-tenant isolation
  • Use projects only to group memories inside that scope
  • Category matters - preference and fact go into profile static context; everything goes into dynamic
  • Do not save noise - only persist information with long-term value