Khadamet: AI-Powered Legal & Administrative Assistant for Tunisia
π Project Overview
Track: Tunisia's Legal and Administrative Systems
Khadamet is an innovative AI-powered web application designed to democratize access to legal and administrative guidance in Tunisia. By bridging the gap between complex bureaucratic procedures and everyday citizens, Khadamet empowers users to navigate the transition from informal to formal work with confidence and ease.
π Project Summary
Khadamet serves as a comprehensive digital assistant that simplifies Tunisia's complex legal and administrative landscape. The platform offers:
- Multilingual Support: Arabic, Tunisian Dialect, French, and English
- Voice-Driven Interface: Speech-to-text and text-to-speech capabilities
- Multimodal Interaction: Text, image, and video processing
- Specialized Domains: Auto-Entrepreneur registration, CNSS enrollment, banking procedures, and legal consultations
- Advanced AI Features: Document extraction, Retrieval-Augmented Generation (RAG), and specialized legal expertise
The application stores uploaded images in FAISS vectorstores, enabling context-aware responses through RAG technology. A distinctive "Legal Expert" feature connects users with a fine-tuned LLM specialized in Tunisian legal codes and laws.
Impact: Khadamet enhances accessibility for informal workers, reduces administrative burden on public institutions, and promotes inclusive economic growth while supporting Tunisia's digital transformation agenda.
π― Project Links & Resources
πΊ Demo & Presentation
- Demo Video (2-3 min): Watch on SharePoint
- Presentation Slides: View on Canva
π Documentation & Code
- Technical Report: Google Docs
- GitHub Repository: View Code
- Dataset: Download from SharePoint
π Live Application
- Live Demo: https://ains.khadamet.com
π€ Elevator Pitch
"Khadamet is an AI-powered web platform designed to simplify the transition from informal to formal work for Tunisian entrepreneurs. By offering multilingual, voice-enabled, and multimodal support, it breaks down the complex legal and administrative procedures required to access the Auto-Entrepreneur system and essential services like CNSS and banking.
With features like document extraction, Retrieval-Augmented Generation (RAG), and direct access to legal experts, our solution empowers usersβespecially freelancers, street vendors, and delivery workersβwith clear, accessible, and affordable guidance.
Khadamet not only reduces the burden on public institutions but also contributes to Tunisia's digital transformation and economic inclusion by making legal and administrative help available to all."
π‘ Project Deep Dive
π― Inspiration
Our motivation stems from real-world challenges faced by Tunisians navigating the Auto-Entrepreneur system. Despite digitization efforts, the transition from informal to formal economy remains complex and discouraging:
- Low Adoption Rates: Complex procedures deter informal workers from registering
- Information Fragmentation: Follow-up steps (CNSS, banking, micro-loans) are poorly documented
- Language Barriers: Information often unavailable in accessible formats
- Cost Barriers: Legal consultations are expensive and inaccessible
We recognized Tunisia's multilingual context and digital transformation goals as opportunities to create an inclusive, AI-powered solution that democratizes legal guidance.
π― What Khadamet Does
Khadamet transforms how Tunisians interact with legal and administrative systems by providing:
- Multilingual Guidance: Support in Arabic, Tunisian Dialect, French, and English
- Voice-First Interface: Speech-to-text and text-to-speech for accessibility
- Multimodal Processing: Text, image, and video input handling
- Context-Aware Responses: RAG system for accurate, relevant information
- Expert Consultations: Access to specialized legal LLM for complex queries
- Step-by-Step Guidance: Visual and audio instructions for procedures
π Technical Architecture
Backend Infrastructure
- Framework: Flask
- Embeddings: SentenceTransformers for text vectorization
- Vector Search: FAISS for efficient similarity search
- Architecture: Hybrid RAG (Retrieval-Augmented Generation)
Frontend Experience
- Technologies: HTML5, CSS3, JavaScript
- UI Libraries: Font Awesome 6.4.0, Google Fonts (Montserrat)
- Markdown Rendering: Marked.js for rich content display
AI & Voice Integration
- Voice Processing: Web Speech API with multi-language support
- Multimodal AI: Groq API for image content extraction
- Conversational AI: OpenAI API for natural language interactions
- Language Detection: franc-min for automatic language identification
Specialized Features
- Legal Expert Module: Dedicated consultation service (Port 5001)
- Visual Guidance: Preloaded videos and images for complex procedures
- Document Processing: Base64 encoding for secure file handling
π§ Technical Challenges Overcome
1. Multilingual Voice Recognition
- Challenge: Inconsistent browser support across Arabic, French, and English
- Solution: Dynamic language detection with intelligent fallback mechanisms
2. Multimodal Performance Optimization
- Challenge: Balancing response speed with processing quality across input types
- Solution: Coordinated API calls with optimized caching strategies
3. Scalable Vector Search
- Challenge: Managing FAISS indexes across diverse legal domains
- Solution: Optimized chunking strategies and hierarchical vectorstore architecture
4. Accessibility Design
- Challenge: Ensuring usability for non-technical users with varying digital literacy
- Solution: Iterative user testing and inclusive UI/UX design principles
π Key Accomplishments
- Social Impact: Created a genuinely inclusive tool addressing real societal needs
- Technical Innovation: Successfully integrated multilingual speech recognition with legal RAG
- Specialized AI: Developed fine-tuned LLM for Tunisian legal consultations
- User Empowerment: Built a platform that truly serves underserved communities
- Accessibility: Designed for users with varying technical backgrounds and languages
π Learning Outcomes
Our development journey enhanced our expertise in:
- Advanced RAG Systems: Deep integration of FAISS with SentenceTransformers
- Multilingual NLP: Handling diverse language inputs and outputs
- Multimodal AI: Coordinating text, voice, and visual processing
- Accessible Design: Creating inclusive interfaces for diverse user bases
- Full-Stack Integration: Synchronizing complex backend logic with intuitive frontends
- User-Centered Development: Building solutions that address real-world problems
π Future Roadmap
Short-Term Goals (3-6 months)
- Knowledge Base Expansion: Integrate additional Tunisian legal documents
- Model Enhancement: Further fine-tune Legal Expert LLM with specialized datasets
- Partnership Development: Collaborate with public institutions and NGOs
Medium-Term Goals (6-12 months)
- Mobile Application: Native iOS/Android apps for enhanced accessibility
- Communication Channels: WhatsApp and SMS integration for broader reach
- Offline Capabilities: Core functionality without internet dependency
Long-Term Vision (1-2 years)
- Regional Expansion: Adapt platform for other North African countries
- AI Advancement: Integrate latest language models and multimodal capabilities
- Ecosystem Integration: Connect with government digital services and databases
π‘οΈ Built With
Core Technologies
AI & ML Stack
- SentenceTransformers: Text embedding generation
- FAISS: Vector similarity search
- OpenAI API: Conversational AI capabilities
- Groq API: Multimodal content processing
APIs & Services
- Web Speech API: Voice recognition and synthesis
- Groq API: Image-to-text extraction
- OpenAI API: Natural language processing
Development Tools
- python-dotenv: Environment variable management
- requests: HTTP API communication
- base64: Secure file encoding
- Marked.js: Markdown parsing and rendering
- franc-min: Automatic language detection
- Font Awesome: Professional iconography
π€ Github Repo
Built With
- api
- base64
- css
- faiss
- flask
- franc-min
- groq
- html
- ispeech-text-to-speech
- javascript
- langchain
- langgraph
- marked.js
- mycaption-speech-to-text
- openai
- python
- python-dotenv
- speech-to-text
- text-to-speech
- tts
Log in or sign up for Devpost to join the conversation.