a comprehensive research platform for ingesting academic documents, building retrieval-augmented research sessions, generating structured insights, and drafting grounded academic content.
NEXUS combines a React/Vite frontend with a FastAPI backend to deliver a full-stack research assistant. It ingests PDF papers, indexes them in Qdrant, and uses an Ollama-compatible LLM for:
- RAG Q&A with inline source citations
- Research intelligence reports (consensus, gaps, contradictions, trends)
- Drafting academic paper sections (abstract, intro, methodology, etc.)
- Exporting final outputs as DOCX or PDF
- Frontend: React 18 + Vite
- Backend: FastAPI (Python)
- Vector store: Qdrant
- Embeddings: BAAI/BGE-M3
- LLM: Ollama-compatible model via local Ollama API
- Storage: SQLite by default, with PostgreSQL recommended for production
- PDF processing: PyMuPDF + pdfplumber
- Export: python-docx, reportlab
- PDF ingestion and automated chunking
- Persistent paper metadata and session management
- Retrieval-augmented question answering with source attribution
- Session-scoped paper libraries and chat history
- Insight report generation for literature synthesis
- Paper section drafting and export to DOCX/PDF
- Docker Compose configuration for local deployment
.
├── backend/
│ ├── .env
│ ├── .env.example
│ ├── api/
│ ├── core/
│ ├── Dockerfile
│ ├── main.py
│ ├── models/
│ ├── requirements.txt
│ ├── services/
│ └── uploads/
├── frontend/
│ ├── Dockerfile
│ ├── index.html
│ ├── package.json
│ ├── src/
│ └── vite.config.js
├── docker-compose.yml
├── requirements.txt
└── README.md
- Python 3.11+
- Node.js 18+ / npm
- Docker & Docker Compose
- Local Ollama server or compatible OpenAI-style model endpoint
- Qdrant accessible on
http://localhost:6333
- Build and start the stack:
docker compose up --build- Open the frontend:
http://localhost:5173
- Backend API ready at:
http://localhost:8000
cd backend
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txtCreate a .env file at backend/.env with the required runtime settings.
cd frontend
npm install
npm run dev -- --hostCreate backend/.env with values like:
OLLAMA_URL=http://localhost:11434
OLLAMA_MODEL=llama3.2:3b
QDRANT_URL=http://localhost:6333
QDRANT_COLLECTION=nexus_papers
DATABASE_URL=sqlite+aiosqlite:///./nexus.db
EMBEDDING_MODEL=BAAI/bge-m3
MAX_CHUNK_SIZE=512
CHUNK_OVERLAP=64
TOP_K_RETRIEVAL=8
UPLOAD_DIR=./uploads
CORS_ORIGINS=http://localhost:5173,http://localhost:3000Note: The backend uses
pydantic-settingsso environment variables should match the field names when uppercased.
POST /api/papers/upload— Upload PDF/TXT filesGET /api/papers— List ingested papersGET /api/papers/{paper_id}— Get paper metadataDELETE /api/papers/{paper_id}— Remove paper and indexed vectors
POST /api/sessions— Create a new research sessionGET /api/sessions— List sessionsGET /api/sessions/{session_id}— Get session details and messagesDELETE /api/sessions/{session_id}— Delete a sessionPUT /api/sessions/{session_id}/papers— Update paper list for a session
POST /api/sessions/{session_id}/query— Stream a RAG-style chat responseGET /api/sessions/{session_id}/insights— Generate research intelligence reportPOST /api/sessions/{session_id}/draft— Draft a paper sectionGET /api/sessions/{session_id}/sections— Retrieve saved sectionsPUT /api/sessions/{session_id}/sections/{type}— Save edited sectionGET /api/sessions/{session_id}/export/{fmt}— Export paper asdocxorpdf
- Replace SQLite with PostgreSQL for reliability and concurrent use.
- Use a managed or dedicated Qdrant deployment for scale.
- Host Ollama on a production server or use a compatible LLM API.
- Serve the frontend build output from a CDN or web server.
- Add authentication, authorization, and request throttling for multi-user deployments.
- Backend routes can be validated with Postman, curl, or automated FastAPI tests.
- Frontend served by Vite for development and
npm run buildfor production packaging.
- Configure
.envfor production endpoints - Run Qdrant with persistent storage
- Build frontend:
npm run build - Serve frontend from a static host or reverse proxy
- Use HTTPS for all API traffic
- Monitor model and vector store health
- Fork the repository
- Create a feature branch
- Add tests and documentation
- Submit a pull request
This repository does not include a license file. Add an appropriate open source license before sharing publicly.