karthik.dev
Back to projects
AI

GP Support Agent

Production-grade deterministic RAG + LangGraph agent for healthcare knowledge bases

PythonLangChainLangGraphRAGAgentic AIEvaluation HarnessHealthcare Knowledge Base

Overview

A production-grade, deterministic RAG + agent architecture built with LangChain and LangGraph, applied to a GP/healthcare-reception knowledge base. Includes an integrated evaluation harness for grounded response measurement — ensuring agent answers are traceable to source documents rather than hallucinated.

Problem

Healthcare reception and GP support requires grounded, auditable answers — hallucinations are unacceptable. Most RAG systems are non-deterministic and lack evaluation harnesses to verify that responses are actually grounded in source documents.

Solution

A deterministic RAG pipeline backed by LangGraph for agent state management, applied to a curated GP/healthcare knowledge base. Every response is verifiable against source chunks. An evaluation harness measures groundedness, coverage, and faithfulness of agent outputs.

Architecture

  1. 1Healthcare knowledge base ingestion — document chunking and embedding
  2. 2LangChain retrieval layer — semantic similarity search over knowledge base
  3. 3LangGraph agent state machine — deterministic conversation and tool-call orchestration
  4. 4Grounded response generation — answers cited to source document chunks
  5. 5Evaluation harness — groundedness, faithfulness, and coverage scoring
  6. 6Deterministic design — reproducible agent behavior across identical inputs

Technical Challenges

  • Ensuring deterministic agent behavior in LangGraph despite LLM temperature variations — solved with structured output schemas and fixed retrieval top-K.
  • Designing a groundedness evaluator that distinguishes faithful paraphrasing from hallucination.
  • Curating a healthcare knowledge base with enough coverage to handle real GP reception query patterns.

Results

  • Functional production-grade RAG + agent system with integrated evaluation harness.
  • Demonstrates deterministic agent architecture applicable to any high-stakes knowledge domain.