Skip to content

Bril3d/My-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Agent

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.

Features

  • 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.

Setup

To set up and run this project, follow these steps:

Prerequisites

  • Python 3.x
  • uv (a package installer and resolver, similar to pip and pip-tools)
  • Pushover account for notifications (optional, but recommended for full functionality)

Installation

  1. Clone the repository:

    git clone <repository_url>
    cd my_agent
  2. Install dependencies using uv:

    uv sync
  3. Set up environment variables:

    Create a .env file 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_KEY with your actual Google Gemini API key.
    • Replace YOUR_PUSHOVER_USER_KEY and YOUR_PUSHOVER_API_TOKEN with your Pushover user key and application token, respectively, if you wish to use the notification feature. If not, you can omit these lines.
  4. 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.

Usage

To start the conversational AI agent, run the Jupyter notebook:

jupyter notebook main.ipynb

Once the notebook is running, execute all cells. A Gradio interface will launch in your browser, allowing you to interact with the AI agent.

Project Structure

  • main.ipynb: The main Jupyter notebook containing the AI agent's logic, API calls, tool definitions, and Gradio interface setup.
  • data/: Directory containing Profile.pdf and summary.txt which are used as context for the AI.
  • pyproject.toml: Project configuration for uv.
  • uv.lock: Lock file for dependency management.
  • README.md: This README file.

Extending the Agent

  • 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_details and record_unknown_question.
  • Updating Knowledge Base: Modify data/Profile.pdf and data/summary.txt to update the information the AI uses to answer questions.
  • Customizing Prompts: Adjust the system_prompt variable in main.ipynb to refine the AI's persona and conversational style.

License

This project is open-source and available under the MIT License.

About

Career Digital Twin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors