The embedded directory structure to store
Original root path of the directory
Storage options (model, dimensions, deleteExisting, hashDelimiter, batchSize)
Storage statistics
const result = await embed_directory('/path/to/project');
const stats = await store_embedded_directory(
result.embeddedDirectory,
'/path/to/project',
{ model: 'text-embedding-3-small', dimensions: 1536, hashDelimiter: '::', batchSize: 200 }
);
console.log(`Stored ${stats.chunksCreated} chunks with ${stats.embeddingsCreated} new embeddings`);
Store an embedded directory structure in SurrealDB
This function traverses the embedded directory tree and stores:
All deterministic IDs are generated using SHA256 hashes with delimiters to prevent collisions.
Uses batched operations for improved performance with progress logging.