Skip to content

anikaa20/elyx-hackathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elyx Life AI: Multi-Agent Healthcare Simulation

This project simulates the 8-month healthcare journey of a member, "Rohan Patel," with a futuristic AI-powered healthcare company, "Elyx." It utilizes a sophisticated multi-agent system where different AI agents, each with a unique role and personality, interact with a simulated member. The simulation can be run in an interactive mode (where you play as the member) or an automated mode (where an AI simulates the member).

Core Features

  • Multi-Agent System: Features a team of specialized AI agents including a Concierge, Medical Strategist, Performance Scientist, Nutritionist, and more, each with distinct roles and communication styles.
  • Advanced Member Simulation: An AI agent meticulously simulates the member, "Rohan Patel," based on a detailed persona, including his goals, personality, communication style, and potential friction points.
  • Dual Operation Modes:
    • Interactive Mode: Allows you to step into the shoes of Rohan Patel and interact directly with the Elyx AI team.
    • Automated Mode: Runs a full simulation where the Rohan Patel AI agent interacts with the Elyx AI team, perfect for observing long-term behavior and generating conversational data.
  • Persistent Member Profiles: All member data is captured and stored in a local SQLite database, ensuring continuity across sessions.
  • Conversational Memory: The system leverages the mem0 library to provide agents with memory, allowing them to recall past interactions and maintain context.
  • Function Calling & Tool Use: Agents can use predefined Python tools to perform actions like creating user IDs, saving/retrieving member profiles, and generating mock health reports.
  • Powered by Multiple LLMs: The system is configured to use different Large Language Models (like those available through Groq and Cerebras) for the Elyx team and the simulated member, creating a more dynamic interaction.

System Architecture

The application is built around a central Runner that orchestrates the conversation between agents.

  1. Entry Point (main.py): Initializes the system and allows the user to select the operation mode.
  2. Agents: Each agent is an instance of the Agent class, defined with a specific system prompt that dictates its persona, instructions, and tools.
    • concierge_agent: The primary point of contact that triages requests and hands off to specialists.
    • Specialist Agents (physician_agent, nutrition_agent, etc.): Experts who handle specific domains.
    • user_agent: Simulates "Rohan Patel" in the automated mode.
  3. Database (ProfileDB): A simple class that handles all interactions with the profiles.db SQLite database, using Pydantic models (MemberProfile) for data validation.
  4. Tools: Functions decorated with @function_tool that agents can call to interact with the system's backend (e.g., the database).
  5. Memory (mem0): Integrated to store and retrieve conversational history, giving agents long-term memory.
  6. Execution Loop (interactive() & automated()): The core logic that manages the turn-by-turn conversation flow between the user/simulated user and the agents.

🚀 Getting Started

Follow these instructions to set up and run the project on your local machine.

Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)

Step 1: Clone the Repository

First, clone this repository to your local machine.

git clone https://github.com/anikaa20/elyx-hackathon.git
cd elyx-hackathon

Step 2: Create and Activate a Virtual Environment

It is highly recommended to use a virtual environment to manage project dependencies and avoid conflicts with other Python projects.

On macOS / Linux:

# Create the virtual environment
python3 -m venv venv

# Activate the virtual environment
source venv/bin/activate

On Windows:

# Create the virtual environment
python -m venv venv

# Activate the virtual environment
.\venv\Scripts\activate

Step 3: Install Dependencies

The required Python packages are listed in requirements.txt. Install them using pip.

pip install -r requirements.txt

(Note: If a requirements.txt file is not available, you can create one with the following content and then run the command above)

requirements.txt:

openai
python-dotenv
pydantic
openai-agents
litellm
mem0ai
langchain-ollama
langchain

Step 4: Set Up Environment Variables

The application requires API keys for the LLM providers (Groq and Cerebras).

  1. Create a new file named .env in the root directory of the project.

  2. Copy and paste the following content into the .env file and replace the placeholder text with your actual API keys.

    # .env
    
    # Required ENVIRONMENT VARIABLES
    GROQ_BASE_URL="https://api.groq.com/openai/v1"
    GROQ_API_KEY="your_groq_api_key_here"
    
    CEREBRAS_BASE_URL="https://api.cerebras.ai/v1"
    CEREBRAS_API_KEY="your_cerebras_api_key_here"

You can get your API keys from:

🏃 Running the Application

Once you have completed the setup, you can run the application with a single command:

python main.py

You will be greeted with an ASCII art welcome message and prompted to choose a mode:

Enter 1 for Interactive Mode, 2 for Automated Mode:

1. Interactive Mode

  • Enter 1 and press Enter.
  • You will take on the role of Rohan Patel.
  • The Elyx concierge will greet you and you can start the conversation.
  • You can type /exit or /quit at any time to end the session.

2. Automated Mode

  • Enter 2 and press Enter.
  • The simulation will begin automatically.
  • The AI agent for Rohan Patel will start a conversation with the Elyx Concierge agent.
  • You will see the conversation unfold in your terminal, with a 5-second delay between turns to make it readable.
  • To stop the simulation, press Ctrl + C.

A sample chat is provided in chat.md.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages