A plug-and-play Retrieval-Augmented Generation (RAG) application built with Node.js, React, Pinecone, and OpenAI.
- Document Upload & Processing: Support for PDF, TXT, DOCX files
- Vector Database: Pinecone integration for efficient similarity search
- AI-Powered Chat: OpenAI GPT integration with context-aware responses
- Modern UI: React frontend with Tailwind CSS
- Real-time Streaming: Live response generation
- Conversation History: Persistent chat sessions
- Document Management: Upload, view, and delete documents
- Metadata Filtering: Filter by document type and source
- Backend: Node.js, Express, Pinecone SDK
- Frontend: React, Tailwind CSS, Axios
- AI: OpenAI GPT-4/3.5-turbo
- Vector Database: Pinecone
- File Processing: Multer, PDF-parse, mammoth
- Node.js (v18 or higher)
- npm or yarn
- Pinecone account and API key
- OpenAI API key
-
Clone and Setup
git clone <your-repo-url> cd rag-starter-kit npm run setup
-
Environment Configuration
cp server/env.example server/.env
Edit
server/.envwith your API keys:OPENAI_API_KEY=your_openai_api_key PINECONE_API_KEY=your_pinecone_api_key PINECONE_ENVIRONMENT=your_pinecone_environment PINECONE_INDEX_NAME=rag-starter-kit -
Start the Application
npm run dev
-
Access the Application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5001
rag-starter-kit/
├── server/ # Node.js backend
│ ├── controllers/ # API route handlers
│ ├── services/ # Business logic
│ ├── utils/ # Helper functions
│ └── index.js # Server entry point
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API calls
│ │ └── utils/ # Frontend utilities
│ └── public/ # Static assets
├── uploads/ # Document storage
└── package.json # Root package.json
- Create a Pinecone account at https://www.pinecone.io/
- Create a new index with:
- Dimensions: 1536 (for OpenAI embeddings)
- Metric: cosine
- Pod type: starter (free tier)
- Get your API key from https://platform.openai.com/
- Ensure you have credits for API usage
- Upload Documents: Drag and drop or select files to upload
- Process Documents: Wait for documents to be processed and indexed
- Start Chatting: Ask questions about your documents
- View History: Access previous conversations
- Manage Documents: View, search, or delete uploaded documents
| Variable | Description | Required |
|---|---|---|
OPENAI_API_KEY |
OpenAI API key | Yes |
PINECONE_API_KEY |
Pinecone API key | Yes |
PINECONE_ENVIRONMENT |
Pinecone environment | Yes |
PINECONE_INDEX_NAME |
Pinecone index name | Yes |
PORT |
Server port (default: 5001) | No |
NODE_ENV |
Environment (development/production) | No |
npm run devnpm run build
cd server
npm startdocker build -t rag-starter-kit .
docker run -p 3000:3000 -p 5001:5001 rag-starter-kit- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details
- Create an issue for bugs or feature requests
- Check the documentation in the
/docsfolder - Review the example configurations
Stay updated with the latest features and improvements by checking the releases page.