MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / addDocument

Function addDocument

packages/baseai/src/utils/memory/db/lib.ts:118–131  ·  view source on GitHub ↗
({
	db,
	docName
}: {
	db: Low<Schema>;
	docName: string;
})

Source from the content-addressed store, hash-verified

116
117// CRUD operations for documents
118export async function addDocument({
119 db,
120 docName
121}: {
122 db: Low<Schema>;
123 docName: string;
124}): Promise<void> {
125 if (db.data.documents[docName]) {
126 p.log.info(`[SKIPPED] DOC: ${color.cyan(docName)} already exists.`);
127 return;
128 }
129 db.data.documents[docName] = { name: docName, chunkIds: [] };
130 await db.write();
131}
132
133export function getDocument(
134 db: Low<Schema>,

Callers 1

generateEmbeddingsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected