TRA Chatbot - Tanzania Revenue Authority AI Assistant An intelligent chatbot system designed to provide accurate information about Tanzania Revenue Authority (TRA) regulations, tax procedures, and compliance requirements. Built with FastAPI backend and powered by advanced AI models for contextual understanding and response generation.
TRA Chatbot - Tanzania Revenue Authority AI Assistant
An intelligent chatbot system designed to provide accurate information about Tanzania Revenue Authority (TRA) regulations, tax procedures, and compliance requirements. Built with FastAPI backend and powered by advanced AI models for contextual understanding and response generation.
Overview
The TRA Chatbot leverages document processing, vector databases, and large language models to provide precise answers about:
Tax registration procedures
Import/export regulations
Compliance requirements
Payment processes
Business registration guidelines
Features
Document Processing: Automatic extraction and indexing of PDF and DOCX files
Vector Search: FAISS-based similarity search for relevant document retrieval
Contextual Understanding: Multi-level query analysis and classification
Session Management: Persistent conversation tracking with PostgreSQL
Smart Summarization: Automatic conversation summarization for context retention
Multi-Model AI: DeepSeek for reasoning and GPT-3.5 for summarization
Tech Stack
Backend
FastAPI - Modern Python web framework
PostgreSQL - Session and conversation storage
FAISS - Vector database for document similarity search
LangChain - AI/ML pipeline orchestration
AI/ML Components
HuggingFace Embeddings - sentence-transformers/paraphrase-mpnet-base-v2
DeepSeek R1 - Main reasoning and response generation
GPT-3.5 Turbo - Conversation summarization
OpenRouter API - LLM access layer
Document Processing
PyMuPDF (fitz) - PDF text extraction
python-docx - DOCX document processing
RecursiveCharacterTextSplitter - Document chunking