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).
- 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
mem0library 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.
The application is built around a central Runner that orchestrates the conversation between agents.
- Entry Point (
main.py): Initializes the system and allows the user to select the operation mode. - Agents: Each agent is an instance of the
Agentclass, 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.
- Database (
ProfileDB): A simple class that handles all interactions with theprofiles.dbSQLite database, using Pydantic models (MemberProfile) for data validation. - Tools: Functions decorated with
@function_toolthat agents can call to interact with the system's backend (e.g., the database). - Memory (
mem0): Integrated to store and retrieve conversational history, giving agents long-term memory. - Execution Loop (
interactive()&automated()): The core logic that manages the turn-by-turn conversation flow between the user/simulated user and the agents.
Follow these instructions to set up and run the project on your local machine.
- Python 3.8 or higher
pip(Python package installer)
First, clone this repository to your local machine.
git clone https://github.com/anikaa20/elyx-hackathon.git
cd elyx-hackathonIt 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/activateOn Windows:
# Create the virtual environment
python -m venv venv
# Activate the virtual environment
.\venv\Scripts\activateThe 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
The application requires API keys for the LLM providers (Groq and Cerebras).
-
Create a new file named
.envin the root directory of the project. -
Copy and paste the following content into the
.envfile 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:
- Groq: https://console.groq.com/
- Cerebras: https://cloud.cerebras.ai/ (You will need to sign up for access to their models)
Once you have completed the setup, you can run the application with a single command:
python main.pyYou will be greeted with an ASCII art welcome message and prompted to choose a mode:
Enter 1 for Interactive Mode, 2 for Automated Mode:
- Enter
1and pressEnter. - You will take on the role of Rohan Patel.
- The Elyx concierge will greet you and you can start the conversation.
- You can type
/exitor/quitat any time to end the session.
- Enter
2and pressEnter. - 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.