nangelov/ai-career-coach
1
Career Coach Agent
An AI-powered career coaching assistant that helps users create personalized development plans and provides career guidance.
Project Structure
career-coach-agent/
├── app.py # Main FastAPI application with agent setup
├── main.py # Application entry point
├── prompts.yaml # System prompts and templates
├── output_parser.py # Response parsing and validation
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── types/ # TypeScript type definitions
│ │ └── App.tsx # Main application component
├── tools/ # Tool implementations
│ ├── visit_webpage.py # Web page content fetcher
│ ├── wikipedia_tool.py # Wikipedia search tool
│ ├── python_repl.py # Python code execution tool
│ ├── internet_search.py # Internet search tool
│ ├── google_jobs_search.py # Google Jobs search tool
│ └── date_and_time.py # Date and time utilities
├── helpers/ # Helper functions
│ ├── helper.py # General helper functions
│ └── feedback_handler.py # Feedback processing
└── README.md # This fileRequirements
Backend
- Python 3.12+
- FastAPI
- LangChain
- Hugging Face Hub API token
- Additional dependencies:
- requests
- markdownify
- wikipedia
- duckduckgo-search
- pytz
- python-multipart
- uvicorn
Frontend
- Node.js 16+
- React
- TypeScript
- Additional dependencies:
- styled-components
- axios
- @types/react
- @types/styled-components
Environment Variables
Required environment variables:
HUGGINGFACEHUB_API_TOKEN=your_huggingface_tokenInstallation
- Clone the repository:
git clone <repository-url>
cd career-coach-agent- Install backend dependencies:
pip install -r requirements.txt- Install frontend dependencies:
cd frontend
npm install- Set up your Hugging Face API token as an environment variable.
Running the Application
Development Mode
- Start the backend:
uvicorn main:app --reload- Start the frontend development server:
cd frontend
npm startProduction Mode
- Build the frontend:
cd frontend
npm run build- Start the application:
uvicorn main:appThe application will be available at:
- Web Interface: http://localhost:8000
- API Documentation: http://localhost:8000/docs
API Endpoints
/agent/query (POST)
Submit queries to the AI assistant.
Request body:
{
"query": "string",
"thread_id": "string (optional)",
"context": {} (optional)
}/agent/feedback (POST)
Submit user feedback.
Request body:
{
"contact": "string",
"feedback": "string"
}/pdp-generator (POST)
Generate a Personal Development Plan.
Request body:
{
"file": "PDF file",
"career_goal": "string",
"additional_context": "string (optional)",
"target_date": "string"
}Available Tools
The AI assistant has access to the following tools:
- Wikipedia Search
- Searches Wikipedia for information about topics, people, or concepts
- Returns relevant summaries and information
- Web Page Visitor
- Fetches and processes content from web pages
- Converts HTML to markdown for better readability
- Handles timeouts and errors gracefully
- Python Code Execution
- Executes Python code in a safe environment
- Returns execution results
- Handles syntax errors and runtime exceptions
- Internet Search
- Performs web searches using DuckDuckGo
- Returns relevant search results
- Useful for finding current information
- Google Jobs Search
- Searches for job listings on Google Jobs
- Returns relevant job opportunities
- Helps with career research
- Date and Time
- Provides current date and time information
- Supports multiple timezones
- Useful for scheduling and planning
Features
Frontend
- Modern, responsive UI built with React and TypeScript
- Real-time chat interface with message history
- Personal Development Plan (PDP) generation
- PDF upload and processing
- User feedback system
- Mobile-friendly design
Backend
- FastAPI-based REST API
- LangChain-powered AI agent
- Conversation memory and context management
- Error handling and graceful degradation
- CORS support
- Interactive API documentation
- Tool execution with proper error handling
- Markdown formatting for better readability
Architecture
- Frontend:
- React with TypeScript
- Styled Components for styling
- Axios for API communication
- Responsive design for all devices
- Backend:
- FastAPI: Handles HTTP requests and API endpoints
- LangChain: Manages the AI agent and tools
- Llama-3.3-70B-Instruct: Powers the AI responses
- YAML Configuration: Manages system prompts and templates
- Tools Integration: Wikipedia, Web, Python, Search, and more
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
[Add your license here]
