import { use } from '@memvid/sdk';
const mem = await use('vercel-ai', 'knowledge.mv2');
const tools = mem.tools;
// Store a document
const putResult = await tools.memvid_put.execute({
title: 'API Documentation',
label: 'docs',
text: 'The API supports REST and GraphQL endpoints...',
});
console.log(putResult); // "Document stored with frame_id: 2"
// Search for documents
const findResult = await tools.memvid_find.execute({
query: 'API endpoints',
top_k: 5,
});
console.log(findResult);
// Ask a question
const askResult = await tools.memvid_ask.execute({
question: 'How do I authenticate with the API?',
mode: 'auto',
});
console.log(askResult);