Memory for every kind of AI system
Three endpoints. Any agent, chatbot, or assistant. MemHQ handles storage, retrieval, and cited Q&A over everything you've ever stored.
Agents that remember across runs
The problem
Stateless agents forget everything the moment a task finishes. Users re-explain their preferences every session. Agents repeat the same mistakes because there's no record of what happened before.
How MemHQ solves it
MemHQ gives each agent a persistent memory graph scoped to the user. Ingest what happened after each run. Search for relevant context before the next one.
import { MemHQ } from "@memhq/sdk";
const mem = new MemHQ({ apiKey: process.env.MEMHQ_API_KEY });
// After each agent run — store what happened
await mem.add({
userId: "user-123",
messages: conversation,
});
// Before the next run — load relevant context
const context = await mem.search({
userId: "user-123",
query: "user's goals and preferences",
limit: 8,
});Chatbots that know who they're talking to
The problem
Every conversation starts from zero. The user explains their role, their stack, their preferences — again. The chatbot feels generic because it is.
How MemHQ solves it
MemHQ persists facts across sessions. Your chatbot greets returning users with context, not a blank slate. Ask for a cited summary at session start and inject it into the system prompt.
// On session start — load what you know about this user
const memory = await mem.ask({
userId: session.userId,
question: "What do I know about this user?",
});
// Inject cited context into the system prompt
const systemPrompt = `You are a helpful assistant.
Context about this user:
${memory.answer}
Sources: ${memory.citations.map(c => c.content).join("; ")}`;Assistants that know your life
The problem
A personal AI assistant is only useful if it actually knows you — your goals, history, preferences, and ongoing projects. That knowledge has to live somewhere persistent between sessions.
How MemHQ solves it
MemHQ is the memory layer your assistant reads from and writes to continuously. It handles extraction from conversation, deduplication, and cited recall so answers are always sourced and accurate.
// As the user talks, extract and store facts automatically
await mem.add({
userId: "user-456",
messages: [
{ role: "user", content: "I'm training for a marathon in October." },
{ role: "assistant", content: "Got it — I'll keep that in mind." },
],
});
// Later: answer questions over the user's full history
const { answer, citations } = await mem.ask({
userId: "user-456",
question: "What fitness goals has the user mentioned?",
});Copilots with shared project knowledge
The problem
Knowledge is siloed in individual conversations. When a second team member asks a question that was already answered, the copilot doesn't know. Team context lives in no one's memory.
How MemHQ solves it
MemHQ supports both per-user and per-project memory scopes. Individual users get private context; the whole team shares project-level knowledge. One API, two scopes, combined at query time.
// Project scope — visible to the whole team
await mem.add({
projectId: "proj-789",
messages: meetingTranscript, // no userId = shared
});
// User scope — private to Alice
await mem.add({
projectId: "proj-789",
userId: "alice",
messages: aliceNotes,
});
// Search combines both scopes automatically
const ctx = await mem.search({
projectId: "proj-789",
userId: "alice",
query: "Q3 launch timeline",
});Start building in minutes
Three endpoints. No infrastructure to manage. Free tier included.