@vox-ai-app/vox-indexing
v1.0.0
Published
Local file indexing, full-text search, and document parsing for Vox
Readme
@vox-ai-app/vox-indexing
Local file indexing, full-text search, and document parsing for Vox. Runs in a separate Electron utility process to keep the main process responsive.
Install
npm install @vox-ai-app/vox-indexingPeer dependency: electron >= 28
Requirements
VOX_USER_DATA_PATH— writable directory, database stored asknowledge-index.dbVOX_APP_PATH— app path, used to locate the parser worker- Build config must emit two separate entry points (see Build section)
Usage
import {
bootIndexingRuntime,
shutdownIndexingRuntime,
addIndexFolder,
removeIndexFolder,
searchIndexedContextForTool,
getIndexingStatus,
setLogger,
setSentryCapture
} from '@vox-ai-app/vox-indexing'
setLogger(logger)
setSentryCapture(captureException)
await bootIndexingRuntime()
await addIndexFolder('/Users/me/Documents')
const results = await searchIndexedContextForTool('query text', { limit: 5 })
await shutdownIndexingRuntime()API
Runtime lifecycle
bootIndexingRuntime() // start the indexing utility process
shutdownIndexingRuntime() // graceful shutdown
rebuildIndexing() // wipe and re-index all folders
resetIndexingState() // clear state without reindexingFolder management
addIndexFolder(path) // add a folder to the index
removeIndexFolder(path) // remove a folder and its data
getTrackedIndexFolders() // list all tracked folders
pickIndexFolder() // open a native folder picker dialogQuery
searchIndexedContextForTool(query, opts) // full-text search
listIndexedFilesForTool(path, opts) // list files under a path
readIndexedFileForTool(path) // read a specific indexed file
getIndexedChildren(path) // explorer tree children
getIndexingStatus() // current status + progressIPC registration
For Electron apps that expose indexing over IPC:
import { registerIndexingIpc } from '@vox-ai-app/vox-indexing/ipc'
registerIndexingIpc()
// Registers: indexing:get-folders, indexing:add-folder, indexing:remove-folder,
// indexing:rebuild, indexing:get-status, indexing:pick-folder,
// indexing:get-indexed-children, indexing:reset-stateSupported file types
.pdf, .docx, .pptx, .xlsx, .odt, .odp, .ods, .rtf, and plain text files.
Build
Register two additional entry points in your Electron build config:
// electron.vite.config.js
export default {
main: {
build: {
rollupOptions: {
input: {
index: 'src/main/index.js',
'indexing.process': 'node_modules/@vox-ai-app/vox-indexing/src/process/process.js',
'indexing.parser.worker': 'node_modules/@vox-ai-app/vox-indexing/src/parser/worker.js'
}
}
}
}
}License
MIT
