Skip to content

eteen12/mit-hackathon-2

Repository files navigation

🤖 Otto - Your AI Executive Assistant that Actually Calls People

Next.js Auth.js MongoDB Atlas Tailwind CSS ElevenLabs Twilio

Built for MIT HackNation Global AI Hackathon.

Otto isn't just a chatbot. It's an autonomous voice agent that lives in your browser, connects to your real Google Calendar, finds local businesses, and physically calls them to negotiate appointments on your behalf.

Stop waiting on hold. Let Otto do it.

🎥 Demo

Watch the demo video

click to watch on youtube

🚀 The Problem

Booking sucks you have to:

  1. google
  2. check hours against your calendar
  3. call and wait on hold
  4. negotiate a time that works

💡 The Solution

You tell Otto: "I popped my tire, and I need it fixed asap."

Otto does the rest

  1. Scans your calendar for free spots
  2. Finds highly rated mechanics near you
  3. Calls the office for you using Elevenlabs AI
  4. Negotiates a time slot
  5. Updates you with a confirmation and transcript

Highlights (the AI stuff)

  • Voice agent + outbound calling (ElevenLabs ConvAI → Twilio transport)
    • dynamically generated call prompt per task/person
    • live call status tracking
    • transcript + summary displayed after completion
  • Tool-using concierge
    • pulls user context from MongoDB
    • checks Google Calendar availability
    • searches Google Places (nearby options)
  • Production-style glue
    • Google OAuth sign-in (Auth.js) + persistent sessions
    • user profile stored in MongoDB

Demo Flow

  1. Sign in with Google (/login)
  2. Fill profile (/profile) — name/email, plus address/phone/about
  3. Ask Otto to book something (home chat)
  4. Otto proposes a call plan → you click Initiate Call
  5. Watch the live status → see transcript + summary at the end

Tech Stack

  • Next.js 16 (App Router)
  • Auth.js / NextAuth v5 (beta) + Google provider
  • MongoDB
    • @auth/mongodb-adapter for Auth.js persistence
    • mongoose for app profile data (lib/models/User.js)
  • Tailwind CSS v4
  • Google APIs
    • Calendar API (read events)
    • Places API (text search)
  • ElevenLabs Conversational AI (signed session URL + outbound calling)
  • Twilio (used by ElevenLabs outbound call flow)

How It Works (short)

  • The UI chat (“Otto”) collects intent and context.
  • Server actions + tool calls enrich the request:
    • actions/getUserContext.js (MongoDB)
    • actions/getCalendarEvents.js (Google Calendar)
    • lib/conciergeTools.js (Places search)
  • When it’s time to act, the app calls:
    • POST /api/make-call → creates an ElevenLabs outbound call with a task-specific prompt
    • GET /api/call-status?callId=... → polls status + transcript

Getting Started

1) Install

npm install

2) Environment variables

cp .env.example .env.local

Fill in .env.local (see next section).

3) Run

npm run dev

Open http://localhost:3000


Keys / Services

Required (to log in + persist users)

  • Auth.js
    • AUTH_SECRET (generate with npx auth secret)
    • AUTH_URL (recommended) e.g. http://localhost:3000
  • Google OAuth
    • GOOGLE_CLIENT_ID
    • GOOGLE_CLIENT_SECRET
    • Add redirect URI: http://localhost:3000/api/auth/callback/google
  • MongoDB
    • MONGODB_URI

Optional (but this is what makes it feel like an AI agent)

  • Google Calendar API (availability checks)
    • requested via OAuth scope in auth.config.ts
  • Google Places API (nearby search)
    • NEXT_PUBLIC_GOOGLE_MAPS_API_KEY

Voice + Calling (ElevenLabs)

These power the “call someone and get it done” part:

  • ELEVENLABS_API_KEY
  • ELEVENLABS_AGENT_ID (in-app conversational agent)
  • ELEVENLABS_CALLER_AGENT_ID (outbound caller agent)
  • ELEVENLABS_PHONE_ID
  • PERSONAL_PHONE_NUMBER (the number to call)

Scripts

npm run dev
npm run build
npm run start
npm run lint

Project Structure

  • auth.ts / auth.config.ts — Auth.js config, scopes, routing
  • app/login — Google sign-in
  • app/profile — profile editor backed by MongoDB
  • actions/* — server actions used as tools (context + calendar)
  • lib/* — Mongo client, Mongoose model, concierge tool wrappers
  • app/api/elevenlabs/session — signed ConvAI session URL
  • app/api/make-call — creates outbound call (ElevenLabs)
  • app/api/call-status — polls status + transcript

Troubleshooting

  • Callback URL errors: set AUTH_URL in .env.local and restart.
  • Turbopack/cache weirdness: rm -rf .next then restart.
  • Calendar token missing: re-login and accept Calendar permissions.

License

MIT (or your preferred license)

About

OttoMate phone calls and have the bot do it for you

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors