MemoryKit

Search & Retrieval

Hybrid search with vector similarity, full-text search, and reranking — find the most relevant memories.

MemoryKit search returns ranked results using hybrid retrieval that combines vector similarity, full-text search, and reranking in a single call.

Search

Returns ranked memory chunks with relevance scores. Use for building custom UIs, feeding your own LLM, or powering any retrieval workflow.

Combines vector similarity and full-text search with automatic reranking for the best results.

const results = await mk.memories.search({
  query: "quarterly revenue targets",
  limit: 10,
  tags: "finance",
  precision: "high",
});
 
for (const hit of results.results) {
  console.log(`[${hit.score.toFixed(2)}] ${hit.title}`);
}

Query parameters

Use query parameters to narrow results by tags, type, date range, and precision.

ParameterTypeDescription
querystringSearch query (required)
precisionstringlow, medium (default), or high — higher precision returns fewer but more relevant results
limitnumberMax results, 1–100 (default: 10)
user_idstringScope to a specific user
typestringFilter by memory type
tagsstringComma-separated tags (e.g. finance,reports)
created_afterstringISO 8601 timestamp — only memories created after this date
created_beforestringISO 8601 timestamp — only memories created before this date
include_graphbooleanInclude knowledge graph connections

Pass userId to only retrieve memories belonging to that user. This is essential for multi-tenant apps where each user has their own knowledge base.

// Only retrieves memories created with userId: "user_123"
const results = await mk.memories.search({
  query: "What are my preferences?",
  userId: "user_123",
});

Common patterns

Use caseApproach
Build a custom search UI with resultssearch with limit and tags
Feed context into your own LLM promptsearch to retrieve, then pass results to your LLM
Scope to a single usersearch with userId
Need full control over the LLMsearch + your own LLM
Time-scoped resultssearch with created_after / created_before
High-accuracy retrievalsearch with precision: "high"
Edit on GitHub

On this page