Senthamiz Kumaran
← All notes

NOTES FROM THE WORKBENCH

Talking to My Computer Through an AI Desk Buddy

EngineeringAIESP32Side Projects

“What response format did I decide on for the orders API?”

I ask the small device on my desk. It searches my Obsidian notes through a service on my laptop and speaks the answer back, with citations I can follow to the source.

That is why I’m building AI Desk Buddy. I’ve already written down project decisions and details in Obsidian. I want to ask about them without first remembering which file contains the answer.

Illustration of a breadboard desk companion with an exposed ESP32 board, a small screen showing two eyes, a microphone, and a speaker.
Illustration of the Buddy prototype, generated with AI. The hardware arrangement is illustrative, not a wiring guide.

One question, from my desk to my notes

A spoken question crosses a few boundaries before it reaches my notes. Each component has a specific job:

  • Buddy: the ESP32 device captures my voice and plays the spoken response.
  • Xiaozhi: the voice assistant handles the conversation and decides when to call a tool. I use its cloud service at xiaozhi.me.
  • MCP bridge and tools: Model Context Protocol (MCP) connects the assistant to callable tools. My laptop runs the bridge and Python functions, including search_obsidian_notes.
  • Note service: a separate process on my laptop finds relevant passages in my Obsidian vault and prepares a cited answer. This is the RAG part, explained below.
  • OpenAI and Supabase: OpenAI generates embeddings and answers; Supabase stores the vectors and metadata used for semantic search.

Here is the request and return path:

A spoken question travels from Buddy through Xiaozhi and the laptop MCP tool to the RAG note service. The answer and citations return along the same path.
One request out, one result back. Buddy speaks the answer.

The overall setup

Overall MCP architecture: Buddy connects to Xiaozhi’s cloud voice service, which calls Python tools through an MCP bridge on my laptop. The tools connect to Todoist and a note service using Obsidian, OpenAI, and Supabase.
The overall MCP setup for notes and Todoist. The separate WebSocket reminder backend is not shown. Hardware is illustrative.

How the RAG part works

The voice assistant needs a way to answer from my notes. Retrieval-augmented generation (RAG) does this in two stages: retrieve relevant passages, then give them to the model as context for an answer.

For the orders API question, the note service looks for the passages where I recorded the response format. The model gets those passages with my question, rather than the whole vault in every request.

First, prepare the notes

The note service reads the allowed Markdown files in my Obsidian vault and splits them into chunks around headings and paragraphs. OpenAI turns each chunk into an embedding: a vector representing its content, used to search for passages with similar meaning. Supabase stores these vectors alongside metadata identifying the source passage.

The service checks for changes every minute by default. New or changed chunks get embedded again; deleted chunks are removed from the index.

Then, answer a question

  1. Retrieve: embed the question and search for similar vectors in Supabase. Also search the local vault for keyword matches. This hybrid search combines meaning with exact terms, which helps with names such as “orders API.”
  2. Select: merge the rankings and choose up to four passages by default.
  3. Generate: send the question and selected passages to OpenAI to compose an answer with citations such as [[note#heading]].
  4. Return: send the answer through MCP to Xiaozhi, which speaks it through Buddy.

Retrieval chooses what the model can draw on; generation turns that context into an answer. I can follow the citations to check what the notes actually say.

The original files stay in my vault. Supabase holds vectors and metadata, not plaintext notes. OpenAI receives note chunks for embeddings and selected passages for answers; the question and final answer also pass through Xiaozhi.

Making Buddy my own

I first tried building the voice pipeline myself. I wrote a custom animated face with rounded eyes, blinking, glances, and expressions tied to Buddy’s state. I also built the device’s WebSocket communication with my backend, including reconnecting and streaming voice audio.

I then found the Xiaozhi project and adapted its existing voice foundation to my hardware. With Codex’s help, I added an ai-desk-buddy-s3 board definition, configured the pins, audio, and display, and built it for my SSD1306 screen. The custom face belongs to my original firmware path; the Xiaozhi target currently uses its existing display implementation.

On the laptop, I built the MCP bridge and Python tools for notes and Todoist. My separate backend handles conversations and stored reminders over WebSocket. Together, these services turn a spoken request into an action or an answer from my notes.

I hadn’t worked in firmware before. Codex helped me navigate the code and build process, while I checked what actually happened on the device.

Two other jobs I use it for

“Add a todo to unsubscribe from Amazon next month.” The MCP tool creates a task in Todoist. Scheduling requires a concrete date behind “next month.” It gets the thought into an app I already use.

“Remind me to pick up my daughter at 2:30.” My WebSocket backend stores the reminder in a database and delivers it later for Buddy to speak. It survives backend restarts; if Buddy disconnects, delivery waits for reconnection.

Still a prototype

My laptop and MCP bridge need to stay running for the tools to work. Spoken reminders need the backend and device connection too. Making those services easier to keep running is my next practical improvement, alongside tidying up the hardware.

The part I want to keep developing is the connection to my own information: more questions I can ask, and more useful answers I can trace back to the notes.

Build your own

The AI Desk Buddy repository contains the firmware and services. To work toward the same setup:

  1. Get the device listening and speaking. This Xiaozhi setup video on YouTube is a hardware starting point. Use the repository for my board-specific configuration.
  2. Run the note service. Follow the note-service setup to configure your vault, OpenAI, and Supabase. This provides the RAG service independently of the device.
  3. Connect it to Xiaozhi. Start with Xiaozhi’s own MCP sample and quick-start instructions, which show how to connect a Python MCP tool through its WebSocket pipe. Use the endpoint from your Xiaozhi console and my repository’s note-search tool for this setup. Keep both the bridge and note service running, then try a question you can check against your notes.

The WebSocket reminder backend is a separate integration; it isn’t required for the MCP note-search path.