New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

vector-chunker

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vector-chunker

A flexible text and data chunking library for vector databases and LLMs

latest
npmnpm
Version
1.0.0
Version published
Maintainers
0
Created
Source

Vector Chunker

A flexible text and data chunking library for vector databases and LLMs. Similar to LangChain's RecursiveCharacterTextSplitter but with additional features for structured data and context preservation.

Installation

  • bash

npm install @yourusername/vector-chunker

Usage

import { chunk } from '@yourusername/vector-chunker';

// Text chunking
const textChunks = chunk('Your long text...', {
  chunkSize: 1000,
  format: 'text',
  splitOn: 'sentence',
  preserveContext: true,
  overlap: 200
});

// Structured data chunking
const dataChunks = chunk(yourDataArray, {
  chunkSize: 4000,
  preserveContext: true
});

Features

  • Text chunking with multiple splitting strategies (character, word, sentence, paragraph)
  • Structured data chunking with size control
  • Context preservation between chunks
  • Configurable overlap
  • Metadata and relationship tracking
  • Full TypeScript support

API Reference

See API Documentation for detailed information.

License

MIT

Keywords

vector-db

FAQs

Package last updated on 24 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts