Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

narydrakotonirina-ai/FandriantanyAI-RAG-backend

Domain:

natural language processing

Record type:

software
Creator:
nar
Host:
FandriantanyAI-RAG-backend est une API FastAPI implémentant un pipeline RAG (Retrieval-Augmented Generation) pour l’assistance juridique foncière à Madagascar. Le système combine recherche vectorielle (Supabase + pgvector) et génération de réponses structurées via Groq (Qwen). # FandriantanyAI-RAG-backend FandriantanyAI-RAG-backend est une API FastAPI implémentant un pipeline RAG (Retrieval-Augmented Generation) pour l’assistance juridique foncière à Madagascar. Le système combine recherche vectorielle (Supabase + pgvector) et génération de réponses structurées via Groq (Qwen). Ce projet permet de répondre à des questions juridiques en s'appuyant exclusivement sur des textes légaux (lois foncières, code du travail, etc.) en combinant recherche vectorielle et génération par LLM. Il permet de répondre à des questions juridiques en s'appuyant sur : - 🔎 Recherche hybride (vectorielle + texte) - 🧠 LLM Groq (Qwen) - 🗄️ Base vectorielle Supabase (pgvector) --- # 🚀 Fonctionnalités ✅ Recherche sémantique sur corpus juridique ✅ Pipeline RAG complet (triage → retrieval → génération) ✅ Réponses structurées : - Situation - Risques - Démarches ✅ Cache des réponses ✅ Gestion des erreurs et fallback ✅ Optimisation coûts LLM (limite tokens) --- # 🏗️ Architecture ```text ┌─────────────────────┐ │ Frontend UI │ │ (chat utilisateur) │ └─────────┬───────────┘ │ ▼ ┌─────────────────────┐ │ FastAPI API │ │ /ask /search │ └─────────┬───────────┘ ┌─────────┼───────────┐ ▼ ▼ ┌─────────────┐ ┌──────────────┐ │ Supabase │ │ Groq │ │ PostgreSQL │ │ Qwen LLM │ │ + pgvector │ │ │ └─────────────┘ └──────────────┘ ``` # 🔄 Pipeline RAG ## 1️⃣ Triage (LLM - Groq) - classification du type de problème - détection hors périmètre - reformulation de la requête ## 2️⃣ Retrieval (Supabase) - recherche vectorielle (pgvector) - top_k = 5 chunks - filtre de qualité : `score >= 0.15` # 📦 Stack technique - ⚡ FastAPI - 🗄️ Supabase (PostgreSQL + pgvector) - 🤖 Groq (Qwen LLM) - 🔎 SentenceTransformers (embeddings) - ⚙️ Cachetools (cache mémoire) - 🚀 Railway (déploiement) # 📁 Structure du projet backend/ ├── main.py ├── requirements.txt # ⚙️ Installation locale ## 1. Cloner ```bash git c …

Visit

github.com

Licenses

GPL-3.0