Logo Lanfrica

Asante-coder/MPA-ASSISTANT---CCM-ACECOR-UCC

Domaine:

environment and energy

Type de record:

software
Créateur:
Asa
Hôte:
# MPA Short Course Intelligence Assistant (RAG Framework) ## Overview This project is a **Retrieval-Augmented Generation (RAG)** application designed to assist Marine Protected Area (MPA) managers and researchers. It allows users to interact with specialized marine policy and spatial planning materials using natural language. The system was developed to bridge the gap between complex coastal governance documentation and real-time decision support, specifically focusing on the **OCPP Marine Protected Areas Short Course** curriculum from the **Centre for Coastal Management (CCM), University of Cape Coast, Ghana.** ## Technical Stack | Component | Module | |---|---| | LLM + Vision OCR | `gpt-4o` via `langchain-openai` | | Embeddings | `text-embedding-3-small` via `langchain-openai` | | Vector Store | `faiss-cpu` (local, no compilation required) | | PDF + Image Extraction | `pymupdf (fitz)` | | Semantic Chunking | `SemanticChunker` via `langchain-experimental` | | Keyword Search | `BM25Retriever` via `rank_bm25` | | Hybrid Retrieval | `EnsembleRetriever` via `langchain-classic` | | Reranking | `FlashrankRerank` via `flashrank` | | Chains & Prompts | `RetrievalQA`, `PromptTemplate` via `langchain-classic` | | Orchestration | `langchain` + `langchain-community` | | Logging | Python `logging` with rotating file handler | | Frontend | `streamlit` | | Environment | `python-dotenv` | ## Key Features - **Vision-Enhanced Ingestion:** Uses GPT-4o Vision to OCR text embedded in images, diagrams, and figures inside PDFs — text that standard PDF loaders miss entirely. - **Hybrid Search:** Combines BM25 keyword matching (40%) with FAISS semantic search (60%) via `EnsembleRetriever` for both precise term matching and conceptual relevance. - **Semantic Chunking:** Splits documents at topic boundaries using `SemanticChunker` instead of fixed character counts, keeping related content together. - **Cross-Encoder Reranking:** FlashRank reranks the top 14 retrieved chunks to the best 5 …