Chunked directory structure from chunkDirectoryStructure()
Embedding generation options
New directory structure with embeddings and statistics
const chunked = recursively_chunk_directory('/path/to/project');
const { embeddedDirectory, stats } = await embedDirectoryStructure(chunked);
console.log(`Generated ${stats.successfulEmbeddings} embeddings in ${stats.totalBatches} batches`);
// With custom options
const result = await embedDirectoryStructure(chunked, {
model: 'text-embedding-3-large',
dimensions: 256,
maxTokensPerBatch: 200000
});
Generates embeddings for all chunks in a chunked directory structure
Uses OpenAI's batch embedding API with intelligent batching to respect:
Returns a new immutable structure with embeddings added to all chunks.