Chatbot que responde preguntas sobre tus propios documentos PDF usando RAG (Retrieval-Augmented Generation) con OpenAI y ChromaDB. Incluye interfaz web oscura con soporte de Markdown y memoria de conversación.
RAG permite al chatbot responder basándose únicamente en tus documentos. En vez de responder de memoria, busca los fragmentos más relevantes de tus PDFs y los usa para generar la respuesta, evitando alucinaciones.
- Interfaz web oscura estilo ChatGPT
- Respuestas formateadas en Markdown (listas, negritas, títulos)
- Memoria de conversación (recuerda preguntas anteriores)
- Búsqueda semántica con embeddings de OpenAI
- Base de datos vectorial con ChromaDB
- API REST con FastAPI
- Frontend en React con Vite
- Python 3.9+
- Node.js 20.19+
- Una API key de OpenAI (platform.openai.com)
git clone https://github.com/nilferran/rag-chatbot.git
cd rag-chatbotpython -m venv venv
venv\Scripts\activate
python -m ensurepip
python -m pip install openai chromadb fastapi uvicorn python-dotenv pypdfCrea un archivo llamado .env y escribe dentro:
OPENAI_API_KEY=tu_api_key_aqui
cd frontend
npm install
cd ..Copia tus archivos PDF dentro de la carpeta docs/
python -m app.ingestuvicorn app.main:app --reloadcd frontend
npm run devhttp://localhost:5173
rag-chatbot/
├── app/
│ ├── __init__.py
│ ├── ingest.py ← indexa los PDFs en ChromaDB
│ ├── query.py ← busca y responde usando el LLM
│ └── main.py ← servidor FastAPI
├── frontend/
│ └── src/
│ ├── components/
│ │ ├── Chat.jsx
│ │ ├── Message.jsx
│ │ └── InputBar.jsx
│ └── App.jsx
├── docs/ ← pon aquí tus PDFs
├── .env ← tu API key (no se sube a GitHub)
└── requirements.txt
- OpenAI API (embeddings + GPT-4o-mini)
- ChromaDB
- FastAPI
- React + Vite
- react-markdown
Chatbot that answers questions based on your own PDF documents using RAG (Retrieval-Augmented Generation) with OpenAI and ChromaDB. Includes a dark web interface with Markdown support and conversation memory.
RAG allows the chatbot to answer based only on your documents. Instead of answering from memory, it searches the most relevant fragments from your PDFs and uses them to generate the response, avoiding hallucinations.
- Dark web interface inspired by ChatGPT
- Markdown-formatted responses (lists, bold, titles)
- Conversation memory (remembers previous questions)
- Semantic search with OpenAI embeddings
- Vector database with ChromaDB
- REST API with FastAPI
- React + Vite frontend
- Python 3.9+
- Node.js 20.19+
- An OpenAI API key (platform.openai.com)
git clone https://github.com/nilferran/rag-chatbot.git
cd rag-chatbotpython -m venv venv
venv\Scripts\activate
python -m ensurepip
python -m pip install openai chromadb fastapi uvicorn python-dotenv pypdfCreate a file called .env and write inside:
OPENAI_API_KEY=your_api_key_here
cd frontend
npm install
cd ..Copy your PDF files inside the docs/ folder
python -m app.ingestuvicorn app.main:app --reloadcd frontend
npm run devhttp://localhost:5173
rag-chatbot/
├── app/
│ ├── __init__.py
│ ├── ingest.py ← indexes PDFs into ChromaDB
│ ├── query.py ← searches and responds using LLM
│ └── main.py ← FastAPI server
├── frontend/
│ └── src/
│ ├── components/
│ │ ├── Chat.jsx
│ │ ├── Message.jsx
│ │ └── InputBar.jsx
│ └── App.jsx
├── docs/ ← put your PDFs here
├── .env ← your API key (not uploaded to GitHub)
└── requirements.txt
- OpenAI API (embeddings + GPT-4o-mini)
- ChromaDB
- FastAPI
- React + Vite
- react-markdown