Companion Chatbot - AI Tinkerers & Google Cloud: Agents Hackathon Toronto
AI Tinkerers - Toronto
Hackathon Showcase

Companion Chatbot

Build an opinionated, humanlike AI companion (coherent memory via vector store + agents) with asynchronous texting simulating realistic responses.

7 members Watch Demo

We created a companion textbot that communicates via a web interface. The textbot aims to reduce loneliness amongst seniors by acting as a virtual companion, which is one of the biggest applications of AI as senior loneliness (and loneliness in general across all adult demographics) is on the rise. What’s unique with this textbot is that there is a heavy focus on appearing personable and make creative use of past conversational memory to make the conversation more engaging.

We implemented this primarily using ADK. Our root agent orchestrates a variety of subagents and tools to produce the final output. The four main agents are as follows:

  1. Memory agent - responsible for fetching past conversational memories from a vector store and using the agent prompt instruction to identify the piece of memory that are most interesting to incorporate in a conversation
  2. Emotion agent - responsible for determining the tone an agent should respond in. The tone is determined by prompting the agent to produce an emotional word
  3. Guardrail agent - responsible for transforming the penultimate output into a safer version.
  4. Orchestrator - responsible for gathering the results from the other agents to generate the final output. Done via prompting.

We planned on a human-in-the-loop feature where the guardrail agent would upload any unsafe conversations to a caretaker portal to let them know when the conversation became unsafe and recommend intervention.

We encountered numerous issues setting up the project and bugs with ADK so we were unable to hide the sub agent messages. Also our original vision was to use voice as the chat interface, but ADK was quite buggy when using the live API in parallel with other vertex-ai models. We started our project using the ADK example here: https://google.github.io/adk-docs/streaming/custom-streaming-ws/.

To reproduce our repository, install the requirements.txt . Serve the /api using main.py “uvicorn main:app –reload”. Run the /companion-ai using adk web command and the dashboard-ui for the human in loop dashboard.

Project ideation