import { MossClient, DocumentInfo } from '@inferedge/moss'
const client = new MossClient(projectId, projectKey)
const docs: DocumentInfo[] = [
{ id: 'doc1', text: 'Track orders in your account.', metadata: { category: 'shipping' } },
{ id: 'doc2', text: '30-day return policy for most items.', metadata: { category: 'returns' } },
{ id: 'doc3', text: 'Change address via customer service.', metadata: { category: 'support' } },
]
await client.createIndex('faqs', docs, 'moss-minilm') // creates & syncs
await client.loadIndex('faqs') // loads from cloud or cache
const results = await client.query('faqs', 'return a damaged product', 3, { alpha: 0.6 }) // alpha: 1.0 semantic, 0.0 keyword
await client.deleteIndex('faqs')