MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / persistIndex

Function persistIndex

src/context/retrieval.ts:199–205  ·  view source on GitHub ↗
(projectRoot: string, embeddingModel: string, idx: Index)

Source from the content-addressed store, hash-verified

197 * better-sqlite3 can't load we still have the JSON.
198 */
199export async function persistIndex(projectRoot: string, embeddingModel: string, idx: Index): Promise<void> {
200 await saveIndex(indexPath(projectRoot, embeddingModel), idx).catch(() => {});
201 try {
202 const { buildSqliteIndex } = await import('./sqlite-index.js');
203 await buildSqliteIndex(projectRoot, embeddingModel, idx.chunks);
204 } catch { /* SQLite optional — JSON remains authoritative */ }
205}
206
207/**
208 * Search the persisted index for a project, preferring the SQLite quantized

Callers 2

executeMethod · 0.85
retrieveRelevantFilesFunction · 0.85

Calls 3

saveIndexFunction · 0.85
indexPathFunction · 0.85
buildSqliteIndexFunction · 0.85

Tested by

no test coverage detected