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.
- 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.
npm install
npm run build
node ./dist/example.js