Skip to content

AnkitDimri4/ai-first-hcp-interaction-crm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation


AI-First HCP Interaction CRM

An intelligent CRM system for Life Sciences field representatives to log and manage interactions with Healthcare Professionals (HCPs). This AI-First CRM uses a natural language AI assistant to automatically extract structured information from user prompts, eliminating manual form filling and streamlining CRM workflows.



Example Prompts / Testing

  • You can test the AI agent using the following example prompts for each tool:
    • Log Interaction (log_interaction_tool)
      • "I met Dr Smith today at 3 PM for a meeting about Product X efficiency. John from marketing also attended. I shared brochures and the response was positive. We will follow up on 25 March."
    • Edit Interaction (edit_interaction_tool)
      • "Update the last interaction: the HCP name is actually Dr John and the sentiment should be Negative."
      • "For my most recent interaction, change the time to 4 PM and add that we discussed pricing as well."
    • Add Follow-up (add_followup_tool)
      • "Set the follow-up date for the last interaction to 30 March 2026."
      • "Please move the follow-up for my latest interaction to next Monday."
    • Update Materials (update_materials_tool)
      • "Also note that I shared the OncoBoost Phase III PDF in the last meeting."
      • "Update the materials shared for my last interaction to: brochures, OncoBoost Phase III PDF, dosing guidelines."
    • List / Get Interactions (get_interactions_tool)
      • "Show me the last 3 interactions and summarize their sentiments."
      • "List my recent interactions with Dr Smith and tell me the sentiment for each.

Overview

  • Users communicate with an AI assistant through natural language prompts.
  • The backend AI agent (LangGraph + Groq LLM) extracts structured fields:
    • HCP Name, Date, Time, Topics, Materials Shared, Sentiment, Follow-up Actions, Key Outcomes
  • Extracted data is automatically populated in the React CRM form.
  • All interactions are saved in PostgreSQL via SQLAlchemy.

Tech Stack

Layer Technology
Backend FastAPI, Python 3.10+, LangGraph, LangChain, Groq LLM
Database PostgreSQL, SQLAlchemy
Frontend React 18, Redux Toolkit, Axios, CSS
Hosting Render (backend), Vercel (frontend)

Architecture

Architecture

Backend Flow

  1. The frontend sends a POST /agent/chat request with the user’s message.

  2. The LangGraph AI agent decides which tool to invoke:

    • log_interaction – create new interaction
    • edit_interaction – update specific fields
    • get_interactions – fetch recent interactions
    • add_followup – set or move follow-up dates
    • update_materials – update shared materials
  3. Tools read/write data in the PostgreSQL database.

  4. The backend returns structured fields that automatically populate the frontend form.

Frontend Layout

  • Left Panel – AI Chat Assistant

    • Accepts natural language prompts
    • Sends messages to the backend AI agent
    • Receives extracted structured fields
  • Right Panel – Interaction Form

    • Auto-filled by the AI assistant
    • Displays HCP interaction details (e.g., name, date, topics, materials, sentiment, follow-ups) in real-time

Project Structure & Separate READMEs

For detailed setup, architecture, and usage, see the separate README files in the repository:

Each README contains installation instructions, environment variable setup, API documentation (backend), and running the development server (frontend).


Key Features

  • AI-Driven Interaction Logging: Automatically extracts HCP name, date, topics, materials shared, sentiment, follow-up actions, and outcomes from free-text input.
  • Editable Interactions: Update only specified fields without overwriting the entire record.
  • Follow-Up Management: Automatically suggest or adjust follow-up actions.
  • Material Updates: Track and update materials shared during interactions.
  • Summary Retrieval: Fetch and summarize recent interactions for quick review.

Author

Ankit Dimri
Full-Stack & AI Developer
📍 Dehradun, India

GitHub LinkedIn LeetCode

Technologies Used in This Project

Backend

Python FastAPI PostgreSQL SQLAlchemy LangGraph LangChain Groq Status

Frontend

React Redux React Redux Axios CSS Status


Project Info

  • Project: AI-First HCP Interaction CRM
  • Organization: AIVOA
  • Year: 2026


Built with ❤️ by Ankit Dimri

About

🤖AI-first CRM for Healthcare Professional (HCP) interactions. FastAPI + LangGraph + Groq LLM backend with PostgreSQL and a React frontend. Field reps log, edit, and review HCP interactions using natural-language chat only, while the AI agent auto-populates all form fields and follow-ups.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors