MCPcopy Index your code
hub / github.com/CommandCodeAI/BaseAI / loadDb

Function loadDb

packages/baseai/src/utils/memory/db/lib.ts:104–115  ·  view source on GitHub ↗
(memoryName: string)

Source from the content-addressed store, hash-verified

102
103// Load a database
104export async function loadDb(memoryName: string) {
105 try {
106 const memoryDbPath = getMemoryDbPath(memoryName);
107 await fs.access(memoryDbPath);
108 return await readDb(memoryDbPath);
109 } catch (error) {
110 if ((error as NodeJS.ErrnoException).code === 'ENOENT') {
111 return await createDb(memoryName);
112 }
113 throw error;
114 }
115}
116
117// CRUD operations for documents
118export async function addDocument({

Callers 4

generateEmbeddingsFunction · 0.90
deleteDocumentsFromDBFunction · 0.90
getDocumentsFromMemoryFunction · 0.85

Calls 3

getMemoryDbPathFunction · 0.85
readDbFunction · 0.85
createDbFunction · 0.85

Tested by

no test coverage detected