- Nandhini R
- Muhammed Shah
- Aditya S
A conversational AI assistant that helps professionals manage emails, calendar events, documentation, and code review tasks.
Modern professionals are burdened with repetitive yet cognitively demanding tasks such as replying to emails, managing schedules, generating structured documents, and reviewing code. These tasks often interrupt deep work and reduce productivity. There is a growing need for an intelligent assistant that can operate as a reliable “work buddy” to offload and automate such responsibilities.
PA Agent is designed to be a reliable "work buddy" that can help offload repetitive yet cognitively demanding tasks such as:
- Replying to emails
- Managing schedules
- Generating structured documents
- Reviewing code
The solution is built around a conversational agent interface where users can interact naturally through a chat UI. The system internally routes tasks to different tools powered by Gemini API.
- Frontend: React.js with Vercel AI SDK (
@ai-sdk/react
) - UI Components: 21st Dev design system (Chat Message List component)
- Backend: Python (FastAPI)
- LLM: Gemini API
- Authentication & API Access:
- Google OAuth 2.0
- Gmail API (email read/send)
- Google Calendar API (schedule creation)
- Tool Invocation:
- Agent orchestration using Vercel AI SDK's multi-step tool-calling system
- Tools defined in TypeScript and executed via HTTP calls to Python backend
-
Email Assistant
- Fetch and summarize unread emails
- Draft intelligent responses using Gemini
- Send emails via Gmail API
-
Calendar Planner
- Create events from natural language descriptions
- Manage Google Calendar events
-
Project Documentation
- Generate project plans from brief prompts
- Draft reports and presentation outlines
-
Code Review
- Analyze code snippets and provide feedback
- Suggest refactoring improvements
- Explain code functionality
/
├── frontend/ # React.js frontend application
│ ├── public/ # Static files
│ └── src/
│ ├── components/ # React components
│ ├── services/ # API service clients
│ ├── tools/ # Tool definitions for Vercel AI SDK
│ ├── types/ # TypeScript type definitions
│ └── pages/ # Page components and API routes
├── backend/ # Python FastAPI backend
│ ├── main.py # Main application entry point
│ ├── requirements.txt # Python dependencies
│ └── routers/ # API route handlers
└── README.md # Project documentation
- Node.js (v16+)
- Python (v3.9+)
- Google Cloud Platform account with OAuth and API access
-
Create a Python virtual environment and activate it:
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up your environment variables by copying
.env.example
to.env
and filling in your API keys and credentials. -
Start the FastAPI server:
uvicorn main:app --reload
-
Install the required dependencies:
cd frontend npm install
-
Create a
.env
file with the following contents:REACT_APP_API_URL=http://localhost:8000
-
Start the development server:
npm start
-
Open http://localhost:3000 in your browser to access the application.
Based on your codebase, you need to get Google OAuth credentials for Gmail and Calendar API access. Here's how to do it:
-
Create a Google Cloud Project:
- Go to the Google Cloud Console
- Click "Create Project" in the top right
- Enter a project name (e.g., "PA Agent") and click "Create"
-
Enable the necessary APIs:
- In your project, go to "APIs & Services" > "Library"
- Search for and enable these APIs:
- Gmail API
- Google Calendar API
- People API (for user information)
-
Configure OAuth Consent Screen:
- Go to "APIs & Services" > "OAuth consent screen"
- Select "External" user type (unless you have a Google Workspace)
- Fill in the required fields:
- App name: "PA Agent"
- User support email: Your email
- Developer contact information: Your email
- Click "Save and Continue"
- Add the scopes your app needs:
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/calendar.events
-
- Click "Save and Continue"
- Add test users (including your own email)
- Click "Save and Continue"
-
Create OAuth Credentials:
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth client ID"
- Choose "Web application" as the application type
- Name: "PA Agent Web Client"
- Add authorized JavaScript origins:
http://localhost:3000
- Add authorized redirect URIs:
http://localhost:3000/auth/callback
- Click "Create"
- You'll get a client ID and client secret - save these!
-
Download Client Secret JSON:
- After creating the credentials, you'll see a download button
- Download the JSON file and save it as client_secret.json in your backend directory
-
Update Your .env File:
- Open your
.env
file in the backend directory - Add your Google client ID and client secret:
- Open your
-
Get a Gemini API Key (if you don't have one):
- Go to Google AI Studio
- Create an API key
- Add it to your
.env
file: