From 0504c5c288a19e0d788f3921c6dfbb7f15f27000 Mon Sep 17 00:00:00 2001 From: Madhu Date: Sat, 21 Dec 2024 12:27:05 +0530 Subject: [PATCH] added the readme, code, requirements.txt --- .../ai_recruitment_agent_team/.gitignore | 4 - .../ai_recruitment_agent_team/README.md | 103 ++++++++++++++++++ .../ai_recruitment_agent_team.py | 23 +++- .../requirements.txt | 12 ++ 4 files changed, 133 insertions(+), 9 deletions(-) delete mode 100644 ai_agent_tutorials/ai_recruitment_agent_team/.gitignore diff --git a/ai_agent_tutorials/ai_recruitment_agent_team/.gitignore b/ai_agent_tutorials/ai_recruitment_agent_team/.gitignore deleted file mode 100644 index 9b845a2..0000000 --- a/ai_agent_tutorials/ai_recruitment_agent_team/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Environment variables and secrets -.env -.env.* -*.env \ No newline at end of file diff --git a/ai_agent_tutorials/ai_recruitment_agent_team/README.md b/ai_agent_tutorials/ai_recruitment_agent_team/README.md index e69de29..0d99d09 100644 --- a/ai_agent_tutorials/ai_recruitment_agent_team/README.md +++ b/ai_agent_tutorials/ai_recruitment_agent_team/README.md @@ -0,0 +1,103 @@ +# AI Recruitment Agent Team + +An Agentic recruitment system built on phidata and Streamlitthat automates the technical hiring proces which helps the lives of recruiters easy. The agent team consists of multiple specialized agents working together to handle resume analysis, interview scheduling with zoom and candidate communications. + +## Demo + +## Features + +- **Automated Resume Analysis** + - Skills Matching based on the role requirements - [AI/ML Engineer, Frontend Engineer, Backend Engineer] + - Experience Assessment- If the resume clears 70% of the requirements, the candidate is selected for the next round + +- **Automated Communications** + - Acceptance Email and a Technical Interview Email + - Rejection Feedback + - Interview Scheduling with Zoom + +- **Intelligent Scheduling** + - Automated Zoom Meeting Setup + - Timezone Management + - Calendar Integration + - Reminder System + +## Important Things to do before running the application + +- Create/Use a new Gmail account for the recruiter +- Enable 2-Step Verification and generate an App Password for the Gmail account +- The App Password is a 16 digit code (use without spaces) that should be generated here - [Google App Password](https://support.google.com/accounts/answer/185833?hl=en) Please go through the steps to generate the password - it will of the format - 'afec wejf awoj fwrv' (remove the spaces and enter it in the streamlit app) +- Create/ Use a Zoom account and go to the Zoom App Marketplace to get the API credentials : +[Zoom Marketplace](https://marketplace.zoom.us) +- Go to Developer Dashboard and create a new app - Select Server to Server OAuth and get the credentials, You see 3 credentials - Client ID, Client Secret and Account ID +- After that, you need to add a few scopes to the app - so that the zoom link of the candidate is sent and created through the mail. +- The Scopes are meeting:write:invite_links:admin, meeting:write:meeting:admin, meeting:write:meeting:master, meeting:write:invite_links:master, meeting:write:open_app:admin, user:read:email:admin, user:read:list_users:admin, billing:read:user_entitlement:admin, dashboard:read:list_meeting_participants:admin [last 3 are optional] + +## How to Run + +1. **Setup Environment** + ```bash + # Clone the repository + git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git + cd ai_agent_tutorials/ai_recruitment_agent_team + + # Install dependencies + pip install -r requirements.txt + ``` + +2. **Configure API Keys** + - OpenAI API key for GPT-4o access + - Zoom API credentials (Account ID, Client ID, Client Secret) + - Email App Password of Recruiter's Email + +3. **Run the Application** + ```bash + streamlit run ai_recruitment_agent_team.py + ``` + +## System Components + +- **Resume Analyzer Agent** + - Skills matching algorithm + - Experience verification + - Technical assessment + - Selection decision making + +- **Email Communication Agent** + - Professional email drafting + - Automated notifications + - Feedback communication + - Follow-up management + +- **Interview Scheduler Agent** + - Zoom meeting coordination + - Calendar management + - Timezone handling + - Reminder system + +- **Candidate Experience** + - Simple upload interface + - Real-time feedback + - Clear communication + - Streamlined process + +## Technical Stack + +- **Framework**: Phidata +- **Model**: OpenAI GPT-4o +- **Integration**: Zoom API, EmailTools Tool from Phidata +- **PDF Processing**: PyPDF2 +- **Time Management**: pytz +- **State Management**: Streamlit Session State + + +## Disclaimer + +This tool is designed to assist in the recruitment process but should not completely replace human judgment in hiring decisions. All automated decisions should be reviewed by human recruiters for final approval. + +## Future Enhancements + +- Integration with ATS systems +- Advanced candidate scoring +- Video interview capabilities +- Skills assessment integration +- Multi-language support diff --git a/ai_agent_tutorials/ai_recruitment_agent_team/ai_recruitment_agent_team.py b/ai_agent_tutorials/ai_recruitment_agent_team/ai_recruitment_agent_team.py index 7fbd822..aa63971 100644 --- a/ai_agent_tutorials/ai_recruitment_agent_team/ai_recruitment_agent_team.py +++ b/ai_agent_tutorials/ai_recruitment_agent_team/ai_recruitment_agent_team.py @@ -13,10 +13,8 @@ from phi.model.openai import OpenAIChat from phi.tools.email import EmailTools from phi.tools.zoom import ZoomTool from phi.utils.log import logger -from dotenv import load_dotenv from streamlit_pdf_viewer import pdf_viewer -load_dotenv() class CustomZoomTool(ZoomTool): @@ -93,7 +91,7 @@ def init_session_state() -> None: defaults = { 'candidate_email': "", 'openai_api_key': "", 'resume_text': "", 'analysis_complete': False, 'is_selected': False, 'zoom_account_id': "", 'zoom_client_id': "", 'zoom_client_secret': "", - 'email_sender': "", 'email_passkey': "", 'company_name': "" + 'email_sender': "", 'email_passkey': "", 'company_name': "", 'current_pdf': None } for key, value in defaults.items(): if key not in st.session_state: @@ -362,7 +360,23 @@ def main() -> None: role = st.selectbox("Select the role you're applying for:", ["ai_ml_engineer", "frontend_engineer", "backend_engineer"]) with st.expander("View Required Skills", expanded=True): st.markdown(ROLE_REQUIREMENTS[role]) - resume_file = st.file_uploader("Upload your resume (PDF)", type=["pdf"]) + # Add a "New Application" button before the resume upload + if st.button("📝 New Application"): + # Clear only the application-related states + keys_to_clear = ['resume_text', 'analysis_complete', 'is_selected', 'candidate_email', 'current_pdf'] + for key in keys_to_clear: + if key in st.session_state: + st.session_state[key] = None if key == 'current_pdf' else "" + st.rerun() + + resume_file = st.file_uploader("Upload your resume (PDF)", type=["pdf"], key="resume_uploader") + if resume_file is not None and resume_file != st.session_state.get('current_pdf'): + st.session_state.current_pdf = resume_file + st.session_state.resume_text = "" + st.session_state.analysis_complete = False + st.session_state.is_selected = False + st.rerun() + if resume_file: st.subheader("Uploaded Resume") col1, col2 = st.columns([4, 1]) @@ -378,7 +392,6 @@ def main() -> None: with col2: st.download_button(label="📥 Download", data=resume_file, file_name=resume_file.name, mime="application/pdf") - if st.button("🗑️ Clear"): st.session_state.resume_text = ""; st.rerun() # Process the resume text if not st.session_state.resume_text: with st.spinner("Processing your resume..."): diff --git a/ai_agent_tutorials/ai_recruitment_agent_team/requirements.txt b/ai_agent_tutorials/ai_recruitment_agent_team/requirements.txt index e69de29..ac1d845 100644 --- a/ai_agent_tutorials/ai_recruitment_agent_team/requirements.txt +++ b/ai_agent_tutorials/ai_recruitment_agent_team/requirements.txt @@ -0,0 +1,12 @@ +# Core dependencies +phidata==2.7.3 +streamlit==1.40.2 +PyPDF2==3.0.1 +streamlit-pdf-viewer==0.0.19 +requests==2.32.3 +pytz==2023.4 +typing-extensions>=4.9.0 + +# Optional but recommended +black>=24.1.1 # for code formatting +python-dateutil>=2.8.2 # for date parsing