How truongvi-ute/student-information-assistant-ai-service works
SIA AI Service exposes document ingestion, vector search, and cited RAG chat for a Student Information Assistant. The main workflow accepts supported files, extracts and chunks their text, embeds and stores the chunks in Qdrant, then embeds user queries, retrieves relevant chunks, and generates answers with citations. The README also documents CLI batch ingestion and collection statistics. Relationships are grounded in excerpts, the SOURCE INDEX, or README; inference details not shown in excerpts are limited to indexed references and documentation.
Main entry points: pipeline.py Ingestion Pipeline · qdrant.py Qdrant Client Layer · main.py FastAPI App · generator.py RAG Answer Generation
Components 19
API and Entrypoints
- FastAPI App
app/main.py - Document Routes
app/api/v1/routers/documents.py - Chat and Search Routes
app/api/v1/routers/chat.py - Health Routes
app/api/v1/routers/health.py - Batch Ingestion CLI
scripts/ingest.py
Document Ingestion
- Document Loading
app/services/ingestion/loader.py - Format Converters
app/services/ingestion/converters.py - Text Chunking
app/services/ingestion/chunker.py - Ingestion Pipeline
app/services/ingestion/pipeline.py - Document Models
app/schemas/document.py
RAG Inference
- Vector Retrieval
app/services/inference/retriever.py - RAG Answer Generation
app/services/inference/generator.py - Prompt Templates
app/services/inference/prompts.py - Response Models
app/schemas/response.py
Vector and Models
- Embedding Service
app/services/embedding.py - Qdrant Client Layer
app/db/qdrant.py
Other components
- API Client
- Qdrant Vector DB
- Google Gemini
Connections 21
- API Client → FastAPI App: sends requests
README.md - FastAPI App → Document Routes: registers routes
app/main.py - FastAPI App → Chat and Search Routes: registers routes
app/main.py - FastAPI App → Qdrant Client Layer: initializes collection
app/main.py - Document Routes → Ingestion Pipeline: ingests uploads
app/api/v1/routers/documents.py - Document Routes → Qdrant Client Layer: reads statistics
app/api/v1/routers/documents.py - Batch Ingestion CLI → Ingestion Pipeline: runs ingestion
scripts/ingest.py - Ingestion Pipeline → Document Loading: loads files
app/services/ingestion/pipeline.py - Document Loading → Format Converters: converts formats
app/services/ingestion/loader.py - Ingestion Pipeline → Text Chunking: splits documents
app/services/ingestion/pipeline.py - Ingestion Pipeline → Embedding Service: embeds chunks
app/services/ingestion/pipeline.py - Ingestion Pipeline → Qdrant Client Layer: upserts vectors
app/services/ingestion/pipeline.py - Qdrant Client Layer → Qdrant Vector DB: manages collection
app/db/qdrant.py - Embedding Service → Google Gemini: requests embeddings
app/services/embedding.py - Chat and Search Routes → Vector Retrieval: searches chunks
app/api/v1/routers/chat.py - Chat and Search Routes → RAG Answer Generation: requests answers
app/api/v1/routers/chat.py - Vector Retrieval → Embedding Service: embeds query
app/services/inference/retriever.py - Vector Retrieval → Qdrant Client Layer: queries vectors
app/services/inference/retriever.py - RAG Answer Generation → Vector Retrieval: retrieves context
app/services/inference/generator.py - RAG Answer Generation → Prompt Templates: uses templates
app/services/inference/generator.py - RAG Answer Generation → Google Gemini: generates answer