Build a personal assistant
Build an AI assistant that remembers each user's preferences, history, and context for personalized responses.
Build an assistant that learns and remembers each user's preferences, history, and context. Every response is personalized — the assistant knows what the user likes, what they've done, and what they need.
Prerequisites
- A MemoryKit API key (get one here)
- Node.js 18+ or Python 3.8+
- A user authentication system (to get user IDs)
Step 1: Register users
Create users in MemoryKit so memories can be scoped per person.
Step 2: Store per-user memories
Every memory is scoped to a user with userId. Users never see each other's data.
Step 3: Personalized search
Pass userId and MemoryKit only retrieves that user's memories. Feed the results into your own LLM with custom instructions for personalized responses.
Step 4: Search across user context
Use search to retrieve user-specific context for each interaction. Combine multiple searches to gather preferences, project context, and history.
Step 5: Track interactions with events
Log user actions as events to enrich future personalization.
Step 6: Learn from interactions
After each conversation, extract and store new facts about the user. Use your own LLM to extract facts, then store them as memories.
Step 7: GDPR — delete user data
When a user requests data deletion, one call removes everything.
Summary
| What | How |
|---|---|
| Register users | users.upsert() on login |
| Per-user memory | memories.create() with userId |
| Personalized search | search() with userId |
| Search across context | Multiple search() calls with filters |
| Track behavior | users.createEvent() |
| Learn over time | Extract facts → store as memories |
| GDPR delete | users.delete(id, { cascade: true }) |
Key features used: Users, User-scoped search, Events, GDPR erasure