Skip to content
nuclearslippersPublic

About

a simple rag system for paper

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

📚 PaperBot — RAG-based QA for Papers

PaperBot lets you upload PDFs, extract and chunk text, generate embeddings, store them in Qdrant, and answer questions via retrieval-augmented generation (RAG) with an LLM.

中文 README


Features

  • Upload PDFs and automatically extract text
  • Chunk text and generate embeddings
  • Store vectors in Qdrant with similarity search
  • Answer questions using RAG over retrieved chunks

Project Structure

  • backend/: FastAPI app for upload, parsing, embeddings, RAG
    • backend/uploads/: Uploaded PDFs (ignored by Git by default)
  • frontend/PaperBot/: Vue-based frontend
  • Doc/: Design docs, deployment notes, and API references

Quick Start (Docker Compose)

  1. git clone the project
git clone git@github.com:nuclearslippers/PaperBot.git

Recommended: start everything with docker-compose (ensure .env is set).

  1. Create backend/.env (example):
# LLM (example)
LLM_API_KEY=sk-xxxxxx
LLM_MODEL_NAME=deepseek-chat
LLM_URL=https://api.example.com/v1/chat/completions

# Embeddings (example)
EMBED_API_KEY=sk-xxxxxx
EMBED_MODEL_NAME=text-embedding-v4
EMBED_URL=https://embed.example.com/v1

# Qdrant
DB_URL=http://qdrant:6333
DB_NAME=mypdf

# URLs (optional)
FRONT_URL=http://localhost:5173
BACK_URL=http://localhost:8000
  1. Start (from repo root):
docker-compose up --build
  1. Stop:
docker-compose down

Local Development

Backend:

# Python 3.10+ or Conda environment is recommended
python -m venv .venv
source .venv/bin/activate
pip install -r backend/requirements.txt

cd backend
uvicorn main:app --reload --host 0.0.0.0 --port 8000

Frontend:

cd frontend/PaperBot
npm install
npm run dev

API (common):

  • POST /upload/: upload PDF (form-data, field name file)
  • POST /query/: RAG query, JSON body: { "question": "..." }

Troubleshooting

  1. Check backend logs (container or local)
  2. Validate .env settings for LLM/Embedding/DB URLs & keys
  3. Run python -m py_compile backend/*.py locally for syntax checks
  4. For upload issues, verify backend/uploads/ permissions and disk space

Contributing

Issues and PRs are welcome. When reporting problems, include logs, repro steps, and sanitized env settings.

See Doc/ for design and API notes.

About

a simple rag system for paper

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages