MemoryKit

Use Cases

Common patterns for building with MemoryKit — from support bots to personal AI assistants.

MemoryKit fits anywhere you need AI that remembers. Here are the most common patterns developers build with the platform.

Customer support chatbot

Retrieve answers from your help docs, policies, and past tickets. Feed results into your own LLM for response generation.

Ingest your knowledge base

Upload help articles, policy documents, and FAQ content as memories. MemoryKit auto-chunks and indexes everything.

await mk.memories.batchIngest({
  items: articles.map((a) => ({
    content: a.body,
    title: a.title,
    tags: ["support", a.category],
    metadata: { article_id: a.id },
  })),
});

Search for answers

Retrieve relevant support content with hybrid search. Feed results into your own LLM.

const results = await mk.memories.search({
  query: customerQuestion,
  limit: 5,
  tags: "support",
  userId: customer.id,
});
// Feed results into your own LLM for answer generation

Improve over time

Add resolved tickets as new memories. The search results get better with every interaction.

Key features used: Search, Batch ingest, Users


Internal knowledge base

Give your team instant answers from scattered docs, Notion pages, Confluence wikis, and Slack threads.

Centralize documents

Ingest documents from multiple sources. Use tags and metadata to preserve the origin.

await mk.memories.upload({
  file: pdfBuffer,
  title: "Engineering Handbook",
  tags: ["engineering", "handbook"],
  metadata: { source: "notion", updated: "2025-03-01" },
});

Search across everything

A single search queries all sources simultaneously with hybrid retrieval.

const results = await mk.memories.search({
  query: "What is our deployment process for production?",
  limit: 10,
  tags: "engineering",
});

Keep it fresh

Set up a sync pipeline that re-ingests updated documents. Use reprocess when content changes.

Key features used: File upload, Search, Reprocess


Personal AI assistant

Build an assistant that learns each user's preferences, history, and context — so every response is personalized.

Create per-user memory

Scope memories to individual users. Each user gets their own knowledge silo.

await mk.memories.create({
  content: "Prefers dark mode, metric units, and concise answers.",
  userId: "user_123",
  tags: ["preferences"],
});

Search with user context

Pass userId and the search only retrieves that user's data. No cross-contamination.

const results = await mk.memories.search({
  query: "What format should I use for this report?",
  userId: "user_123",
  limit: 5,
});
// Feed results into your own LLM with personalization instructions

Track interactions

Use events to record what the user does. This data enriches future personalization.

await mk.users.createEvent("user_123", {
  type: "feedback",
  data: { rating: "helpful" },
});

Key features used: Users, User-scoped search, Events


Document Q&A

Let users upload a document and immediately search it — "search your PDF" in minutes.

Upload and wait

Upload the document, then poll or use webhooks until processing completes.

const memory = await mk.memories.upload({ file: userFile });
 
// Wait for processing
let current = memory;
while (current.status === "processing") {
  await new Promise((r) => setTimeout(r, 2000));
  current = await mk.memories.get(memory.id);
}

Search the document

Search the uploaded document by scoping to the user and using tags.

const results = await mk.memories.search({
  query: userQuestion,
  userId: sessionUserId,
  limit: 5,
  precision: "high",
});

Clean up

Delete the memory when the session ends if the document is temporary.

await mk.memories.delete(memory.id);

Key features used: File upload, Search, Polling


Multi-tenant SaaS

Serve many customers from a single MemoryKit project by scoping everything through userId.

// Customer A ingests their data
await mk.memories.create({
  content: companyADocs,
  userId: "company_a",
});
 
// Customer B ingests their data
await mk.memories.create({
  content: companyBDocs,
  userId: "company_b",
});
 
// Searches are isolated — Company A never sees Company B's data
const results = await mk.memories.search({
  query: "What is our refund policy?",
  userId: "company_a",
  limit: 5,
});

Key features used: Users, GDPR erasure


Next steps

Edit on GitHub