How shawon-aminul/diu_admission_chatbot works
DIU Admission RAG turns approved, verified admission posts into searchable chunks and answers applicant questions with retrieved sources. The principal path is editorial verification → background ingestion → hybrid retrieval → grounded chat; applicants can also request retrieval-only results. The README additionally documents streaming answers and the ingestion dashboard. Relationships below follow shown calls or README statements; unsampled subsystems are represented only where documented.
Main entry points: retriever.py Hybrid retriever · chain.py RAG chat chain · pipeline.py Ingest pipeline · documents.py Document workflow
Components 24
Editorial and Ingestion
- Document workflow
app/api/documents.py - Post repository
app/database/repositories.py - Ingest pipeline
app/ingestion/pipeline.py - Text chunker
app/ingestion/chunker.py
Hybrid Retrieval
- Hybrid retriever
app/rag/retriever.py - Cosine search
app/rag/cosine_search.py - Full-text search
app/rag/bm25_search.py - Rank fusion
app/rag/hybrid_search.py - Retriever adapter
app/rag/langchain_retriever.py
Grounded Answers
- Chat and search API
app/api/chat.py - RAG chat chain
app/rag/chain.py - Language selection
app/rag/language.py - Grounding prompts
app/rag/prompts.py - Local generation client
app/llm/__init__.py - Chat interface
app/static/chat.html
Application Platform
- FastAPI routes
app/main.py - Embedding client
app/embeddings/client.py - Local embedding service
app/embeddings/service.py - PostgreSQL + pgvector
app/database/connection.py - Request dependencies
app/api/dependencies.py - Ingestion dashboard
app/static/index.html
Other components
- Editorial staff
- Applicant
- Ollama
Connections 27
- Editorial staff → Document workflow: submits posts
README.md - Document workflow → Post repository: updates workflow
app/api/documents.py - Document workflow → Ingest pipeline: queues ingest
app/api/documents.py - Ingest pipeline → PostgreSQL + pgvector: reads and writes
app/ingestion/pipeline.py - Ingest pipeline → Text chunker: chunks text
app/ingestion/pipeline.py - Ingest pipeline → Embedding client: embeds chunks
app/ingestion/pipeline.py - Embedding client → Local embedding service: requests vectors
app/embeddings/client.py - Post repository → PostgreSQL + pgvector: queries posts
- Applicant → Chat and search API: asks or searches
README.md - Chat and search API → Request dependencies: resolves handlers
app/api/chat.py - Request dependencies → Hybrid retriever: provides search
app/api/dependencies.py - Request dependencies → RAG chat chain: provides chat
app/api/dependencies.py - Hybrid retriever → Embedding client: embeds query
app/rag/retriever.py - Hybrid retriever → PostgreSQL + pgvector: loads candidates
app/rag/retriever.py - Hybrid retriever → Cosine search: runs vector branch
app/rag/retriever.py - Hybrid retriever → Full-text search: runs text branch
app/rag/retriever.py - Hybrid retriever → Rank fusion: fuses rankings
app/rag/retriever.py - RAG chat chain → Retriever adapter: retrieves context
app/rag/chain.py - Retriever adapter → Hybrid retriever: delegates search
app/rag/langchain_retriever.py - RAG chat chain → Language selection: selects language
app/rag/chain.py - RAG chat chain → Grounding prompts: builds prompt
app/rag/chain.py - RAG chat chain → Local generation client: generates answer
app/rag/chain.py - Local generation client → Ollama: calls local model
README.md - Chat and search API → Chat interface: serves chat page
- Editorial staff → Ingestion dashboard: uses dashboard
README.md - FastAPI routes → Chat and search API: mounts routes
app/main.py - FastAPI routes → Document workflow: mounts routes
app/main.py