db-vector
Version:
Client adapters for vector databases with utilities
75 lines (55 loc) ⢠1.58 kB
Markdown
# DB-VECTOR
Unified client for cloud vector databases with chunking and update functionality.
## Features
- š Clients for Different Vector Search (Pinecone || MongoDB for now)
- āļø Advanced chunking functionality (wip)
- š Automatic vector database updates (wip)
- š¦ Simple and unified API (wip)
- š TypeScript support
## Installation
```bash
npm install db-vector
```
## Basic Usage
```typescript
import { createClient, loadFolder } from 'db-vector';
// Create Client
const client = createClient({
provider: 'pinecone',
apiKey: 'API_KEY',
config: {
// provider-specific configuration
}
});
const client = createClient({
provider: 'mongodb',
connectionString: 'CONNECTION_STRING',
config: {
// provider-specific configuration
}
});
// Load docs from folder
const docs = await loadFolder('/documents')
// process and upsert documents
await processDocument(client, indexname, namespace, doc, {
batchSize: batchsize,
onProgress: progressCallback
})
```
## Project Structure
```
db-vector/
āāā src/
ā āāā clients/ # Clients for various providers
ā āāā lib/ # utils
ā āāā chunking/ # Chunking functionality
ā āāā types/ # TypeScript definitions
ā āāā index.ts # Main entry point
āāā dist/ # Build output
āāā tests/ # Test suite
āāā docs/ # Documentation
```
## License
MIT
## Contributing
Contributions are welcome! Open an issue or pull request.