Logo Lanfrica

YoucefDjenfi/DCIT-Bot

Type de record:

software
Créateur:
You
Hôte:
Discord chatbot specializing in Algerian cyber law, digital citizenship, and IT offences using RAG (BM25 + embeddings + cross‑encoder). Built for ESI Alger's "Citoyenneté Numérique et IA" module. Answers in French (the module's language). # 🤖 DCIT Bot – Algerian Cyber Law Assistant A Discord bot that answers questions about Algerian cyber law, digital citizenship, and IT offences. Built for ESI Alger's **Citoyenneté Numérique et IA** module. It uses a hybrid RAG pipeline (BM25 + embeddings + cross‑encoder) grounded in official legal texts. --- ## ✨ Features ### ⚖️ Cyber‑Law Assistant - `/ask-law ` — Ask about Algerian cyber law (French or English) - `/law-help` — Show what the bot knows and how to use it The assistant never invents laws — it only answers from the provided PDFs. It cites articles and penalties directly from the texts. > 📘 **Language note:** This bot is engineered to answer **in French**, because the DCIT ("Citoyenneté Numérique et IA") module is the only course at ESI Alger officially taught in French. English and Arabic questions are accepted but the answer will always be in French. --- ## ⚖️ How the RAG Assistant Works ```markdow knowledge_base/ (PDFs) │ ▼ ingest.py ──── pypdf (text extraction + boilerplate cleaning) ── article‑aware chunking ── paraphrase‑multilingual‑MiniLM‑L12‑v2 (embeddings) ── ChromaDB (vector DB with priority metadata) ── BM25 index (keyword search) │ ▼ rag_query.py ──── query expansion (Nmap → "394 bis accès frauduleux") ── cosine retrieval + BM25 retrieval ── Reciprocal Rank Fusion (RRF) ── forced TIC fetch for security queries ── cross‑encoder reranking (mmarco‑mMiniLMv2) ── priority boost (P1 docs) ── Groq API / Llama 3.3 70B │ ▼ bot/cogs/cyber_law_ai.py ──── /ask-law, /law-help ``` --- **Key design decisions:** - **Hybrid search** (cosine + BM25) ensures both semantic meaning and exact keywords (e.g., "394 bis") are used. - **Forced TIC fetch** for security‑related queries guarantees that the criminal law articles (394 bis–394 nonies) are always in the context. - **Cross‑encoder reranking** improves relevance over pure embedding similarity. - **Priority boost** gives core laws higher final scores. --- ## 📚 Knowledge Base The bot relies on …