How sheacrow/jev-rag works
Jev RAG turns uploaded PDFs into section trees and semantic chunks, then answers chat questions through Jev-guided hierarchical retrieval and verbatim, cited sentence selection. The graph preserves the documented fallback hierarchy and printed-TOC capabilities. Source excerpts establish the main ingestion, retrieval, client, and storage relationships; unsampled implementation details are omitted where their links are not evidenced.
Main entry points: client.py Jev REST client · pipeline.py Ingestion orchestration · store.py Chunk library · common.py App services
Components 19
User interface
- Chat page
app/Chat.py - PDF upload
app/pages/1_Upload_PDF.py - App services
app/common.py
PDF ingestion
- Text extraction
pdf_ingestion/extract.py - Section hierarchy
pdf_ingestion/hierarchy.py - Semantic chunking
pdf_ingestion/chunking.py - Ingestion orchestration
pdf_ingestion/pipeline.py - Printed TOC reader
pdf_ingestion/printed_toc.py - Bookmark writer
scripts/add_outline.py
Retrieval and answers
- Answer assembly
retrieval/answer.py - Hierarchical retriever
retrieval/hierarchical.py
Jev integration
- Jev REST client
jev/client.py - Typed API models
jev/models.py - Offline mock
jev/mock.py
Document storage
- Chunk library
storage/store.py - Ingested document files
chunks
Other components
- Reader / uploader
- TypeSafe Jev API
- Source PDFs
raw_data
Connections 29
- Reader / uploader → Chat page: asks questions
README.md - Reader / uploader → PDF upload: uploads PDFs
README.md - Chat page → App services: gets services
app/Chat.py - Chat page → Answer assembly: requests answers
app/Chat.py - Answer assembly → Hierarchical retriever: retrieves passages
retrieval/answer.py - Answer assembly → Jev REST client: scores sentences
retrieval/answer.py - Answer assembly → Chunk library: reads citations
retrieval/answer.py - Hierarchical retriever → Jev REST client: ranks choices
retrieval/hierarchical.py - Hierarchical retriever → Chunk library: reads chunks
retrieval/hierarchical.py - App services → Chunk library: loads library
app/common.py - App services → Jev REST client: creates client
app/common.py - App services → Offline mock: selects offline mode
app/common.py - PDF upload → Ingestion orchestration: starts ingestion
app/pages/1_Upload_PDF.py - PDF upload → Chunk library: manages documents
app/pages/1_Upload_PDF.py - Source PDFs → Ingestion orchestration: provides input
README.md - Ingestion orchestration → Text extraction: extracts lines
pdf_ingestion/pipeline.py - Ingestion orchestration → Section hierarchy: builds tree
pdf_ingestion/pipeline.py - Ingestion orchestration → Semantic chunking: creates chunks
pdf_ingestion/pipeline.py - Ingestion orchestration → Chunk library: persists output
pdf_ingestion/pipeline.py - Text extraction → Section hierarchy: supplies lines
pdf_ingestion/hierarchy.py - Section hierarchy → Semantic chunking: provides sections
pdf_ingestion/chunking.py - Printed TOC reader → Section hierarchy: provides headings
pdf_ingestion/printed_toc.py - Bookmark writer → Printed TOC reader: reads printed TOC
scripts/add_outline.py - Chunk library → Ingested document files: reads and writes
storage/store.py - Jev REST client → Typed API models: validates requests
jev/client.py - Jev REST client → TypeSafe Jev API: sends API requests
jev/client.py - TypeSafe Jev API → Jev REST client: returns typed results
jev/client.py - Offline mock → Typed API models: validates mock requests
jev/mock.py - Offline mock → Jev REST client: provides offline transport