Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 817 Bytes

README.md

File metadata and controls

28 lines (19 loc) · 817 Bytes

RAG.ts - Retrieval-Augmented Generation Library

RAG.ts is a lightweight and advanced document retrieval library that enables smart document retrieval for Retrieval-Augmented Generation (RAG) use cases. It provides advanced techniques like TF-IDF scoring, fuzzy matching, and contextual weighting to retrieve relevant documents based on user queries.

Features

  • TF-IDF Scoring: Ranks documents by the importance of the query terms.
  • Fuzzy Matching: Matches user queries even with typos or similar terms.
  • Contextual Weighting: Boosts relevance for title matches and keyword proximity.
  • Top-N Retrieval: Returns the most relevant documents based on a query.

Installation

npm install

Build

npm run build

Example

node ./dist/example.js