Expert guidance for developing AI applications with vectorstores - a vector database framework for Node.js, Deno, Bun, and Edge runtimes. Covers monorepo structure, build commands, vector store patterns, embeddings, and provider integration.
Expert guidance for Claude Code when working with the vectorstores framework - a comprehensive solution for using vector databases in AI applications across multiple runtimes (Node.js, Deno, Bun, Edge).
Vectorstores is a pnpm monorepo using Turborepo that provides runtime-agnostic vector database integrations, embedding utilities, document processing pipelines, and retrieval abstractions for building AI applications.
Always use these commands when working with the codebase:
```bash
pnpm install
pnpm build
pnpm dev
pnpm turbo run dev --filter="./packages/core" --concurrency=100
pnpm test
pnpm typecheck
pnpm lint
pnpm format
pnpm format:write
pnpm exec tsx my_script.ts
pnpm circular-check
```
The repository is organized into several key package categories:
The `@vectorstores/core` package contains all runtime-agnostic abstractions and core functionality:
The `@vectorstores/env` package provides compatibility layer for Node.js, Deno, Bun, and Edge runtimes.
Vector database integrations and data sources:
**Storage providers:** astra, azure, chroma, elastic-search, firestore, milvus, mongodb, pinecone, postgres, qdrant, supabase, upstash, weaviate
**Other providers:** assemblyai, cohere, discord, excel, notion
File format readers: csv, docx, html, image, json, markdown, obsidian, pdf, text, xml
Specialized parsers: code, html
Working examples organized by use case demonstrating various patterns and integrations.
Configure embeddings globally via `Settings.embedFunc` or pass directly to constructors:
```typescript
// Global configuration
Settings.embedFunc = async (input: string[]) => {
// Return embeddings array
return embeddings;
};
// Or pass to constructor
const index = new VectorStoreIndex({
embedFunc: async (input: string[]) => {
// Return embeddings array
return embeddings;
}
});
```
The framework supports multiple query modes via `VectorStoreQueryMode`:
Follow this standard pipeline when working with documents:
1. Documents are parsed into nodes via `NodeParser` (configured via `Settings.nodeParser` or defaults to `SentenceSplitter`)
2. Embeddings are computed via configured `embedFunc`
3. Nodes are stored in vector stores with optional deduplication (`DocStoreStrategy`)
4. Retrieval queries the vector store and returns `NodeWithScore[]` results
When adding new vector database providers or data source integrations:
1. Create new package in `packages/providers/`
2. Use existing `package.json` and `tsconfig.json` as templates
3. Reference new package in root `tsconfig.json`
4. Follow the `BaseVectorStore` interface for storage providers
5. Implement proper error handling and runtime compatibility
Before submitting PRs, create a changeset to document version bumps:
```bash
pnpm changeset
```
Follow the prompts to select affected packages and describe changes.
1. Always run `pnpm build` before running tests
2. Use `pnpm dev` for watch mode during active development
3. Check for circular dependencies with `pnpm circular-check` before PRs
4. Ensure code passes `pnpm typecheck` and `pnpm lint`
5. Format code with `pnpm format:write` before committing
6. Reference `Settings` singleton for global configuration
7. Maintain runtime-agnostic code in `@vectorstores/core`
8. Use `@vectorstores/env` for runtime compatibility utilities
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/vectorstores-framework-development/raw