This project is a Customer Relationship Management (CRM) module tailored for Healthcare Professionals (HCP) sales representatives in the life sciences sector. It features a modern, premium Log Interaction Screen offering representatives the ability to log visits conversationally using an AI chat agent or via a traditional structured form, with instant real-time synchronization between the two.
- Structured Interaction Logger: Comprehensive form capture including date/time, attendees, topics, sentiment selector, materials shared, and sample distribution widgets.
- AI Conversational Assistant: Conversational agent powered by LangGraph & Groq (
llama-3.3-70b-versatileorgemma2-9b-it) that parses conversation, extracts entities, and calls sales tools automatically. - 5 LangGraph Agent Tools:
search_hcp: Search HCPs by name, specialty, or clinic.get_hcp_details: Fetch full HCP profile data.get_interaction_history: Check historical logs for a given HCP.log_interaction: Log a new interaction with inferred sentiment and entity extraction.edit_interaction: Modify details of an existing log.
- Voice Note Simulation: Transcribe and extract structured fields from simulated representative voice notes instantly.
- Interaction History Timeline Feed: Color-coded timeline list of interactions with inline edit and delete functionality.
- Modern Premium Theme: Developed with vanilla CSS, implementing Google Inter typography, glassmorphism, visual highlights for sentiments, and micro-animations.
- Frontend: React, Redux Toolkit (state management), Lucide Icons, Vite (build tool), Vanilla CSS.
- Backend: Python, FastAPI, SQLAlchemy ORM, Uvicorn server.
- AI Agent Framework: LangGraph, LangChain Core, LangChain Groq.
- Database: PostgreSQL (running on port 5432) with SQLite fallback support.
- Python 3.10+
- Node.js v18+ & NPM
- PostgreSQL database (or automatic fallback to SQLite
crm_hcp.dbif PostgreSQL is not configured/accessible)
-
Open a terminal and navigate to the backend directory:
cd backend -
Install the required Python packages:
pip install -r requirements.txt
-
Configure environment variables. Edit the
backend/.envfile and insert your Groq API key:DATABASE_URL=postgresql://postgres:postgres@localhost:5432/crm_hcp GROQ_API_KEY=YOUR_GROQ_API_KEY
Note: If PostgreSQL is not active, the database module automatically sets up a fallback SQLite database, allowing the backend to start up without additional database servers.
-
Launch the FastAPI server:
uvicorn main:app --host 127.0.0.1 --port 8000 --reload
The backend will seed mock data on startup and run at
http://127.0.0.1:8000.
- Open a new terminal and navigate to the frontend directory:
cd frontend - Install the dependencies:
npm install
- Launch the Vite dev server:
The frontend application will boot up at
npm run dev
http://localhost:3000.