This project implements a conversational AI agent designed to act as a virtual assistant for a personal website, specifically for Khaled Briki. The agent is capable of answering questions related to Khaled's career, background, skills, and experience, drawing information from a provided summary and LinkedIn profile. It also includes functionality to record user details (like email addresses) and log unanswered questions for further review.
- AI-Powered Conversations: Engages users in professional and engaging conversations, acting as Khaled Briki.
- Contextual Understanding: Utilizes a summary and LinkedIn profile to provide accurate answers about Khaled's professional background.
- User Detail Recording: Records user email addresses and names for follow-up, using a Pushover notification system.
- Unknown Question Logging: Logs questions that the AI cannot answer, helping to identify gaps in its knowledge base.
- Gradio Interface: Provides a user-friendly web interface for interaction.
To set up and run this project, follow these steps:
- Python 3.x
uv(a package installer and resolver, similar to pip and pip-tools)Pushoveraccount for notifications (optional, but recommended for full functionality)
-
Clone the repository:
git clone <repository_url> cd my_agent
-
Install dependencies using
uv:uv sync
-
Set up environment variables:
Create a
.envfile in the project root with the following variables:GEMINI_API_KEY="YOUR_GEMINI_API_KEY" PUSHOVER_USER="YOUR_PUSHOVER_USER_KEY" # Optional PUSHOVER_TOKEN="YOUR_PUSHOVER_API_TOKEN" # Optional- Replace
YOUR_GEMINI_API_KEYwith your actual Google Gemini API key. - Replace
YOUR_PUSHOVER_USER_KEYandYOUR_PUSHOVER_API_TOKENwith your Pushover user key and application token, respectively, if you wish to use the notification feature. If not, you can omit these lines.
- Replace
-
Prepare data files:
Ensure you have the following files in the
data/directory:Profile.pdf: A PDF document containing the LinkedIn profile content.summary.txt: A text file summarizing Khaled Briki's background.
To start the conversational AI agent, run the Jupyter notebook:
jupyter notebook main.ipynbOnce the notebook is running, execute all cells. A Gradio interface will launch in your browser, allowing you to interact with the AI agent.
main.ipynb: The main Jupyter notebook containing the AI agent's logic, API calls, tool definitions, and Gradio interface setup.data/: Directory containingProfile.pdfandsummary.txtwhich are used as context for the AI.pyproject.toml: Project configuration foruv.uv.lock: Lock file for dependency management.README.md: This README file.
- Adding New Tools: You can extend the agent's capabilities by defining new Python functions and their corresponding JSON schema for tool calls, similar to
record_user_detailsandrecord_unknown_question. - Updating Knowledge Base: Modify
data/Profile.pdfanddata/summary.txtto update the information the AI uses to answer questions. - Customizing Prompts: Adjust the
system_promptvariable inmain.ipynbto refine the AI's persona and conversational style.
This project is open-source and available under the MIT License.