import { ChromaResource, MountMode, Workspace } from '@struktoai/mirage-node'
const knowledge = new ChromaResource({
config: {
host: 'localhost',
port: 8000,
collectionName: 'knowledge',
// slugField: 'page_slug', (default)
// chunkIndexField: 'chunk_index', (default)
},
})
const ws = new Workspace({ '/knowledge': knowledge }, { mode: MountMode.READ })
console.log(await (await ws.execute('tree /knowledge/')).stdoutStr())
console.log(await (await ws.execute('grep -r refund /knowledge/policies/')).stdoutStr())
console.log(
await (await ws.execute('chroma-query "how am I throttled" /knowledge/')).stdoutStr(),
)