npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@abhinav1201/rag-ai-accelerator

v0.1.2

Published

A plug-and-play AI accelerator for RAG chat experiences — generic vector DB + LLM provider, embeddable or standalone.

Readme

@abhinav1201/rag-ai-accelerator

A plug-and-play AI accelerator for RAG chat experiences that can be embedded into Next.js apps or used as a standalone demo app. Bring your own vector database, LLM, embeddings, and UI branding.

NPM Version NPM Downloads GitHub Next.js TailwindCSS


✨ Features

| Category | Options | |---|---| | Vector DBs | Pinecone, pgVector (PostgreSQL), MongoDB Atlas, ChromaDB, Qdrant, universal REST adapters | | LLM Providers | OpenAI, Anthropic Claude, Google Gemini, Ollama, LiteLLM, universal REST adapters | | Document Ingestion | Universal support for PDF, DOCX, CSV, JSON, MD, TXT | | UI | Full-page ChatWindow + floating ChatWidget, fully branded & responsive | | RAG | Configurable chunk size/overlap, top-K retrieval, score threshold, namespaced multi-tenancy |


🚀 How it Works

The AI Accelerator acts as a universal bridge between your data and your users. It normalizes different AI providers and Vector databases into a single interface.

  1. Ingest: Upload or send documents to the /api/upload endpoint. They are automatically parsed, chunked, and embedded.
  2. Retrieve: When a user asks a question, the system converts it to a vector and searches your configured database.
  3. Generate: The retrieved context is combined with the user query and sent to your configured LLM (OpenAI, Claude, etc.) to generate a grounded response.

📦 How to Install

To integrate the AI Accelerator into your existing Next.js project, simply run:

npm install @abhinav1201/rag-ai-accelerator

Alternatively, if you want to run the standalone demo application:

git clone https://github.com/abhinav1201/ai-accelerator
cd ai-accelerator
npm install
cp .env.example .env.local
# Fill in your API keys in .env.local
npm run dev

NPM Package Usage

1. Embed the ChatWidget

Wrap your application in the ConfigProvider and add the ChatWidget.

import { ConfigProvider, ChatWidget } from '@abhinav1201/rag-ai-accelerator';

export default function Layout({ children }) {
  return (
    <ConfigProvider
      config={{
        projectId: 'my-project',
        ui: {
          title: 'Support Bot',
          primaryColor: '#6366f1',
          accentColor: '#8b5cf6',
          welcomeMessage: 'Hi! How can I help you today?',
        },
      }}
    >
      {children}
      <ChatWidget position="bottom-right" />
    </ConfigProvider>
  );
}

2. Mount the API routes

Create standard Next.js route handlers and plug in the library's factories.

// src/app/api/chat/route.ts
import { createChatHandler, getRagConfig } from '@abhinav1201/rag-ai-accelerator/server';
export const POST = createChatHandler(getRagConfig());

// src/app/api/upload/route.ts (Handles PDF, DOCX, etc.)
import { createUploadHandler, getRagConfig } from '@abhinav1201/rag-ai-accelerator/server';
export const POST = createUploadHandler(getRagConfig());

3. Use RAGPipeline programmatically

import { RAGPipeline } from '@abhinav1201/rag-ai-accelerator/server';

const pipeline = new RAGPipeline(config);
await pipeline.ingest([{ docId: 'readme', content: 'Your document text here' }]);
const { reply, sources } = await pipeline.ask('What is the refund policy?');

Configuration Reference

The library is entirely dynamic. You can switch between providers simply by updating your environment variables.

| Variable | Description | |---|---| | RAG_PROJECT_ID | Project namespace for data isolation | | VECTOR_DB_PROVIDER | pinecone, pgvector, mongodb, or universal_rest | | VECTOR_UNIVERSAL_PROFILE | pinecone-rest, mongodb-atlas, chromadb, qdrant | | LLM_PROVIDER | openai, anthropic, ollama, or universal_rest | | LLM_UNIVERSAL_PROFILE | openai-compatible, litellm, anthropic-claude, google-gemini | | EMBEDDING_PROVIDER | openai, ollama, or rest |


Architecture

User Query
   |
   v
[embed query]  <-- EmbeddingProvider (OpenAI / Ollama / Custom)
   |
   v
[vector search]  <-- IVectorDB (Pinecone / pgVector / MongoDB / Chroma / REST)
   |
   v
[build context]
   |
   v
[LLM chat]  <-- ILLMProvider (OpenAI / Anthropic / Gemini / LiteLLM)
   |
   v
ChatResponse { reply, sources[] }

License

MIT - GSPANN Technologies