Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Isanté Assistant

Intelligent multi-agent chatbot for insurance claims and customer support, built with LangGraph and LangChain. It combines NL2SQL and RAG to give accurate, context-aware answers, with robust memory management for smooth multi-turn conversations.

Final year project (PFE) — insurance/health ("Santé") customer support assistant for adherents (policyholders) and médecins (doctors).


Table of contents


Overview

Isanté Assistant is a conversational agent designed for an insurance/health context. It handles two types of users — adherents (policyholders) and médecins (doctors) — and can:

  • Answer general questions conversationally
  • Handle insurance claims ("réclamations"), distinguishing simple cases from ones that need human intervention
  • Retrieve structured data (user history, policy details) via natural-language-to-SQL
  • Retrieve unstructured knowledge (policy documents, FAQs) via retrieval-augmented generation
  • Maintain conversation memory across turns, with per-user persistent profiles

Multi-agent architecture

The system is orchestrated as a stateful graph (DAG) in LangGraph, with a shared AgentState acting as the whiteboard that every agent reads from and writes to.

Core agents

Agent File Responsibility
Conversational Agent conversationalagent.py First point of contact. Handles general chat and triages intent — decides if a query needs the claims or database agent.
Claims Agent claimsagent.py Handles insurance claim logic; distinguishes simple claims from cases requiring human intervention.
Database Agent databaseagent.py Retrieves structured data (user history, policy details) via NL2SQL.
Final Answer Agent finalansweragent.py Synthesizes the output of the previous agents into a single, coherent response.

Workflow (workflow.py)

  1. Load memory — load the adherent/médecin profile for personalized context.
  2. Ingest input — the user's question enters a fresh turn of state.
  3. Conversational Agent — analyzes the request and routes:
    • to the Claims Agent if the query concerns a claim,
    • to the Database Agent if it needs stored data,
    • or straight to a general answer if it's a simple conversational query.
  4. Claims / Database Agent → Final Answer Agent — whichever specialized agent ran, its output is passed to the Final Answer Agent to build the response.
  5. Summarize & update memory — before ending, the conversation is summarized to control token usage, and the user's persistent memory is updated.

State management

The shared AgentState tracks:

  • User context (adherent_id, medecin_id, etc.)
  • Per-agent message histories (to avoid cross-agent context pollution)
  • A running conversation summary, so follow-up questions work without blowing the context window

Tech stack

  • Backend (smart Backend/) — Python, LangChain, LangGraph
  • Frontend (frontend/) — TypeScript
  • Additional service — Java
  • Data layer — SQL database (via NL2SQL) + vector store for RAG

Project structure

PFE-Project/
├── Isanté-assistant/     # Multi-agent core (LangGraph workflow, agents)
│   ├── conversationalagent.py
│   ├── claimsagent.py
│   ├── databaseagent.py
│   ├── finalansweragent.py
│   └── workflow.py
├── frontend/             # TypeScript client application
├── smart Backend/        # Python backend service(s)
└── .gitignore

Getting started

Prerequisites

  • Python 3.10+
  • Node.js 18+ (for the frontend)
  • A running SQL database (for the Database Agent)
  • An LLM provider API key (e.g. OpenAI/Anthropic — set in your .env)

Installation

# Clone the repo
git clone https://github.com/medlouaynjima/PFE-Project.git
cd PFE-Project

# Backend
cd "smart Backend"
pip install -r requirements.txt

# Frontend
cd ../frontend
npm install

Configuration

Create a .env file in the backend directory with the variables your setup needs, for example:

OPENAI_API_KEY=your_key_here
DATABASE_URL=your_database_connection_string
VECTOR_STORE_PATH=your_vector_store_path

Adjust the variable names above to match what your code actually reads — update this section with your real config keys before publishing.


Running the project

# Start the backend
cd "smart Backend"
python main.py

# Start the frontend (in a separate terminal)
cd frontend
npm run dev

Update the run commands above to match your actual entry points.


Roadmap

  • Add automated evaluation for intent-routing accuracy
  • Add graceful fallback handling for failed DB/RAG lookups
  • Expand human-handoff flow for complex claims
  • Add test coverage for the LangGraph workflow

License

Specify a license for your project (e.g. MIT) here.

About

Intelligent multi-agent chatbot for insurance claims and customer support, built with LangGraph and LangChain. Combines NL2SQL and RAG for accurate, context-aware responses, with robust memory management for efficient multi-turn conversations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages