Your intelligent assistant for managing emails, calendar events, and tasks with natural language.
Shegs is an AI-powered workspace backend built with ADK-TS (Agent Development Kit) that helps you stay organized by managing your Google Calendar, Gmail, and tasks through natural conversation.
- AI Chat Interface: Natural language conversation with your workspace data
- Gmail Integration: Read, analyze, and manage your emails
- Google Calendar: View and manage your calendar events
- Task Management: Create, update, and track your tasks
- Email Priority Detection: AI-powered email prioritization
- Daily Summaries: Get intelligent summaries of your day
- Database-backed: Persistent storage with Prisma + SQLite/PostgreSQL
- Runtime: Node.js + TypeScript
- AI Framework: ADK-TS (Agent Development Kit)
- LLM: OpenAI GPT-4o-mini
- Database: SQLite (local) / PostgreSQL (production)
- ORM: Prisma
- API: Express.js REST API
- Authentication: Google OAuth 2.0
- Node.js 18+ installed
- Google Cloud Console project with Gmail & Calendar APIs enabled
- OpenAI API key
# Clone the repository
git clone <your-repo-url>
cd shegs
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env and add your API keys
# Initialize database
npx prisma db push
# Start development server
npm run devThe server will start on http://localhost:3002
# Health check
curl http://localhost:3002/api/health
# Chat with the AI assistant
curl -X POST http://localhost:3002/api/agent/chat \
-H "Content-Type: application/json" \
-d '{"message":"What tasks do I have today?"}'Create a .env file in the root directory:
# Server
PORT=3002
NODE_ENV=development
# OpenAI API (Required)
OPENAI_API_KEY=sk-proj-YOUR_KEY_HERE
# Google OAuth (Required for Gmail/Calendar)
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REDIRECT_URI=http://localhost:3002/api/auth/google/callback
GOOGLE_REFRESH_TOKEN=your_refresh_token
# Database (SQLite for local development)
DATABASE_URL="file:./prisma/dev.db"See .env.example for a complete template.
Full API documentation is available in API_DOCUMENTATION.md
| Endpoint | Method | Description |
|---|---|---|
/api/health |
GET | Health check |
/api/agent/chat |
POST | Chat with AI assistant |
/api/tasks |
GET/POST | Manage tasks |
/api/calendar/events |
GET | Get calendar events |
/api/email/inbox |
GET | Get inbox emails |
/api/email/priority |
GET | Get prioritized emails |
/api/auth/google |
GET | Start Google OAuth |
- Go to Google Cloud Console
- Create a new project
- Enable Gmail API and Google Calendar API
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth 2.0 Client ID
- Application type: Web application
- Authorized redirect URI:
http://localhost:3002/api/auth/google/callback - Copy the Client ID and Client Secret to your
.envfile
# Start the server
npm run dev
# Visit in your browser
http://localhost:3002/api/auth/google
# Authorize the app
# Your refresh token will be logged to the console
# Copy it to your .env file as GOOGLE_REFRESH_TOKENnpm run dev # Start development server with hot reload
npm run build # Build TypeScript to dist/
npm start # Run production build
npm run db:studio # Open Prisma Studio (database GUI)
npm run db:push # Push schema changes to database# View database in GUI
npx prisma studio
# Reset database (WARNING: deletes all data)
rm prisma/dev.db
npx prisma db push
# Generate Prisma Client after schema changes
npx prisma generateShegs is ready for deployment to Railway with PostgreSQL. See RAILWAY_DEPLOYMENT.md for detailed instructions.
- Update Database Provider: Change
provider = "sqlite"toprovider = "postgresql"inprisma/schema.prisma - Push to GitHub: Commit and push your code
- Create Railway Project: Connect your GitHub repo
- Add PostgreSQL: Add PostgreSQL database to your Railway project
- Set Environment Variables: Add all required env vars in Railway dashboard
- Deploy: Railway will automatically build and deploy
Important: Remember to switch back to provider = "sqlite" for local development after deploying.
shegs/
├── src/
│ ├── index.ts # Main server entry point
│ ├── adk/ # ADK agent configuration
│ ├── agents/ # AI agent definitions
│ ├── api/ # Express routes
│ ├── auth/ # Google OAuth logic
│ ├── db/ # Database client
│ ├── services/ # Business logic
│ │ ├── calendar.service.ts
│ │ ├── email.service.ts
│ │ ├── task.service.ts
│ │ └── chat.service.ts
│ ├── tools/ # ADK tools for AI agent
│ │ ├── calendar.tool.ts
│ │ ├── email.tool.ts
│ │ └── task.tool.ts
│ └── prompts/ # AI prompt templates
├── prisma/
│ ├── schema.prisma # Database schema
│ └── dev.db # SQLite database (local)
├── dist/ # Compiled JavaScript
├── package.json
├── tsconfig.json
└── .env # Environment variables (not in git)
Shegs uses ADK-TS to create an AI agent with access to your workspace data:
- User sends a message via
/api/agent/chat - AI Agent receives the message and decides which tools to use
- Tools execute (e.g., fetch emails, create tasks, check calendar)
- AI processes the results and responds in natural language
- Response sent back to the user
The agent has access to these tools:
get_tasks- Retrieve all taskscreate_task- Create a new taskupdate_task- Update task statusget_calendar_events- Get upcoming calendar eventsget_inbox- Get recent emailsget_unread_emails- Get unread emailssearch_emails- Search emails by queryget_priority_emails- Get AI-prioritized emailssend_email- Send an emailmark_email_read- Mark email as readget_daily_summary- Get AI-generated daily summary
User: "What do I have today?"
Agent: [Uses get_calendar_events and get_tasks]
"You have 3 meetings today: Team standup at 10am,
Client call at 2pm, and Code review at 4pm.
You also have 5 pending tasks..."
User: "Show me important emails"
Agent: [Uses get_priority_emails]
"Here are your 3 most important emails:
1. [CEO] Q4 Planning - High priority
2. [Client] Project Feedback - Medium priority
3. [Team] Sprint Review - Medium priority"
User: "Create a task to review the proposal"
Agent: [Uses create_task]
"I've created a task 'Review the proposal' with
medium priority and set it as pending."
Use the API documentation to test endpoints with curl or Postman.
See TESTING_PLAN.md for comprehensive testing scenarios.
npx prisma generate- Ensure redirect URI matches exactly in Google Console and
.env - Check that Gmail API and Calendar API are enabled
- Verify your refresh token is valid
- Check your API key is correct
- Ensure you have sufficient credits
- Verify the model name is correct (gpt-4o-mini)
- For SQLite: Check
prisma/dev.dbfile exists - For PostgreSQL: Verify
DATABASE_URLis correct - Run
npx prisma db pushto create tables
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
MIT License - feel free to use this project for your hackathon, portfolio, or production apps!
- ADK-TS: Built with the Agent Development Kit by IQ AI
- OpenAI: Powered by GPT-4o-mini
- Google APIs: Gmail & Calendar integration
- Prisma: Database ORM
- Railway: Deployment platform
- Documentation: See API_DOCUMENTATION.md and RAILWAY_DEPLOYMENT.md
- Issues: Open an issue on GitHub
- Questions: Create a discussion on GitHub
Shegs - Making workspace management effortless with AI.