Skip to content

About

Implementation of the Google Assistant SDK as an Alexa skill

Resources

Code of conduct

Contributing

Security policy

Stars

15 stars

Watchers

1 watching

Forks

Latest commit

 

History

31 Commits

Folders and files

Alexa Echo Dot with Google Assistant colours

Alexa Assistant

Use Google Assistant through your Amazon Alexa device.

An unofficial Alexa skill that forwards your questions to the Google Assistant API and plays back Google's spoken answer.

Latest release License: GPL-3.0 Node.js 24 Serverless Framework v4

Important

Something not working? Check Troubleshooting before opening an issue.

Table of contents

Features

  • Ask Google anything from any Alexa device: "Alexa, ask google what's the weather like".
  • Spoken answers in Google's voice, plus a visual card on Echo Show and other screen devices (APL).
  • Follow-up questions keep the session open when Google expects a reply.
  • Location-aware answers. The skill looks for a location in this order:
    1. a location you saved by voice,
    2. the Alexa device's GPS (mobile devices),
    3. the Alexa device's address,
    4. the address in your Google profile.
  • Language preference saved per user, for example German, Japanese, or British English.
  • Self-hosted on your own AWS account. Deployment uses one Serverless Framework command.

How it works

sequenceDiagram
    participant U as You
    participant A as Alexa
    participant L as AWS Lambda
    participant G as Google Assistant API
    participant S as Amazon S3

    U->>A: "Alexa, ask google …"
    A->>L: Intent request + linked Google token
    L->>G: Text query over gRPC
    G-->>L: Audio response (PCM)
    L->>L: Encode PCM to MP3
    L->>S: Upload MP3
    S-->>L: Short-lived signed URL
    L-->>A: SSML audio + APL card
    A-->>U: Plays Google's answer
Loading

User settings (saved location and language) are stored in a DynamoDB table.

Prerequisites

Installation

The full step-by-step guide is in docs/serverless_install.md. It covers the Alexa interaction model, the Google OAuth setup, and account linking. Short version:

git clone https://github.com/rokmohar/alexa-assistant.git
cd alexa-assistant
npm install
cp .env.example .env   # then fill in your values (see Configuration)
npm run deploy:prod

Serverless creates the Lambda function, the S3 bucket for audio, and the AlexaAssistantSkillSettings DynamoDB table.

Other ways to install

Prebuilt release ZIP

Every release includes alexa-assistant-vX.Y.Z.zip. You can upload it to a Lambda function in the AWS Console:

  • Runtime: Node.js 24.x
  • Handler: index.handler
  • Environment variables: see Configuration

With this option you must create the S3 bucket, the DynamoDB table (AlexaAssistantSkillSettings, partition key userId), and the IAM permissions yourself. serverless.yml shows what is needed.

Build the ZIP with Docker
docker build -t alexa-assistant .
docker run --rm --entrypoint cat alexa-assistant ./lambda.zip > lambda.zip

Configuration

Set these in .env. Serverless passes them to the Lambda function.

Variable Required Default Description
ALEXA_SKILL_ID Yes — Skill ID from the Alexa Developer Console
GOOGLE_PROJECT_ID Yes — Google Cloud project ID
S3_BUCKET Yes — Bucket name for audio (must be globally unique)
GOOGLE_API_ENDPOINT No embeddedassistant.googleapis.com Google Assistant gRPC endpoint

Usage

Enable the skill in the Alexa app and link your Google account. Then try:

Say Result
"Alexa, ask google who is the queen of england" Asks Google Assistant
"Alexa, ask google to set my location to Paris" Saves a location for location-aware answers
"Alexa, ask google what location is saved" Reads back the saved location
"Alexa, ask google to clear my location" Removes the saved location
"Alexa, ask google to set my language to German" Sets the language for Google's answers
"Alexa, ask google what language is set" Reads back the language
"Alexa, ask google to reset my language" Uses the Alexa device's language again

Supported languages: English (US, UK, Australia, Canada, India), German, French (France, Canada), Spanish, Italian, Japanese, Korean, and Portuguese.

Development

npm install          # also installs the Husky pre-commit hook (ESLint + Prettier)
npm run build        # bundle to dist/ with webpack + Babel
npm start            # run locally with serverless-offline
Script Description
npm run typecheck Type-check with tsc
npm run lint Lint with ESLint (lint:fix to auto-fix)
npm run format Check formatting (format:fix to apply)
npm run deploy Deploy the default stage
npm run logs Tail the Lambda function's CloudWatch logs

Project layout:

src/
├── index.ts        # Alexa request handlers (intents)
├── config/         # Environment config, validated with zod
├── services/       # Assistant (gRPC), Encoder (MP3), Bucket (S3), Location, …
├── factories/      # Service wiring
├── interfaces/     # Shared types
└── errors/         # Error types and handler

Troubleshooting

Uninstalling

  1. The audio bucket has versioning turned on, so CloudFormation can't delete it until it's empty. Open the bucket in the S3 console and click Empty. This also deletes old versions.

  2. Remove the stack:

    npx serverless remove

This removes the Lambda function, the S3 bucket, and the DynamoDB table. Your saved locations and languages are deleted too.

Contributing

Contributions are welcome. See CONTRIBUTING.md for development setup and the pull request process. This project follows the Code of Conduct.

Found a security issue? Please follow the Security policy instead of opening a public issue.

License

GPL-3.0 © Rok Mohar


This project is not affiliated with, endorsed by, or sponsored by Google LLC or Amazon.com, Inc. Google Assistant is a trademark of Google LLC. Alexa and Echo are trademarks of Amazon.com, Inc.

About

Implementation of the Google Assistant SDK as an Alexa skill

Resources

Code of conduct

Contributing

Security policy

Stars

15 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages