AI-Powered Contextual Chat for Websites using Next.js, Redis, and RAG
Web Wisdom is an intelligent chat interface that provides contextual responses based on website content. Using Retrieval-Augmented Generation (RAG) and Redis for efficient data storage and retrieval, it delivers accurate and context-aware responses to user queries.
- Contextual AI Chat: Intelligent responses based on your website's content
- Redis-Powered Caching: Fast and efficient data retrieval using Upstash Redis
- RAG Implementation: Enhanced response accuracy through document retrieval
- Modern Tech Stack: Built with Next.js 14 and TypeScript
- Responsive Design: Beautiful UI with Tailwind CSS
- Real-time Processing: Quick response times with optimized data handling
- Frontend: Next.js 14, TypeScript, Tailwind CSS
- Database: Upstash Redis
- AI/ML: RAG (Retrieval Augmented Generation)
- Deployment: Vercel (recommended)
- Clone the repository:
git clone https://github.com/yourusername/web-wisdom.git
cd web-wisdom
- Install dependencies:
npm install
- Set up environment variables:
UPSTASH_REDIS_REST_URL=your_redis_url
UPSTASH_REDIS_REST_TOKEN=your_redis_token
OPENAI_API_KEY=your_openai_key
- Run the development server:
npm run dev
- Create an account on Upstash
- Create a new Redis database
- Copy the REST URL and REST Token
- Add them to your environment variables
The project uses RAG for enhanced response generation:
- Document indexing in Redis
- Vector similarity search
- Context-aware response generation
- Initialize the Chat:
import { WebWisdomChat } from '@/components/Chat';
<WebWisdomChat
websiteUrl="your-website-url"
apiKey="your-api-key"
/>
- Custom Configuration:
// Configure Redis client
const redis = new Redis({
url: process.env.UPSTASH_REDIS_REST_URL,
token: process.env.UPSTASH_REDIS_REST_TOKEN,
});
- Fork the repository
- Create your feature branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m 'Add YourFeature'
- Push to the branch:
git push origin feature/YourFeature
- Open a pull request
This project is licensed under the MIT License - see the LICENSE.md file for details.