Inspiration

Needed a hyper personalised assistant for myself as i use google services in my day to day life.

What it does

Bachmanity is a real-time multimodal AI assistant powered by Gemini's Live API with native audio. On connect, it automatically fetches your unread emails, today's remaining calendar events, and pending task then delivers a spoken daily briefing so you're up to speed instantly. You can talk to it naturally/interrupt, share your screen or camera for visual context, and ask it to draft emails, create events, manage tasks, search your Drive, or look up contacts all through voice and or text. It sees what you see, hears what you say, and acts on your Google Workspace in real time.

How we built it

  • Gemini 2.5 Flash with native audio streaming via the v1alpha Live API for real-time bidirectional speech
  • FastAPI backend with WebSocket transport, running 4 concurrent async pipelines (audio send, video send, text send, receive loop) using asyncio
  • Google Workspace APIs (Gmail, Calendar, Tasks, People, Drive) authenticated via OAuth2 with automatic token refresh and service caching
  • tool declarations registered as Gemini function calls, with a tool executor that runs sync Google API calls via run_in_executor
  • Auto-briefing system that queues a startup prompt on WebSocket connect, passing today's date and current time so the agent filters out past calendar events

Challenges we ran into

  • Concurrency issues
  • OAuth scope management was tricky
  • Calendar API requires proper RFC3339 timestamps with timezone offsets; naive datetimes silently failed, so we had to integrate zoneinfo.ZoneInfo for correct time handling
  • Building a markdown renderer that works with streaming text was non-trivial — the italic regex (text) kept consuming bullet point markers (* item), requiring careful regex ordering and stricter pattern matching

Accomplishments that we're proud of

  • It was built in very short amount of time
  • Added many tools that are used in day to day life

What we learned

  • Live API is really capable and has a very high predictability in function calls

What's next for bachmanity

  • Make it more easy to use and reduce latency further

Built With

Share this project:

Updates

Submission history