# NexusRAG

A hybrid retrieval-augmented generation system combining vector search, a knowledge graph and cross-encoder reranking, with document parsing, image and table captioning, and inline citations.

NexusRAG combines vector search, a knowledge-graph component, and cross-encoder reranking into one retrieval-augmented generation pipeline, powered by Gemini, local Ollama models, or fully offline sentence-transformer embeddings. Users upload documents, ask questions, and receive answers with inline citations back to specific pages and headings.

It parses documents with either Docling or Marker, switchable through configuration, preserving headings, page boundaries, formulas and layout rather than extracting plain text; images and tables are extracted and captioned by a vision-capable model and embedded as searchable vectors rather than being discarded. Retrieval runs three ways in parallel: vector similarity over-fetching, knowledge-graph entity lookup through LightRAG, and cross-encoder reranking, and citations carry a short identifier along with a page number and heading path so an answer can be traced back into a document viewer.

It uses a dual embedding-model setup, a general-purpose embedding model for search alongside a separate embedding model for the knowledge graph, and is built with FastAPI and React with streaming, agentic chat responses.

Website: https://github.com/LeDat98/NexusRAG
