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

wise-rag

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wise-rag

A lightweight RAG helper library (embeddings, splitter, in-memory store, Postgres adapter)

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

my-rag-lib

Minimal RAG helper library with:

  • Text splitter
  • In-memory vector store (dev)
  • OpenAI Embeddings wrapper (official OpenAI Node SDK)

Usage:

  • Install dependencies and build:
cd my-rag-lib
npm install
npm run build
  • Example:
import { TextSplitter, InMemoryStore, OpenAIEmbeddings } from 'my-rag-lib';

const splitter = new TextSplitter(800, 200);
const parts = splitter.splitToDocuments('Long text...');

const emb = new OpenAIEmbeddings({ apiKey: process.env.OPENAI_API_KEY });
const vectors = await emb.embedBatch(parts.map(p => p.content));

const store = new InMemoryStore();
await store.add(parts, vectors);

const q = await emb.embed('query');
const results = await store.search(q, 3);

Keywords

rag

FAQs

Package last updated on 23 Dec 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