UNPKG

react-ai-faq-chat

Version:

A smart AI-powered FAQ chatbot

147 lines (98 loc) β€’ 3.33 kB
# react-ai-faq-chat > πŸš€ Turn your documentation into a smart AI-powered FAQ chatbot in **minutes** – no backend, no APIs, 100% free. --- ## πŸ”Ή Why Use This Package? Imagine your users opening your Help Center and asking questions like: > β€œHow do I reset my password?” > β€œWhere can I find the latest API docs?” …and **instantly getting answers** from your own PDFs, Word docs, or Excel sheets – **without building complex AI systems or paying for APIs**. `react-ai-faq-chat` does all the heavy lifting for you: - Scans your **documentation files** - Indexes them for fast answers - Uses a **free, local AI model (Mistral-7B)** to reply intelligently - Works **out-of-the-box in React and Next.js** All in one tiny package. πŸ’‘ --- ## πŸ”Ή Key Features - βœ… **Supports PDF, Word (.docx), and Excel (.xlsx)** - βœ… **Ephemeral chat** – conversation exists while the page is open - βœ… **No database required** - βœ… **No API keys, 100% free** - βœ… **React + Next.js compatible** - βœ… **Minimal config**: just point to your docs folder - βœ… **Provides hook + ready-to-use ChatBot component** --- ## πŸ”Ή Installation ```bash npm install react-ai-faq-chat ``` or ```bash yarn add react-ai-faq-chat ``` --- ## πŸ”Ή Usage > Simply point `docsFolder` to the folder containing your PDF, Word, or Excel documentation. That’s it. ### Using the Hook ```tsx import { useAIFAQChat } from "react-ai-faq-chat"; export default function CustomChat() { const { messages, sendMessage, loading } = useAIFAQChat({ docsFolder: "./public/docs" }); return ( <div> {messages.map((msg, idx) => ( <p key={idx} style={{ textAlign: msg.user ? "right" : "left" }}>{msg.text}</p> ))} <input placeholder="Ask me anything..." onKeyDown={async (e) => { if (e.key === "Enter") await sendMessage((e.target as HTMLInputElement).value); }} /> {loading && <p>Loading...</p>} </div> ); } ``` > Perfect if you want to build a **custom UI** for your chatbot. --- ## πŸ”Ή How It Works (Simplified) 1. The package **reads all your docs** (PDF, Word, Excel) 2. **Splits them into small chunks** for AI understanding 3. Indexes them in a **fast local vector database** (FAISS) 4. Uses **Mistral-7B** AI (completely local, free) to answer questions 5. Returns answers in **real-time** to your React app All this happens **behind the scenes**, no AI or backend setup required. --- ## πŸ”Ή Who Should Use This - Product teams that want **instant FAQ chatbots** - Customer support portals - Developers who want **zero-cost AI integration** - Anyone who has **documentation in PDF, Word, or Excel** --- ## πŸ”Ή Why It's Different | Feature | react-ai-faq-chat | Other Solutions | |---------|-----------------|----------------| | Local AI (free) | βœ… | ❌ | | Works without backend | βœ… | ❌ | | Supports multiple doc types | βœ… | ❌ | | Easy React integration | βœ… | ❌ | | Ephemeral chat | βœ… | ❌ | --- ## πŸ”Ή Minimal Config All you need is: ```ts { docsFolder: "./path-to-your-docs" } ``` > No API keys, no setup, no fuss. --- ## πŸ”Ή License MIT Β© 2025 --- ## πŸ”Ή Ready to Try? ```bash npm install react-ai-faq-chat ``` Then drop it in your React/Next.js page and watch your docs come alive! πŸš€