# π€ Neurabot - AI-Powered RAG Chatbot
> **Retrieval-Augmented Generation (RAG) Full-Stack Chatbot**
> A sophisticated AI chatbot that leverages your custom documents and institutional reports to provide intelligent, context-aware responses about technology trends and industry insights.
---
## π Live Demo
| Platform | Link |
| :--- | :--- |
| **π Vercel** | [**View Live Demo**](https://neurabot-sepia.vercel.app) |
| **π CodeAwake** | [**Alternative Demo**](https://tech-trends-chatbot.codeawake.com) |
---
## π― Overview
Neurabot is a **full-stack application** combining **Large Language Models (LLMs)** with **custom document retrieval** (Vector Search). It is designed to ingest authoritative sources (PDFs, Reports) and answer complex queries with high factual accuracy.
### π’ Data Sources Integration
The current model is trained/indexed on reports from:
* **World Bank** (Economic Data)
* **World Economic Forum** (Global Trends)
* **McKinsey & Deloitte** (Business Intelligence)
* **OECD** (Social Data)
---
## β¨ Key Features
### π§ Advanced AI Capabilities
* **RAG Architecture:** Combines LLM reasoning with semantic document retrieval.
* **Context-Aware:** Remembers previous turns in the conversation.
* **Multi-Source:** Seamlessly integrates diverse institutional reports.
### π Data Management
* **Vector Search:** Powered by **Redis Stack** for millisecond-latency retrieval.
* **Document Support:** PDF, TXT, and DOCX ingestion.
* **Export:** Download chat history as JSON.
### π¨ User Experience
* **Modern UI:** Built with React & Vite (Dark/Light mode).
* **Responsive:** Optimized for mobile and desktop.
---
## ποΈ Architecture
```text
Neurabot/
βββ π backend/ # FastAPI Application (Python)
β βββ app/
β β βββ api/ # REST Endpoints
β β βββ assistants/ # RAG & LLM Logic
β β βββ loader.py # Document Ingestion Script
β β βββ prompts/ # System Instructions
β βββ data/ # Local Document Storage
β βββ pyproject.toml # Poetry Dependencies
β
βββ π frontend/ # React Application (TypeScript)
β βββ src/
β β βββ components/ # UI Components
β β βββ services/ # API Integration
β βββ vite.config.ts # Build Config
β
βββ π³ docker-compose.yml # Container Orchestration- Python 3.11+ (Managed by Poetry)
- Node.js 18+
- Redis Stack (Must support
RedisJSON&RediSearch) - OpenAI API Key
git clone [https://github.com/RezaSbu/Neurabot.git](https://github.com/RezaSbu/Neurabot.git)
cd Neurabotcd backend
# Install dependencies with Poetry
poetry install
# Configure Environment
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY
# Load/Index Documents into Redis
poetry run load
# Start Backend Server
poetry run devcd frontend
# Install dependencies
npm install
# Configure Environment
cp .env.example .env.development
# Start Frontend Server
npm run dev- Frontend:
http://localhost:3000 - Backend Docs:
http://localhost:8000/docs
OPENAI_API_KEY=sk-...
REDIS_URL=redis://localhost:6379
ENVIRONMENT=development
LOG_LEVEL=INFOVITE_API_URL=http://localhost:8000
VITE_APP_NAME=NeurabotTo train the bot on your own data:
- Place your
PDForTXTfiles inbackend/data/docs/. - Run the ingestion script:
poetry run load
Edit backend/app/assistants/prompts.py to change the system persona:
SYSTEM_PROMPT = """
You are an expert Technical Consultant.
Answer strictly based on the provided context.
"""Adjust parameters in backend/app/config.py:
MODEL_CONFIG = {
"model": "gpt-4",
"temperature": 0.1, # Lower for more factual answers
"max_tokens": 2000
}For production deployment using Docker Compose:
# Build and start services
docker-compose up -d --build
# Scale backend (optional)
docker-compose up -d --scale backend=3Production Configuration (docker-compose.prod.yml):
Ensure REDIS_URL points to the container name (redis:6379) and ENVIRONMENT is set to production.
| Component | Command |
|---|---|
| Backend | cd backend && poetry run pytest |
| Frontend | cd frontend && npm test |
| API (Curl) | curl -X POST http://localhost:8000/chat ... |
- Fork the repository.
- Create a feature branch (
git checkout -b feature/amazing-feature). - Commit your changes.
- Run tests (
poetry run pytest). - Open a Pull Request.
- Multi-Language Support: Internationalization (i18n).
- Voice Integration: Speech-to-text and TTS.
- Plugins: Third-party tool integration.
- Mobile App: Native iOS/Android wrapper.
- Issues: GitHub Issues
This project is licensed under the MIT License.
Built with β€οΈ by Reza Ahmadi