How fangedvampire/white_nights_rag_qa works
This repository is a command-line retrieval-augmented question-answering tool for asking questions about PDFs, with the supplied corpus centered on *White Nights*. Its main workflow loads PDF pages, splits them into overlapping text chunks, builds a vector index, retrieves relevant passages for a question, and generates an answer with source-page citations. Chunk persistence and configuration evaluation are additional capabilities. The graph follows explicit calls in the sampled source; the README contains only an architecture-diagram link, so it provides no further capability or relationship evidence.
Main entry points: pipeline.py RAG pipeline · evaluate.py Configuration evaluation · app.py Interactive CLI · chunking.py Text chunking
Components 12
Question interface
- Interactive CLI
app.py
RAG workflow
- RAG pipeline
src/pipeline.py - PDF page extraction
src/ingest.py - Text chunking
src/chunking.py - Vector index and retrieval
src/embed_index.py - Answer generation
src/generate.py
Corpus and chunks
- PDF corpus
data/pdfs - Saved chunks
data/chunks
Configuration evaluation
- Configuration evaluation
src/evaluate.py - Evaluation questions
eval/test_questions.json - Evaluation results
results/results.csv
Other components
- Questioner
Connections 13
- Questioner → Interactive CLI: asks
app.py - Interactive CLI → RAG pipeline: creates and queries
app.py - RAG pipeline → PDF page extraction: loads pages
src/pipeline.py - PDF corpus → PDF page extraction: supplies PDFs
- RAG pipeline → Text chunking: chunks pages
src/pipeline.py - RAG pipeline → Vector index and retrieval: builds and searches
src/pipeline.py - RAG pipeline → Answer generation: generates answer
src/pipeline.py - RAG pipeline → Interactive CLI: returns answer and sources
app.py - Text chunking → Saved chunks: writes and reads
src/chunking.py - Configuration evaluation → RAG pipeline: evaluates configurations
src/evaluate.py - Configuration evaluation → Answer generation: reuses generator
src/evaluate.py - Evaluation questions → Configuration evaluation: provides test set
src/evaluate.py - Configuration evaluation → Evaluation results: writes metrics
src/evaluate.py