Spaces:
Running
Running
metadata
title: Career Coach Agent
emoji: π§βπΌ
colorFrom: blue
colorTo: indigo
sdk: docker
app_port: 8000
python_version: 3.12.3
short_description: AI career coach powered by Llama-3.3-70B-Instruct
tags:
- career
- ai
- langchain
- fastapi
- coaching
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 file
Requirements
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_token
Installation
- 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 start
Production Mode
- Build the frontend:
cd frontend
npm run build
- Start the application:
uvicorn main:app
The 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]