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.

Kelvin-ndungu/Agentic_RAG_Diabetes_Knowledge-ManagementSystem

Domain:

healthcarenatural language processing

Record type:

softwareproject
Creator:
Kel
Host:
This project converts the Kenya National Clinical Guidelines for the Management of Diabetes (2nd Edition, 2018) from PDF into a searchable, navigable knowledge system with RAG-powered chat capabilities. Every response includes clickable citations linking directly to source sections, ensuring users can verify information at its source. # Agentic RAG with Structured Outputs for Medical Knowledge Management An **agentic RAG system** built with **LangChain**, **LangGraph**, and **Pydantic-enforced structured outputs** that transforms clinical guidelines into a verifiable knowledge base. This project demonstrates production-grade LLM engineering: optimized multi-agent orchestration, type-safe state machines, vector retrieval with HNSW indexing, and structured generation. ## Demo ## Core Architecture: Optimized RAG Pipeline This system implements an **optimized RAG pipeline** using **LangChain** and **LangGraph** with a streamlined 2-LLM-call architecture: 1. **Unified Classification** → Single LLM call handles query understanding, intent rephrasing, safety checks, and routing 2. **Programmatic Retrieval** → Vector search based on classified intent (no LLM calls) 3. **Citation-Aware Generation** → Single LLM call generates answers with numbered citations 4. **Structured Outputs** → Pydantic models ensure type-safe, validated responses ### Optimized Workflow Efficiency The workflow minimizes LLM calls to reduce latency and cost: - **Non-substantive queries** (greetings, system questions, irrelevant, unsafe): 1 LLM call (classifier only) - **Substantive queries**: 2 LLM calls (classifier + generator) This optimization is critical for production systems where every LLM call adds latency and cost. By consolidating classification logic into a single call and using programmatic retrieval, the system achieves 60-75% faster response times compared to multi-step approaches while maintaining accuracy. ### Structured Outputs: Type Safety and Reliability The system uses **Pydantic models** to enforce structured, validated outputs from LLM calls. This is essential because: - **Production reliability**: Raw LLM outputs are unpredictable strings. Structured outputs ensure every response matches a validated schema, preventing runtime errors and inconsistent data formats - **Type safety**: IDE autocomplete …

Visit

github.com

Tasks

information retrievalquestion answering

Licenses

MIT

Similar

isaac-ndungu/hansard_analyzerChris-Ndungu/African-Market-Intelligencemercy-ndungu/kenya-health-fairness-auditKelvin-Wepo/Rafiki.aikelvin-ahiakpor/cultivateKelvin-kalu/Nairobi_Quickmart_Coverage

isaac-ndungu/hansard_analyzer

A civic intelligence platform that transforms Kenya's official parliamentary records into searchable

Chris-Ndungu/African-Market-Intelligence

# 🌍 African Market Intelligence Pipeline > **Automated macroeconomic data pipeline covering 54 Afri

mercy-ndungu/kenya-health-fairness-audit

# Kenya Health Infrastructure Analysis ## A Human-Centered AI Research Project ### Project Overvie

Kelvin-Wepo/Rafiki.ai

A voice-powered AI assistant for Kenya's eCitizen government services platform. Features natural lan

kelvin-ahiakpor/cultivate

Agent-as-a-Service platform enabling agronomists to train configurable AI agents that scale agricult

Kelvin-kalu/Nairobi_Quickmart_Coverage

GIS analysis of Quickmart supermarket coverage and population density in Nairobi, Kenya # 🗺️ Nairob