How sirius-248/ai-student-academic-mentor-rag works
This is an academic-mentoring RAG application exposed through a FastAPI API and an interactive CLI. Its main workflow indexes PDFs into a vector store, then retrieves relevant chunks to build a prompt, generate an answer, and return source references. The graph preserves both product entry points and the documented tutoring and PDF-processing capabilities. Pipeline orchestration and several service calls are visible in sampled source; API route internals and other unsampled implementations are represented only where the tree or documentation supports them.
Main entry points: rag_pipeline.py RAG pipeline · main.py FastAPI app · retriever.py Semantic retriever · vector_store Vector store
Components 19
User interfaces
- Interactive CLI
app/main.py - FastAPI app
app/api/main.py - Document routes
app/api/routes/documents.py - Question routes
app/api/routes/questions.py
Document indexing
- PDF reader
app/document_reader/pdf_reader.py - Text preprocessing
app/preprocessing/pipeline.py - Text chunker
app/chunking/text_chunker.py
Question answering
- RAG pipeline
app/pipeline/rag_pipeline.py - Semantic retriever
app/retriever/retriever.py - Prompt builder
app/prompt/prompt_builder.py - LLM clients
app/llm - Answer and citations
app/pipeline/answer_response.py
Models and storage
- Embedding service
app/embeddings/embedding_service.py - Embedding providers
app/embeddings - Vector store
app/vector_store - Document chunks
app/models/document_chunk.py - Document registry
app/api/dependencies.py
Other components
- Student
- LLM provider
Connections 24
- Student → Interactive CLI: asks questions
- Student → FastAPI app: uses API
- Interactive CLI → RAG pipeline: indexes and asks
- FastAPI app → Document routes: dispatches
- FastAPI app → Question routes: dispatches
- FastAPI app → Vector store: loads store
- FastAPI app → Document registry: recovers records
- Document routes → RAG pipeline: indexes documents
- Question routes → RAG pipeline: asks questions
- RAG pipeline → PDF reader: extracts text
- RAG pipeline → Text preprocessing: cleans text
- RAG pipeline → Text chunker: creates chunks
- RAG pipeline → Embedding service: embeds chunks
- RAG pipeline → Vector store: adds and saves
- RAG pipeline → Semantic retriever: retrieves context
- Semantic retriever → Embedding service: embeds query
- Semantic retriever → Vector store: searches
- Embedding service → Embedding providers: generates vectors
- Vector store → Document chunks: stores chunks
- Semantic retriever → Prompt builder
- RAG pipeline → Prompt builder: builds prompt
- RAG pipeline → LLM clients: generates answer
- LLM clients → LLM provider: requests generation
- RAG pipeline → Answer and citations: returns answer and sources