How hemakshijain25/retrieval-augmented-generation works
This is a PDF question-answering application with two Python implementations: a Gradio upload-and-question interface and a standalone backend script. The main user workflow is to upload a PDF, extract and split its text, store vector and graph representations in Neo4j, then retrieve both forms of evidence for a Claude-generated answer. The graph preserves those distinct ingestion and retrieval stages. The excerpts show key calls, but omit some orchestration code; README statements support the broader hybrid-RAG capability.
Main entry points: backend.py Backend Script · frontend+backend.py Vector Store
Components 17
PDF Ingestion
- PDF Extraction
frontend+backend.py - Text Chunking
frontend+backend.py - Text Embeddings
frontend+backend.py - Graph Extraction
frontend+backend.py
Knowledge Stores
- Vector Store
frontend+backend.py - Knowledge Graph
frontend+backend.py - Neo4j
Question Answering
- Question Handling
frontend+backend.py - Vector Retrieval
frontend+backend.py - Graph Retrieval
frontend+backend.py - Context Assembly
frontend+backend.py - Claude LLM
- Answer Output
frontend+backend.py
Application Interfaces
- Gradio UI
frontend+backend.py - UI Handlers
frontend+backend.py - Backend Script
backend.py
Other components
- User
Connections 27
- User → Gradio UI: uses
README.md - Gradio UI → UI Handlers: dispatches
frontend+backend.py - UI Handlers → PDF Extraction: processes upload
frontend+backend.py - PDF Extraction → Text Chunking: splits text
frontend+backend.py - Text Chunking → Vector Store: stores chunks
frontend+backend.py - Text Embeddings → Vector Store: embeds chunks
frontend+backend.py - Text Chunking → Graph Extraction: transforms chunks
frontend+backend.py - Graph Extraction → Knowledge Graph: adds graph data
frontend+backend.py - Vector Store → Neo4j: persists vectors
frontend+backend.py - Knowledge Graph → Neo4j: queries graph
frontend+backend.py - User → Question Handling: asks question
README.md - Question Handling → Vector Retrieval: retrieves chunks
frontend+backend.py - Vector Retrieval → Vector Store: searches similar
frontend+backend.py - Question Handling → Graph Retrieval: queries graph
frontend+backend.py - Graph Retrieval → Knowledge Graph: runs Cypher
frontend+backend.py - Question Handling → Context Assembly: combines evidence
frontend+backend.py - Vector Retrieval → Context Assembly: supplies context
frontend+backend.py - Graph Retrieval → Context Assembly: supplies graph facts
frontend+backend.py - Context Assembly → Claude LLM: prompts
frontend+backend.py - Claude LLM → Answer Output: generates
frontend+backend.py - Answer Output → Gradio UI: displays
frontend+backend.py - Backend Script → Vector Store: creates store
backend.py - Backend Script → Knowledge Graph: builds graph
backend.py - Backend Script → Vector Retrieval: runs retrieval
backend.py - Backend Script → Graph Retrieval: runs retrieval
backend.py - Backend Script → Context Assembly: combines results
backend.py - Backend Script → Claude LLM: generates answer
backend.py