How aravindg-atwork/admission-poc works
Purpose and entry points
MAFSU Admission Assistant is a multilingual, prospectus-grounded RAG system for three isolated undergraduate programmes. The active implementation is a pure-standard-library Python backend, designed for locked-down Windows hosts; ML capabilities are remote HTTP services. Start via run_backend.py; HTTP composition is in backend/http/app.py, with student chat and operator/admin routes in backend/http/chat_routes.py and backend/http/admin_routes.py.
HTTP UI and access boundary
The backend serves static student and admin interfaces from backend/static/ and dispatches API requests through route modules. Admin functions cover operations, prompts, reviews, costs, and API-key management. Consumer credentials and revocation are handled by backend/storage/apikeys.py; per-project isolation is represented by backend/storage/projects.py.
Project-isolated knowledge boundary
Each programme has separate prospectus-derived data, embeddings/vector store, FAQ cache, stats, and keys under data/projects/. This is the principal anti-cross-contamination boundary. Persistent JSON-oriented storage is implemented in backend/storage/vectorstore.py, backend/storage/faq.py, and backend/storage/stats.py; exact cosine search is appropriate for the small corpus.
Ingestion and retrieval preparation
Prospectus PDFs are converted through OCR and structured into markdown/table-preserving content, then chunked, embedded, topic/section annotated, and persisted. The ingestion pipeline is centered on backend/rag/ingest.py, with document extraction in backend/ocr.py and backend/pdf.py. Embedding calls are abstracted in backend/generation/embeddings.py and target the standalone services/embedding-service/app.py.
Answer orchestration pipeline
A question flows through intent/language/programme logic, ordered guards, FAQ lookup, hybrid retrieval, generation, and deterministic validation. The coordinator is backend/rag/orchestrator.py; routing and guard policy live in backend/rag/router.py and backend/rag/guards.py. Retrieval and grounded answer assembly are in backend/rag/answer.py and backend/rag/citation.py. Guards intentionally precede cache lookup so clarification or safety/policy responses cannot be bypassed.
Generation, multilingual behavior, and external providers
Core deterministic domain logic—including intent, eligibility, programme selection, language, and table lookup—is in backend/core/intent.py, backend/core/eligibility.py, and backend/core/tablelookup.py. Prompt policy is maintained in backend/prompts/system.py and backend/prompts/registry.py. LLM/provider HTTP adapters are in backend/generation/llm.py and backend/generation/providers.py; speech is remote via backend/generation/speech.py, with an optional Indic TTS service at services/indic-tts-service/app.py.
Observability and adjacent integrations
Every answer can carry a trace ID; live trace streaming uses Server-Sent Events via backend/trace/hub.py, backend/trace/events.py, and backend/http/trace_routes.py. OCR is independently deployable at services/ocr-service/app.py. The repository also retains a .NET solution—core RAG abstractions in src/AdmissionAssistant.Core/ and ASP.NET Web API UI in src/AdmissionAssistant.Web/—but the README identifies Python as the current deployment path. A Chrome extension integration sends order-assist interactions through extension/orderassist-assistant/background.js and extension/orderassist-assistant/content.js, backed by backend/orderassist/routes.py.
Main entry points: orchestrator.py Answer orchestrator · app.py HTTP app · ingest.py Prospectus ingestion · admin_routes.py Admin routes
Components 23
Python HTTP backend
- Backend entry point
run_backend.py - HTTP app · Serves static UIs and dispatches routes.
backend/http/app.py - Student chat routes
backend/http/chat_routes.py - Admin routes
backend/http/admin_routes.py - Trace SSE routes
backend/http/trace_routes.py - Trace hub
backend/trace/hub.py
RAG pipeline
- Answer orchestrator · Runs ordered guards, cache, retrieval, generation, and validation.
backend/rag/orchestrator.py - Intent and guard policy · Guards run before FAQ lookup.
backend/rag/router.py - Safety and clarification guards
backend/rag/guards.py - Hybrid retrieval and answers
backend/rag/answer.py - Citation validation
backend/rag/citation.py - Prospectus ingestion · Chunks, annotates, embeds, and persists prospectus content.
backend/rag/ingest.py - PDF and OCR extraction
backend/ocr.py - Deterministic domain logic
backend/core/intent.py - LLM and embedding adapters
backend/generation/llm.py
Project-isolated storage
- Project isolation · Separates the three undergraduate programmes.
backend/storage/projects.py - Programme knowledge stores · Per-project embeddings, prospectus data, FAQ cache, and statistics.
- Consumer API keys · Manages credentials and revocation.
backend/storage/apikeys.py
Remote ML services
- Embedding service
services/embedding-service/app.py - OCR service
services/ocr-service/app.py
Adjacent integrations
- Order-assist integration
backend/orderassist/routes.py - Chrome extension
extension/orderassist-assistant/background.js - Legacy .NET solution · Not the current deployment path.
Connections 24
- Backend entry point → HTTP app: starts
- HTTP app → Student chat routes: dispatches chat
- HTTP app → Admin routes: dispatches admin
- HTTP app → Trace SSE routes: dispatches SSE
- Student chat routes → Answer orchestrator: questions
- Admin routes → Project isolation: manages projects
- Admin routes → Consumer API keys: manages keys
- Answer orchestrator → Intent and guard policy: routes
- Intent and guard policy → Safety and clarification guards: applies first
- Answer orchestrator → Hybrid retrieval and answers: retrieves after guards
- Answer orchestrator → Citation validation: validates output
- Answer orchestrator → Deterministic domain logic: uses domain decisions
- Hybrid retrieval and answers → Programme knowledge stores: searches/cache lookup
- Hybrid retrieval and answers → LLM and embedding adapters: generates grounded response
- LLM and embedding adapters → Embedding service: embeddings
- Prospectus ingestion → PDF and OCR extraction: extracts PDFs
- Prospectus ingestion → Embedding service: embeds chunks
- Prospectus ingestion → Programme knowledge stores: persists by project
- Project isolation → Programme knowledge stores: scopes stores
- Trace SSE routes → Trace hub: streams events
- Answer orchestrator → Trace hub: emits trace
- Chrome extension → Order-assist integration: order-assist requests
- Order-assist integration → Answer orchestrator: uses answer flow
- PDF and OCR extraction → OCR service: optional remote OCR