Skip to content

Repository files navigation

AdvisorAI

Your clients email you. You meet them. You log notes in CRM. But it's all in different places.

AdvisorAI is a ChatGPT-style copilot that plugs into Gmail, Google Calendar, and HubSpot so you can ask questions about your clients and automate tasks through one conversation.

Demo

Demo

What you can do

Ask anything about your clients

  • "Who mentioned their kid plays baseball?"
  • "Why did Greg want to sell AAPL stock?"
  • "What did Sara email me about last week?"

The agent searches across Gmail, Calendar, and HubSpot and gives you the answer.

Take action through chat

  • "Schedule an appointment with Sara Smith" - looks her up, sends availability, adds to calendar
  • "Draft a follow-up to John about the 529 plan" - pulls context from past emails
  • "When someone emails me that's not in HubSpot, create a contact" - sets up a rule that runs automatically

Ongoing automation

  • Set rules like "When I add an event, email the attendees" - agent remembers and acts on them
  • Multi-step tasks persist until complete
  • Activity feed shows everything the agent has done

How it works

  1. Background sync - pulls emails, calendar events, and HubSpot contacts into the database
  2. Embeddings - all data gets embedded with pgvector for semantic search
  3. Chat - you ask questions or give instructions through the chat interface
  4. Agent - GPT-4 with tool calling handles requests using synced data
  5. Automation - triggers from email/calendar/CRM events cause the agent to act on your rules
  6. Tasks - multi-step workflows persist and continue until complete

Tech Stack

  • Next.js 15 (React 18), TypeScript
  • Prisma + PostgreSQL (pgvector for embeddings)
  • NextAuth v5 for OAuth
  • OpenAI API (GPT-4 + embeddings)
  • TailwindCSS

Quick Start

Prerequisites

  • Node.js 18.18+
  • PostgreSQL 14+ with pgvector extension
  • Google Cloud OAuth app
  • HubSpot developer account
  • OpenAI API key

Setup

git clone https://github.com/Saumya29/advisor-ai.git
cd advisor-ai
npm install
cp .env.example .env.local

Fill in your API keys, then:

npm run prisma:generate
npm run prisma:migrate
npm run dev

Environment Variables

Variable Description
APP_BASE_URL Your deployment URL
DATABASE_URL Postgres connection string
NEXTAUTH_SECRET openssl rand -base64 32
TOKEN_ENCRYPTION_KEY openssl rand -base64 32
OPENAI_API_KEY OpenAI API key
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET Google OAuth
HUBSPOT_CLIENT_ID / HUBSPOT_CLIENT_SECRET HubSpot OAuth

Project Structure

  • /app - Next.js app router pages and API routes
  • /lib - Core logic (auth, integrations, agent, automation)
  • /components - React UI components
  • /prisma - Database schema and migrations
  • /docs - Architecture and deployment guides

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages